Bump to version 0.9.4
[platform/upstream/libunistring.git] / configure.ac
1 dnl Configuration for the toplevel directory of GNU libunistring
2 dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
3 dnl
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 dnl Process this file with autoconf to produce a configure script.
18
19 AC_PREREQ([2.63])
20 AC_INIT
21 AC_CONFIG_SRCDIR([lib/unistring/version.in.h])
22 AC_CONFIG_AUX_DIR([build-aux])
23 . $srcdir/version.sh
24 gl_INIT_PACKAGE([libunistring], [$VERSION_NUMBER])
25 AM_INIT_AUTOMAKE([silent-rules dist-xz])
26 AM_CONFIG_HEADER([config.h])
27
28 dnl Override automake's tar command used for creating distributions.
29 am__tar='${AMTAR} chof - --owner=root --group=root "$$tardir"'
30
31 dnl Checks for basic programs.
32
33 AC_PROG_CC
34 AC_PROG_CPP
35 AC_PROG_INSTALL
36 AC_PROG_MKDIR_P
37
38 dnl Check for host type.
39
40 AC_CANONICAL_HOST
41
42 dnl Checks that augment the CPPFLAGS.
43
44 gl_EARLY
45
46 dnl Checks for compiler output filename suffixes.
47
48 AC_OBJEXT
49 AC_EXEEXT
50
51 dnl Check for build configuration.
52
53 gl_WOE32_DLL
54
55 LT_INIT([win32-dll])
56
57 dnl Prepares the libtool configuration for handling of Windows resources, and
58 dnl sets the RC variable to a program that compiles Windows resource files.
59 LT_LANG([Windows Resource])
60
61 dnl On mingw and Cygwin, we can activate special Makefile rules which add
62 dnl version information to the shared libraries and executables.
63 case "$host_os" in
64   mingw* | cygwin*) is_woe32=yes ;;
65   *) is_woe32=no ;;
66 esac
67 AM_CONDITIONAL([WOE32], [test $is_woe32 = yes])
68
69 dnl Checks for types, header files, functions and declarations.
70
71 gl_INIT
72
73 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
74 dnl 1. when we install a shared library, we must arrange to export
75 dnl    auxiliary pointer variables for every exported variable,
76 dnl 2. when we install a shared library and a static library simultaneously,
77 dnl    the include file specifies __declspec(dllimport) and therefore we
78 dnl    must arrange to define the auxiliary pointer variables for the
79 dnl    exported variables _also_ in the static library.
80 if test "$enable_shared" = yes; then
81   case "$host_os" in
82     mingw* | cygwin*) is_woe32dll=yes ;;
83     *) is_woe32dll=no ;;
84   esac
85 else
86   is_woe32dll=no
87 fi
88 AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
89 if test $is_woe32dll = yes; then
90   DLL_VARIABLE='__declspec (dllimport)'
91 else
92   DLL_VARIABLE=
93 fi
94 AC_SUBST([DLL_VARIABLE])
95 dnl Some parts of the tests have to be skipped when the tests are linked with
96 dnl the shared library. This is because in this situation, the address of a
97 dnl global variable in the shared library cannot be used as initializer of a
98 dnl global or static variable.
99 dnl gcc would say: "error: initializer element is not constant".
100 if test $is_woe32dll = yes; then
101   AC_DEFINE([WOE32DLL], [1],
102     [Define when --enable-shared is used on mingw or Cygwin.])
103 fi
104
105 dnl Namespacing is the default: it builds a namespace clean library.
106 dnl Allow the user to disable namespacing. This speeds up "make" considerably.
107 AC_ARG_ENABLE([namespacing],
108   [  --disable-namespacing   build a library that exports undesired symbols],
109   [:], [enable_namespacing=yes])
110 if test "$enable_namespacing" != no; then
111   NAMESPACING=yes
112 else
113   NAMESPACING=
114 fi
115 AC_SUBST([NAMESPACING])
116
117 dnl Check for prerequisites of exported.sh.
118 gt_GLOBAL_SYMBOL_PIPE
119
120 dnl Substitutable version number.
121 AC_PROG_AWK
122 changequote(,)
123 sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
124 i\
125 0
126 q
127 '
128 sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
129 i\
130 0
131 q
132 '
133 sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;}
134 i\
135 0
136 q
137 '
138 changequote([,])
139 version_major=`echo "${VERSION}" | sed -n -e "$sed_extract_major"`
140 version_minor=`echo "${VERSION}" | sed -n -e "$sed_extract_minor"`
141 version_subminor=`echo "${VERSION}" | sed -n -e "$sed_extract_subminor"`
142 HEXVERSION=0x`$AWK 'BEGIN { printf("%02X%02X%02X"',"$version_major","$version_minor","$version_subminor"') }'`
143 AC_SUBST([HEXVERSION])
144
145 dnl Check for tools needed for formatting the documentation.
146 ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
147 AC_PATH_PROG([TEXI2DVI], [texi2dvi], [$ac_aux_dir_abs/missing texi2dvi])
148 AC_PATH_PROG([DVIPS], [dvips], [$ac_aux_dir_abs/missing dvips])
149 AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
150
151 AC_CONFIG_FILES([Makefile])
152 AC_CONFIG_FILES([doc/Makefile])
153 AC_CONFIG_FILES([gnulib-local/Makefile])
154 AC_CONFIG_FILES([lib/Makefile])
155 AC_CONFIG_FILES([lib/exported.sh])
156 AC_CONFIG_FILES([lib/unistring/version.h:lib/unistring/version.in.h])
157 AC_CONFIG_FILES([lib/unistring/woe32dll.h:lib/unistring/woe32dll.in.h])
158 AC_CONFIG_FILES([tests/Makefile])
159 AC_OUTPUT