1dnl Configuration for the gettext-runtime directory of GNU gettext 2dnl Copyright (C) 1995-2010, 2012-2015, 2018-2020 Free Software Foundation, Inc. 3dnl 4dnl This program is free software: you can redistribute it and/or modify 5dnl it under the terms of the GNU General Public License as published by 6dnl the Free Software Foundation; either version 3 of the License, or 7dnl (at your option) any later version. 8dnl 9dnl This program is distributed in the hope that it will be useful, 10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12dnl GNU General Public License for more details. 13dnl 14dnl You should have received a copy of the GNU General Public License 15dnl along with this program. If not, see <https://www.gnu.org/licenses/>. 16 17dnl Process this file with autoconf to produce a configure script. 18 19AC_PREREQ([2.63]) 20AC_INIT([gettext-runtime], 21 m4_esyscmd([../build-aux/git-version-gen ../.tarball-version]), 22 [bug-gettext@gnu.org]) 23AC_CONFIG_SRCDIR([intl/dcigettext.c]) 24AC_CONFIG_AUX_DIR([../build-aux]) 25AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) 26AC_CONFIG_HEADERS([config.h]) 27 28dnl Installation directories. 29test "$docdir" != '${datarootdir}/doc/${PACKAGE_TARNAME}' || docdir='${datarootdir}/doc/gettext' 30 31dnl Checks for programs. 32AC_PROG_CC 33AC_PROG_INSTALL 34 35gt_JAVA_CHOICE 36 37gt_JAVACOMP([1.5], [1.6]) 38AC_CHECK_PROG([JAR], [jar], [jar]) 39if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then 40 BUILDJAVA=yes 41else 42 BUILDJAVA=no 43fi 44AC_SUBST([BUILDJAVA]) 45 46gt_CSHARPCOMP 47if test -n "$HAVE_CSHARPCOMP" && test "$CSHARP_CHOICE" != no; then 48 BUILDCSHARP=yes 49else 50 BUILDCSHARP=no 51fi 52AC_SUBST([BUILDCSHARP]) 53 54dnl Check for host type. 55AC_CANONICAL_HOST 56 57dnl Checks for compiler output filename suffixes. 58AC_OBJEXT 59AC_EXEEXT 60 61dnl For a 64-bit build on AIX, AC_PROG_RANLIB is not sufficient. 62gl_PROG_AR_RANLIB 63 64dnl Set preferences for the gnulib module 'threadlib'. 65gl_AVOID_WINPTHREAD 66 67dnl Make sure we see all GNU and Solaris extensions. 68gl_EARLY 69AM_PROG_CC_C_O 70 71dnl Check for build configuration. 72 73gl_WOE32_DLL 74 75LT_INIT([win32-dll]) 76 77dnl Prepares the libtool configuration for handling of Windows resources, and 78dnl sets the RC variable to a program that compiles Windows resource files. 79LT_LANG([Windows Resource]) 80 81dnl On mingw and Cygwin, we can activate special Makefile rules which add 82dnl version information to the shared libraries and executables. 83case "$host_os" in 84 mingw* | cygwin*) is_woe32=yes ;; 85 *) is_woe32=no ;; 86esac 87AM_CONDITIONAL([WOE32], [test $is_woe32 = yes]) 88 89dnl Some code is only meant to be compiled on native Windows. 90case "$host_os" in 91 mingw*) is_windows_native=yes ;; 92 *) is_windows_native=no ;; 93esac 94AM_CONDITIONAL([WINDOWS_NATIVE], [test $is_windows_native = yes]) 95 96dnl Checks for libraries. 97 98dnl These are the only lines required to internationalize the package. 99dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.) 100AM_GNU_GETTEXT([use-libtool], [need-ngettext]) 101dnl Conditionals for the intl/ directory. 102AM_CONDITIONAL([USE_INCLUDED_LIBINTL], [test $USE_INCLUDED_LIBINTL = yes]) 103AM_CONDITIONAL([BUILD_INCLUDED_LIBINTL], [test $BUILD_INCLUDED_LIBINTL = yes]) 104AM_CONDITIONAL([PACKAGE_IS_GETTEXT_TOOLS], [false]) 105AM_CONDITIONAL([PRELOADABLE_LIBINTL], [false]) 106 107dnl Checks for header files, functions and declarations. 108gl_INIT 109AC_TYPE_SIZE_T 110AC_CHECK_FUNCS([setlocale]) 111 112dnl Compilation on mingw and Cygwin needs special Makefile rules, because 113dnl 1. when we install a shared library, we must arrange to export 114dnl auxiliary pointer variables for every exported variable, 115dnl 2. when we install a shared library and a static library simultaneously, 116dnl the include file specifies __declspec(dllimport) and therefore we 117dnl must arrange to define the auxiliary pointer variables for the 118dnl exported variables _also_ in the static library. 119if test "$enable_shared" = yes; then 120 case "$host_os" in 121 mingw* | cygwin*) is_woe32dll=yes ;; 122 *) is_woe32dll=no ;; 123 esac 124else 125 is_woe32dll=no 126fi 127AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes]) 128if test $is_woe32dll = yes; then 129 AC_DEFINE([WOE32DLL], [1], 130 [Define when --enable-shared is used on mingw or Cygwin.]) 131fi 132 133INTL_EXPORTS_FLAGS= 134dnl 64-bit mingw does not prepend an underscore to C symbols. 135dnl USER_LABEL_PREFIX is set by gl_ASM_SYMBOL_PREFIX, inside gl_INIT. 136if test "$USER_LABEL_PREFIX" = _; then 137 INTL_EXPORTS_FLAGS="-DUSER_LABEL_PREFIX_UNDERSCORE $INTL_EXPORTS_FLAGS" 138fi 139AC_SUBST([INTL_EXPORTS_FLAGS]) 140 141dnl Put some default definitions into config.h. 142AH_BOTTOM([ 143/* On Windows, variables that may be in a DLL must be marked specially. */ 144#if (defined _MSC_VER && defined _DLL) && !defined IN_RELOCWRAPPER 145# define DLL_VARIABLE __declspec (dllimport) 146#else 147# define DLL_VARIABLE 148#endif 149 150/* Extra OS/2 (emx+gcc) defines. */ 151#if defined __EMX__ && !defined __KLIBC__ 152# include "intl/os2compat.h" 153#endif 154]) 155 156dnl Check for tools needed for formatting the documentation. 157ac_aux_dir_abs=`cd $ac_aux_dir && pwd` 158AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl]) 159 160dnl Check for tools needed for formatting man pages. 161CROSS_COMPILING=$cross_compiling 162AC_SUBST([CROSS_COMPILING]) 163 164dnl Checks for optional programs for the tests/lang-* tests. 165gl_PROG_ANSI_CXX([CXX], [ANSICXX]) 166 167dnl Checks for special libraries for the tests/test-lock test. 168dnl On some systems, sched_yield is in librt, rather than in libpthread. 169LIBSCHED= 170if test $gl_threads_api = posix; then 171 dnl Solaris has sched_yield in librt, not in libpthread or libc. 172 AC_CHECK_LIB([rt], [sched_yield], [LIBSCHED=-lrt], 173 [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt. 174 AC_CHECK_LIB([posix4], [sched_yield], [LIBSCHED=-lposix4])]) 175fi 176AC_SUBST([LIBSCHED]) 177 178dnl Determine whether to build libasprintf. 179AC_ARG_ENABLE([libasprintf], 180 [ --disable-libasprintf do not build libasprintf], 181 [if test "$enableval" != no; then 182 SUBDIR_libasprintf=libasprintf 183 else 184 SUBDIR_libasprintf= 185 fi 186 ], [SUBDIR_libasprintf=libasprintf]) 187if test "$CXX" = "no"; then 188 SUBDIR_libasprintf= 189fi 190AM_CONDITIONAL([ENABLE_LIBASPRINTF], [test -n "$SUBDIR_libasprintf"]) 191 192AC_CONFIG_SUBDIRS([libasprintf]) 193 194AC_CONFIG_FILES([Makefile]) 195 196AC_CONFIG_FILES([doc/Makefile]) 197 198AC_CONFIG_FILES([intl/Makefile]) 199 200AC_CONFIG_FILES([intl-java/Makefile]) 201 202AC_CONFIG_FILES([intl-csharp/Makefile]) 203 204AC_CONFIG_FILES([gnulib-lib/Makefile]) 205 206AC_CONFIG_FILES([src/Makefile]) 207AC_CONFIG_FILES([src/gettext.sh], [chmod a+x src/gettext.sh]) 208 209AC_CONFIG_FILES([po/Makefile.in]) 210 211AC_CONFIG_FILES([man/Makefile], 212 [FIX_MAKEFILE_DISTRIB]) 213AC_CONFIG_FILES([man/x-to-1]) 214 215AC_CONFIG_FILES([m4/Makefile]) 216 217AC_CONFIG_FILES([tests/Makefile]) 218 219AC_OUTPUT 220