1 dnl Configuration for the toplevel directory of GNU libunistring
2 dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
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.
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.
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/>.
17 dnl Process this file with autoconf to produce a configure script.
21 AC_CONFIG_SRCDIR([lib/unistring/version.in.h])
22 AC_CONFIG_AUX_DIR([build-aux])
24 gl_INIT_PACKAGE([libunistring], [$VERSION_NUMBER])
25 AM_INIT_AUTOMAKE([silent-rules])
26 AM_CONFIG_HEADER([config.h])
28 dnl Override automake's tar command used for creating distributions.
29 am__tar='${AMTAR} chof - --owner=root --group=root "$$tardir"'
31 dnl Checks for basic programs.
38 dnl Check for host type.
42 dnl Checks that augment the CPPFLAGS.
46 dnl Checks for compiler output filename suffixes.
51 dnl Check for build configuration.
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])
61 dnl On mingw and Cygwin, we can activate special Makefile rules which add
62 dnl version information to the shared libraries and executables.
64 mingw* | cygwin*) is_woe32=yes ;;
67 AM_CONDITIONAL([WOE32], [test $is_woe32 = yes])
69 dnl Checks for types, header files, functions and declarations.
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
82 mingw* | cygwin*) is_woe32dll=yes ;;
88 AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
89 if test $is_woe32dll = yes; then
90 DLL_VARIABLE='__declspec (dllimport)'
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.])
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
115 AC_SUBST([NAMESPACING])
117 dnl Check for prerequisites of exported.sh.
118 gt_GLOBAL_SYMBOL_PIPE
120 dnl Substitutable version number.
123 sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
128 sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
134 version_major=`echo "${VERSION}" | sed -n -e "$sed_extract_major"`
135 version_minor=`echo "${VERSION}" | sed -n -e "$sed_extract_minor"`
136 HEXVERSION=0x`$AWK 'BEGIN { printf("%02d%02d"',"$version_major","$version_minor"') }'`
137 AC_SUBST([HEXVERSION])
139 dnl Check for tools needed for formatting the documentation.
140 ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
141 AC_PATH_PROG([TEXI2DVI], [texi2dvi], [$ac_aux_dir_abs/missing texi2dvi])
142 AC_PATH_PROG([DVIPS], [dvips], [$ac_aux_dir_abs/missing dvips])
143 AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
145 AC_CONFIG_FILES([Makefile])
146 AC_CONFIG_FILES([doc/Makefile])
147 AC_CONFIG_FILES([gnulib-local/Makefile])
148 AC_CONFIG_FILES([lib/Makefile])
149 AC_CONFIG_FILES([lib/exported.sh])
150 AC_CONFIG_FILES([lib/unistring/version.h:lib/unistring/version.in.h])
151 AC_CONFIG_FILES([lib/unistring/woe32dll.h:lib/unistring/woe32dll.in.h])
152 AC_CONFIG_FILES([tests/Makefile])