1 dnl Configuration for the gettext-runtime directory of GNU gettext
2 dnl Copyright (C) 1995-2010, 2015 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.
20 AC_INIT([gettext-runtime],
21 m4_esyscmd([../build-aux/git-version-gen ../.tarball-version]),
22 [bug-gnu-gettext@gnu.org])
23 AC_CONFIG_SRCDIR([intl/dcigettext.c])
24 AC_CONFIG_AUX_DIR([../build-aux])
25 AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests])
26 AC_CONFIG_HEADERS([config.h])
28 dnl Installation directories.
29 test "$docdir" != '${datarootdir}/doc/${PACKAGE_TARNAME}' || docdir='${datarootdir}/doc/gettext'
31 dnl Checks for programs.
38 gt_JAVACOMP([1.3], [1.1])
39 AC_CHECK_PROG([JAR], [jar], [jar])
40 if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
48 if test -n "$HAVE_CSHARPCOMP" && test "$CSHARP_CHOICE" != no; then
53 AC_SUBST([BUILDCSHARP])
55 dnl Check for host type.
58 dnl Checks for compiler output filename suffixes.
62 dnl Make sure we see all GNU and Solaris extensions.
66 dnl Check for build configuration.
72 dnl Prepares the libtool configuration for handling of Windows resources, and
73 dnl sets the RC variable to a program that compiles Windows resource files.
74 LT_LANG([Windows Resource])
76 dnl On mingw and Cygwin, we can activate special Makefile rules which add
77 dnl version information to the shared libraries and executables.
79 mingw* | cygwin*) is_woe32=yes ;;
82 AM_CONDITIONAL([WOE32], [test $is_woe32 = yes])
84 dnl Checks for libraries.
86 dnl These are the only lines required to internationalize the package.
87 dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.)
88 AM_GNU_GETTEXT([use-libtool], [need-ngettext])
90 dnl Checks for header files, functions and declarations.
93 AC_CHECK_FUNCS([setlocale])
95 dnl Put some default definitions into config.h.
97 /* On Windows, variables that may be in a DLL must be marked specially. */
98 #if (defined _MSC_VER && defined _DLL) && !defined IN_RELOCWRAPPER
99 # define DLL_VARIABLE __declspec (dllimport)
101 # define DLL_VARIABLE
104 /* Extra OS/2 (emx+gcc) defines. */
105 #if defined __EMX__ && !defined __KLIBC__
106 # include "intl/os2compat.h"
110 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
111 dnl 1. when we install a shared library, we must arrange to export
112 dnl auxiliary pointer variables for every exported variable,
113 dnl 2. when we install a shared library and a static library simultaneously,
114 dnl the include file specifies __declspec(dllimport) and therefore we
115 dnl must arrange to define the auxiliary pointer variables for the
116 dnl exported variables _also_ in the static library.
117 if test "$enable_shared" = yes; then
119 mingw* | cygwin*) is_woe32dll=yes ;;
125 AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
126 if test $is_woe32dll = yes; then
127 AC_DEFINE([WOE32DLL], [1],
128 [Define when --enable-shared is used on mingw or Cygwin.])
132 dnl 64-bit mingw does not prepend an underscore to C symbols.
133 dnl USER_LABEL_PREFIX is set by gl_ASM_SYMBOL_PREFIX, inside gl_INIT.
134 if test "$USER_LABEL_PREFIX" = _; then
135 INTL_EXPORTS_FLAGS="-DUSER_LABEL_PREFIX_UNDERSCORE $INTL_EXPORTS_FLAGS"
137 AC_SUBST([INTL_EXPORTS_FLAGS])
139 dnl Check for tools needed for formatting the documentation.
140 ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
141 AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
143 dnl Check for tools needed for formatting man pages.
144 CROSS_COMPILING=$cross_compiling
145 AC_SUBST([CROSS_COMPILING])
147 dnl Checks for optional programs for the tests/lang-* tests.
148 gl_PROG_ANSI_CXX([CXX], [ANSICXX])
150 dnl Checks for special libraries for the tests/test-lock test.
151 dnl On some systems, sched_yield is in librt, rather than in libpthread.
153 if test $gl_threads_api = posix; then
154 dnl Solaris has sched_yield in librt, not in libpthread or libc.
155 AC_CHECK_LIB([rt], [sched_yield], [LIBSCHED=-lrt],
156 [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
157 AC_CHECK_LIB([posix4], [sched_yield], [LIBSCHED=-lposix4])])
161 dnl Determine whether to build libasprintf.
162 AC_ARG_ENABLE([libasprintf],
163 [ --disable-libasprintf do not build libasprintf],
164 [if test "$enableval" != no; then
165 SUBDIR_libasprintf=libasprintf
169 ], [SUBDIR_libasprintf=libasprintf])
170 if test "$CXX" = "no"; then
173 AM_CONDITIONAL([ENABLE_LIBASPRINTF], [test -n "$SUBDIR_libasprintf"])
175 AC_CONFIG_SUBDIRS([libasprintf])
177 AC_CONFIG_FILES([Makefile])
179 AC_CONFIG_FILES([doc/Makefile])
181 AC_CONFIG_FILES([intl/Makefile])
183 AC_CONFIG_FILES([intl-java/Makefile])
185 AC_CONFIG_FILES([intl-csharp/Makefile])
187 AC_CONFIG_FILES([gnulib-lib/Makefile])
189 AC_CONFIG_FILES([src/Makefile])
190 AC_CONFIG_FILES([src/gettext.sh], [chmod a+x src/gettext.sh])
192 AC_CONFIG_FILES([po/Makefile.in])
194 AC_CONFIG_FILES([man/Makefile],
195 [FIX_MAKEFILE_DISTRIB])
196 AC_CONFIG_FILES([man/x-to-1])
198 AC_CONFIG_FILES([m4/Makefile])
200 AC_CONFIG_FILES([tests/Makefile])