From: Bruno Haible Date: Sun, 20 Jun 2021 01:42:49 +0000 (+0200) Subject: build: Add a separate configure.ac in gettext-runtime/intl/. X-Git-Tag: v0.22~247 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd7dd75cc086c5f438265a1fecbe4107c4fd64d;p=thirdparty%2Fgettext.git build: Add a separate configure.ac in gettext-runtime/intl/. * autogen.sh (GNULIB_MODULES_RUNTIME_OTHER): Remove bison. Instead, copy bison.m4 explicitly. Generate configure file also in gettext-runtime/intl/. Do automake invocations top-down, not bottom-up. * gettext-runtime/intl/Makefile.am (ACLOCAL_AMFLAGS, SUBDIRS): New variables. * gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Allow 'here' as INTLSYMBOL argument. * gettext-runtime/intl/configure.ac: New file, based on gettext-runtime/configure.ac. * gettext-runtime/intl/AUTHORS: New file. * gettext-runtime/intl/NEWS: New file. * gettext-runtime/intl/README: New file. * gettext-runtime/intl/ABOUT-NLS: New file, copied from gettext-runtime/ABOUT-NLS. * gettext-runtime/intl/INSTALL: New file, copied from gettext-runtime/INSTALL. * gettext-runtime/configure.ac: Define WINDRES. Pass third argument to AM_GNU_GETTEXT. Remove conditionals USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL, PRELOADABLE_LIBINTL. Invoke AC_CONFIG_SUBDIRS([intl]). Don't create intl/Makefile from here. * gettext-tools/configure.ac: Define WINDRES. Redefine __libc_lock_*, for use in localealias.c. Invoke gt_GLIBC2. --- diff --git a/.gitignore b/.gitignore index 0ad280878..98e686f51 100644 --- a/.gitignore +++ b/.gitignore @@ -343,6 +343,9 @@ /gettext-runtime/config.h.in /gettext-runtime/Makefile.in /gettext-runtime/doc/Makefile.in +/gettext-runtime/intl/aclocal.m4 +/gettext-runtime/intl/configure +/gettext-runtime/intl/config.h.in /gettext-runtime/intl/Makefile.in /gettext-runtime/intl-csharp/Makefile.in /gettext-runtime/intl-java/Makefile.in @@ -508,6 +511,8 @@ autom4te.cache/ /config.status /gettext-runtime/config.log /gettext-runtime/config.status +/gettext-runtime/intl/config.log +/gettext-runtime/intl/config.status /gettext-runtime/libasprintf/config.log /gettext-runtime/libasprintf/config.status /gettext-tools/config.log @@ -524,6 +529,9 @@ autom4te.cache/ /gettext-runtime/stamp-h1 /gettext-runtime/doc/Makefile /gettext-runtime/intl/Makefile +/gettext-runtime/intl/config.h +/gettext-runtime/intl/libtool +/gettext-runtime/intl/stamp-h1 /gettext-runtime/intl-csharp/Makefile /gettext-runtime/intl-java/Makefile /gettext-runtime/libasprintf/Makefile diff --git a/autogen.sh b/autogen.sh index 48771c44a..a4efe1901 100755 --- a/autogen.sh +++ b/autogen.sh @@ -96,13 +96,14 @@ if ! $skip_gnulib; then GNULIB_MODULES_RUNTIME_OTHER=' gettext-runtime-misc ansi-c++-opt - bison csharpcomp-script java javacomp-script ' $GNULIB_TOOL --dir=gettext-runtime --lib=libgrt --source-base=gnulib-lib --m4-base=gnulib-m4 --no-libtool --local-dir=gnulib-local --local-symlink \ --import $GNULIB_MODULES_RUNTIME_FOR_SRC $GNULIB_MODULES_RUNTIME_OTHER || exit $? + # In gettext-runtime/intl: + $GNULIB_TOOL --copy-file m4/bison.m4 gettext-runtime/gnulib-m4/bison.m4 || exit $? # In gettext-runtime/libasprintf: GNULIB_MODULES_LIBASPRINTF=' alloca @@ -410,15 +411,32 @@ fi (cd build-aux && rm -f ar-lib compile depcomp install-sh mdate-sh missing test-driver ylwrap) # Generate configure script in each subdirectories. +# The aclocal and autoconf invocations need to be done bottom-up +# (subdirs first), so that 'configure --help' shows also the options +# that matter for the subdirs. +# The automake invocations need to be done top-down (subdirs last), however, +# because otherwise the invocation of automake in gettext-runtime/ overwrites +# gettext-runtime/intl/Makefile.in with one that lists the wrong *.m4 files +# and thus produces an endless recursion when invoked through 'make'. Seen +# with automake 1.16.3. dir0=`pwd` +echo "$0: generating configure in gettext-runtime/intl..." +cd gettext-runtime/intl +aclocal -I ../../m4 -I ../m4 -I ../gnulib-m4 \ + && autoconf \ + && autoheader && touch config.h.in \ + && touch ChangeLog \ + && rm -rf autom4te.cache \ + || exit $? +cd "$dir0" + echo "$0: generating configure in gettext-runtime/libasprintf..." cd gettext-runtime/libasprintf aclocal -I ../../m4 -I ../m4 -I gnulib-m4 \ && autoconf \ && autoheader && touch config.h.in \ && touch ChangeLog \ - && automake --add-missing --copy \ && rm -rf autom4te.cache \ || exit $? cd "$dir0" @@ -428,8 +446,7 @@ cd gettext-runtime aclocal -I m4 -I ../m4 -I gnulib-m4 \ && autoconf \ && autoheader && touch config.h.in \ - && touch ChangeLog intl/ChangeLog \ - && automake --add-missing --copy \ + && touch ChangeLog \ && rm -rf autom4te.cache \ || exit $? cd "$dir0" @@ -446,7 +463,6 @@ cd gettext-tools/examples aclocal -I ../../gettext-runtime/m4 -I ../../m4 \ && autoconf \ && touch ChangeLog \ - && automake --add-missing --copy \ && rm -rf autom4te.cache \ || exit $? cd "$dir0" @@ -481,16 +497,57 @@ aclocal -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m && autoconf \ && autoheader && touch config.h.in \ && touch ChangeLog \ - && automake --add-missing --copy \ && rm -rf autom4te.cache \ || exit $? cd "$dir0" +echo "$0: generating configure at the top-level..." aclocal -I m4 \ && autoconf \ && touch ChangeLog \ && automake --add-missing --copy \ - && rm -rf autom4te.cache gettext-runtime/autom4te.cache gettext-tools/autom4te.cache \ + && rm -rf autom4te.cache \ + gettext-runtime/autom4te.cache \ + gettext-runtime/intl/autom4te.cache \ + gettext-runtime/libasprintf/autom4te.cache \ + libtextstyle/autom4te.cache \ + gettext-tools/autom4te.cache \ + gettext-tools/examples/autom4te.cache \ + || exit $? + +echo "$0: generating Makefile.in in gettext-tools..." +cd gettext-tools +automake --add-missing --copy \ + && rm -rf autom4te.cache \ + || exit $? +cd "$dir0" + +echo "$0: generating Makefile.in in gettext-tools/examples..." +cd gettext-tools/examples +automake --add-missing --copy \ + && rm -rf autom4te.cache \ + || exit $? +cd "$dir0" + +echo "$0: generating Makefile.in in gettext-runtime..." +cd gettext-runtime +automake --add-missing --copy \ + && rm -rf autom4te.cache \ || exit $? +cd "$dir0" + +echo "$0: generating Makefile.in in gettext-runtime/libasprintf..." +cd gettext-runtime/libasprintf +automake --add-missing --copy \ + && rm -rf autom4te.cache \ + || exit $? +cd "$dir0" + +echo "$0: generating Makefile.in in gettext-runtime/intl..." +cd gettext-runtime/intl +automake --add-missing --copy \ + && rm -rf autom4te.cache \ + || exit $? +cd "$dir0" echo "$0: done. Now you can run './configure'." diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index c53147187..2b946c9f7 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -85,6 +85,10 @@ case "$host_os" in *) is_woe32=no ;; esac AM_CONDITIONAL([WOE32], [test $is_woe32 = yes]) +if test $is_woe32 = yes; then + dnl Check for a program that compiles Windows resource files. + AC_CHECK_TOOL([WINDRES], [windres]) +fi dnl Some code is only meant to be compiled on native Windows. case "$host_os" in @@ -97,12 +101,7 @@ dnl Checks for libraries. dnl These are the only lines required to internationalize the package. dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.) -AM_GNU_GETTEXT([use-libtool], [need-ngettext]) -dnl Conditionals for the intl/ directory. -AM_CONDITIONAL([USE_INCLUDED_LIBINTL], [test $USE_INCLUDED_LIBINTL = yes]) -AM_CONDITIONAL([BUILD_INCLUDED_LIBINTL], [test $BUILD_INCLUDED_LIBINTL = yes]) -AM_CONDITIONAL([PRELOADABLE_LIBINTL], - [test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes && test "$enable_shared" = yes]) +AM_GNU_GETTEXT([use-libtool], [need-ngettext], [\${top_builddir}/intl]) dnl Checks for header files, functions and declarations. gl_INIT @@ -181,14 +180,14 @@ if test "$CXX" = "no"; then fi AM_CONDITIONAL([ENABLE_LIBASPRINTF], [test -n "$SUBDIR_libasprintf"]) +AC_CONFIG_SUBDIRS([intl]) + AC_CONFIG_SUBDIRS([libasprintf]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([doc/Makefile]) -AC_CONFIG_FILES([intl/Makefile]) - AC_CONFIG_FILES([intl-java/Makefile]) AC_CONFIG_FILES([intl-csharp/Makefile]) diff --git a/gettext-runtime/intl/ABOUT-NLS b/gettext-runtime/intl/ABOUT-NLS new file mode 100644 index 000000000..0a9d56d9e --- /dev/null +++ b/gettext-runtime/intl/ABOUT-NLS @@ -0,0 +1 @@ + diff --git a/gettext-runtime/intl/AUTHORS b/gettext-runtime/intl/AUTHORS new file mode 100644 index 000000000..0d2386c11 --- /dev/null +++ b/gettext-runtime/intl/AUTHORS @@ -0,0 +1,2 @@ +Ulrich Drepper wrote this code initially. +Bruno Haible added the support for macOS and Windows. diff --git a/gettext-runtime/intl/INSTALL b/gettext-runtime/intl/INSTALL new file mode 100644 index 000000000..671b157a6 --- /dev/null +++ b/gettext-runtime/intl/INSTALL @@ -0,0 +1,307 @@ +These are generic installation instructions. + +Prerequisites +============= + + This package depends on a few other packages. They are listed in +the file ‘DEPENDENCIES’. It is recommended to install the listed +packages before installing this package. + +Basic Installation +================== + + The ‘configure’ shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a ‘Makefile’ in each directory of the package. +It may also create one or more ‘.h’ files containing system-dependent +definitions. Finally, it creates a shell script ‘config.status’ that +you can run in the future to recreate the current configuration, a file +‘config.cache’ that saves the results of its tests to speed up +reconfiguring, and a file ‘config.log’ containing compiler output +(useful mainly for debugging ‘configure’). + + If you need to do unusual things to compile the package, please try +to figure out how ‘configure’ could check whether to do them, and mail +diffs or instructions to the address given in the ‘README’ so they can +be considered for the next release. If at some point ‘config.cache’ +contains results you don't want to keep, you may remove or edit it. + + The file ‘configure.ac’ is used to create ‘configure’ by a program +called ‘autoconf’. You only need ‘configure.ac’ if you want to change +it or regenerate ‘configure’ using a newer version of ‘autoconf’. + +The simplest way to compile this package is: + + 1. ‘cd’ to the directory containing the package's source code and type + ‘./configure’ to configure the package for your system. If you're + using ‘csh’ on an old version of System V, you might need to type + ‘sh ./configure’ instead to prevent ‘csh’ from trying to execute + ‘configure’ itself. + + Running ‘configure’ takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type ‘make’ to compile the package. + + 3. Optionally, type ‘make check’ to run any self-tests that come with + the package. + + 4. Type ‘make install’ to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing ‘make clean’. To also remove the + files that ‘configure’ created (so you can compile the package for + a different kind of computer), type ‘make distclean’. There is + also a ‘make maintainer-clean’ target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the ‘configure’ script does not know about. You can give ‘configure’ +initial values for variables as arguments. You can do it like this: + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of ‘make’ that +supports the ‘VPATH’ variable, such as GNU ‘make’. ‘cd’ to the +directory where you want the object files and executables to go and run +the ‘configure’ script. ‘configure’ automatically checks for the +source code in the directory that ‘configure’ is in and in ‘..’. + + If you have to use a ‘make’ that does not supports the ‘VPATH’ +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use ‘make distclean’ before reconfiguring for another +architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases. You +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, ‘make install’ will install the package's files in +‘/usr/local/bin’, ‘/usr/local/man’, etc. You can specify an +installation prefix other than ‘/usr/local’ by giving ‘configure’ the +option ‘--prefix=PATH’. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give ‘configure’ the option ‘--exec-prefix=PATH’, the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like ‘--bindir=PATH’ to specify different values for particular +kinds of files. Run ‘configure --help’ for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving ‘configure’ the +option ‘--program-prefix=PREFIX’ or ‘--program-suffix=SUFFIX’. + +Enabling Relocatability +======================= + + It has been a pain for many users of GNU packages for a long time +that packages are not relocatable. It means a user cannot copy a +program, installed by another user on the same machine, to his home +directory, and have it work correctly (including i18n). So many users +need to go through ‘configure; make; make install’ with all its +dependencies, options, and hurdles. + + Red Hat, Debian, and similar package systems solve the "ease of +installation" problem, but they hardwire path names, usually to ‘/usr’ +or ‘/usr/local’. This means that users need root privileges to install +a binary package, and prevents installing two different versions of the +same binary package. + + A relocatable program can be moved or copied to a different location +on the filesystem. It is possible to make symlinks to the installed +and moved programs, and invoke them through the symlink. It is possible +to do the same thing with a hard link _only_ if the hard link file is +in the same directory as the real program. + + To configure a program to be relocatable, add ‘--enable-relocatable’ +to the ‘configure’ command line. + + On some OSes the executables remember the location of shared +libraries and prefer them over any other search path. Therefore, such +an executable will look for its shared libraries first in the original +installation directory and only then in the current installation +directory. Thus, for reliability, it is best to also give a ‘--prefix’ +option pointing to a directory that does not exist now and which never +will be created, e.g. ‘--prefix=/nonexistent’. You may use +‘DESTDIR=DEST-DIR’ on the ‘make’ command line to avoid installing into +that directory. + + We do not recommend using a prefix writable by unprivileged users +(e.g. ‘/tmp/inst$$’) because such a directory can be recreated by an +unprivileged user after the original directory has been removed. We +also do not recommend prefixes that might be behind an automounter +(e.g. ‘$HOME/inst$$’) because of the performance impact of directory +searching. + + Here's a sample installation run that takes into account all these +recommendations: + + ./configure --enable-relocatable --prefix=/nonexistent + make + make install DESTDIR=/tmp/inst$$ + + Installation with ‘--enable-relocatable’ will not work for setuid or +setgid executables, because such executables search only system library +paths for security reasons. Also, installation with +‘--enable-relocatable’ might not work on OpenBSD, when the package +contains shared libraries and libtool versions 1.5.xx are used. + + The runtime penalty and size penalty are negligible on GNU/Linux +(just one system call more when an executable is launched), and small on +other systems (the wrapper program just sets an environment variable +and executes the real program). + +Optional Features +================= + + Some packages pay attention to ‘--enable-FEATURE’ options to +‘configure’, where FEATURE indicates an optional part of the package. +They may also pay attention to ‘--with-PACKAGE’ options, where PACKAGE +is something like ‘gnu-as’ or ‘x’ (for the X Window System). The +‘README’ should mention any ‘--enable-’ and ‘--with-’ options that the +package recognizes. + + For packages that use the X Window System, ‘configure’ can usually +find the X include and library files automatically, but if it doesn't, +you can use the ‘configure’ options ‘--x-includes=DIR’ and +‘--x-libraries=DIR’ to specify their locations. + + For packages that use the GNU libiconv library, you can use the +‘configure’ option ‘--with-libiconv-prefix’ to specify the prefix you +used while installing GNU libiconv. This option is not necessary if +that other prefix is the same as the one now specified through --prefix. + + For packages that use the GNU libintl library, you can use the +‘configure’ option ‘--with-libintl-prefix’ to specify the prefix you +used while installing GNU gettext-runtime. This option is not necessary if +that other prefix is the same as the one now specified through --prefix. + +Particular Systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in order +to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its ‘’ header file. The option ‘-nodtk’ can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On AIX 3, the C include files by default don't define some necessary +prototype declarations. If GNU CC is not installed, it is recommended to +use the following options: + + ./configure CC="xlc -D_ALL_SOURCE" + + On Haiku, software installed for all users goes in /boot/common, not +/usr/local. It is recommended to use the following options: + + ./configure --prefix=/boot/common + + On BeOS, user installed software goes in /boot/home/config, not +/usr/local. It is recommended to use the following options: + + ./configure --prefix=/boot/home/config + +Specifying the System Type +========================== + + There may be some features ‘configure’ can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually ‘configure’ can figure that out, but if it prints +a message saying it can not guess the host type, give it the +‘--host=TYPE’ option. TYPE can either be a short name for the system +type, such as ‘sun4’, or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file ‘config.sub’ for the possible values of each field. If +‘config.sub’ isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the ‘--target=TYPE’ option to select the type of system they will +produce code for and the ‘--build=TYPE’ option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for ‘configure’ scripts to share, +you can create a site shell script called ‘config.site’ that gives +default values for variables like ‘CC’, ‘cache_file’, and ‘prefix’. +‘configure’ looks for ‘PREFIX/share/config.site’ if it exists, then +‘PREFIX/etc/config.site’ if it exists. Or, you can set the +‘CONFIG_SITE’ environment variable to the location of the site script. +A warning: not all ‘configure’ scripts look for a site script. + +Operation Controls +================== + + ‘configure’ recognizes the following options to control how it +operates. + +‘--cache-file=FILE’ + Use and save the results of the tests in FILE instead of + ‘./config.cache’. Set FILE to ‘/dev/null’ to disable caching, for + debugging ‘configure’. + +‘--help’ + Print a summary of the options to ‘configure’, and exit. + +‘--quiet’ +‘--silent’ +‘-q’ + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to ‘/dev/null’ (any error + messages will still be shown). + +‘--srcdir=DIR’ + Look for the package's source code in directory DIR. Usually + ‘configure’ can determine that directory automatically. + +‘--version’ + Print the version of Autoconf used to generate the ‘configure’ + script, and exit. + +‘configure’ also accepts some other, not widely useful, options. + diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am index ea78e76d8..55de129a1 100644 --- a/gettext-runtime/intl/Makefile.am +++ b/gettext-runtime/intl/Makefile.am @@ -18,6 +18,10 @@ ## Process this file with automake to produce Makefile.in. AUTOMAKE_OPTIONS = 1.10 gnu no-dependencies +ACLOCAL_AMFLAGS = -I ../../m4 -I ../m4 -I ../gnulib-m4 + +SUBDIRS = . + EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = core *.stackdump diff --git a/gettext-runtime/intl/NEWS b/gettext-runtime/intl/NEWS new file mode 100644 index 000000000..d78ce2ff8 --- /dev/null +++ b/gettext-runtime/intl/NEWS @@ -0,0 +1 @@ +Please refer to the NEWS file in the parent directory. diff --git a/gettext-runtime/intl/README b/gettext-runtime/intl/README new file mode 100644 index 000000000..b5a2d828f --- /dev/null +++ b/gettext-runtime/intl/README @@ -0,0 +1,2 @@ +This directory contains the sources of the GNU libintl library. It is a +portable and extended variant of the intl/ part of GNU libc. diff --git a/gettext-runtime/intl/configure.ac b/gettext-runtime/intl/configure.ac new file mode 100644 index 000000000..1ce146d61 --- /dev/null +++ b/gettext-runtime/intl/configure.ac @@ -0,0 +1,128 @@ +dnl Configuration for the gettext-runtime directory of GNU gettext +dnl Copyright (C) 1995-2010, 2012-2015, 2018-2021 Free Software Foundation, Inc. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . + +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.64]) +AC_INIT([libintl], + m4_esyscmd([../../build-aux/git-version-gen ../../.tarball-version]), + [bug-gettext@gnu.org]) +AC_CONFIG_SRCDIR([dcigettext.c]) +AC_CONFIG_AUX_DIR([../../build-aux]) +AM_INIT_AUTOMAKE([silent-rules]) +AC_CONFIG_HEADERS([config.h]) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL + +dnl Check for host type. +AC_CANONICAL_HOST + +dnl Checks for compiler output filename suffixes. +AC_OBJEXT +AC_EXEEXT + +dnl For a 64-bit build on AIX, AC_PROG_RANLIB is not sufficient. +gl_PROG_AR_RANLIB + +dnl Set preferences for the gnulib module 'threadlib'. +gl_AVOID_WINPTHREAD + +dnl Make sure we see all GNU and Solaris extensions. +gl_USE_SYSTEM_EXTENSIONS +AM_PROG_CC_C_O + +dnl Check for build configuration. + +gl_WOE32_DLL + +LT_INIT([win32-dll]) + +dnl Prepares the libtool configuration for handling of Windows resources, and +dnl sets the RC variable to a program that compiles Windows resource files. +LT_LANG([Windows Resource]) + +dnl On mingw and Cygwin, we can activate special Makefile rules which add +dnl version information to the shared libraries and executables. +case "$host_os" in + mingw* | cygwin*) is_woe32=yes ;; + *) is_woe32=no ;; +esac +AM_CONDITIONAL([WOE32], [test $is_woe32 = yes]) + +dnl Some code is only meant to be compiled on native Windows. +case "$host_os" in + mingw*) is_windows_native=yes ;; + *) is_windows_native=no ;; +esac +AM_CONDITIONAL([WINDOWS_NATIVE], [test $is_windows_native = yes]) + +dnl Checks for libraries. + +dnl These are the only lines required to internationalize the package. +dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.) +AM_GNU_GETTEXT([here], [need-ngettext]) +dnl Conditionals for the intl/ directory. +AM_CONDITIONAL([USE_INCLUDED_LIBINTL], [test $USE_INCLUDED_LIBINTL = yes]) +AM_CONDITIONAL([BUILD_INCLUDED_LIBINTL], [test $BUILD_INCLUDED_LIBINTL = yes]) +AM_CONDITIONAL([PRELOADABLE_LIBINTL], + [test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes && test "$enable_shared" = yes]) + +dnl Get common Gnulib macros. +gl_COMMON +dnl Get definitions for relocatable.c. +gl_RELOCATABLE_LIBRARY + +dnl Compilation on mingw and Cygwin needs special Makefile rules, because +dnl 1. when we install a shared library, we must arrange to export +dnl auxiliary pointer variables for every exported variable, +dnl 2. when we install a shared library and a static library simultaneously, +dnl the include file specifies __declspec(dllimport) and therefore we +dnl must arrange to define the auxiliary pointer variables for the +dnl exported variables _also_ in the static library. +if test "$enable_shared" = yes; then + case "$host_os" in + mingw* | cygwin*) is_woe32dll=yes ;; + *) is_woe32dll=no ;; + esac +else + is_woe32dll=no +fi +AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes]) +if test $is_woe32dll = yes; then + AC_DEFINE([WOE32DLL], [1], + [Define when --enable-shared is used on mingw or Cygwin.]) +fi + +dnl Put some default definitions into config.h. +AH_BOTTOM([ +/* On Windows, variables that may be in a DLL must be marked specially. */ +#if (defined _MSC_VER && defined _DLL) && !defined IN_RELOCWRAPPER +# define DLL_VARIABLE __declspec (dllimport) +#else +# define DLL_VARIABLE +#endif + +/* Extra OS/2 (emx+gcc) defines. */ +#if defined __EMX__ && !defined __KLIBC__ +# include "os2compat.h" +#endif +]) + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT diff --git a/gettext-runtime/m4/gettext.m4 b/gettext-runtime/m4/gettext.m4 index f4492405b..f1ebd543f 100644 --- a/gettext-runtime/m4/gettext.m4 +++ b/gettext-runtime/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 72 (gettext-0.21.1) -dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc. +# gettext.m4 serial 73 (gettext-0.21.1) +dnl Copyright (C) 1995-2014, 2016, 2018-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -20,11 +20,13 @@ dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). -dnl INTLSYMBOL must be one of 'external', 'use-libtool'. -dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and -dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'. -dnl If INTLSYMBOL is 'use-libtool', then a libtool library -dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl INTLSYMBOL must be one of 'external', 'use-libtool', 'here'. +dnl INTLSYMBOL should be 'external' for packages other than GNU gettext. +dnl It should be 'use-libtool' for the packages 'gettext-runtime' and +dnl 'gettext-tools'. +dnl It should be 'here' for the package 'gettext-runtime/intl'. +dnl If INTLSYMBOL is 'here', then a libtool library +dnl $(top_builddir)/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext @@ -55,22 +57,24 @@ dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. - m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , + m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , [m4_if([$1], [here], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT -])])])]) +])])])])]) m4_if(m4_if([$1], [], [old])[]m4_if([$1], [no-libtool], [old]), [old], [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported. ])]) m4_if([$2], [], , [m4_if([$2], [need-ngettext], , [m4_if([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) - define([gt_included_intl], - m4_if([$1], [external], [no], [yes])) + define([gt_building_libintl_here], + m4_if([$1], [here], [yes], [no])) + define([gt_building_libintl_in_same_build_tree], + m4_if([$1], [use-libtool], [yes], [m4_if([$1], [here], [yes], [no])])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl - m4_if(gt_included_intl, yes, [ + m4_if(gt_building_libintl_here, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) @@ -82,13 +86,13 @@ AC_DEFUN([AM_GNU_GETTEXT], dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then - dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it. - m4_if(gt_included_intl, yes, , [ + m4_if(gt_building_libintl_in_same_build_tree, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) @@ -98,7 +102,7 @@ AC_DEFUN([AM_GNU_GETTEXT], dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) - m4_if(gt_included_intl, yes, [ + m4_if(gt_building_libintl_in_same_build_tree, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) @@ -118,7 +122,7 @@ AC_DEFUN([AM_GNU_GETTEXT], dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no - m4_if(gt_included_intl, yes, [ + m4_if(gt_building_libintl_in_same_build_tree, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], @@ -174,7 +178,7 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. - m4_if(gt_included_intl, yes, , [ + m4_if(gt_building_libintl_in_same_build_tree, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL @@ -252,7 +256,8 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then + && test "$PACKAGE" != gettext-tools \ + && test "$PACKAGE" != libintl; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. @@ -261,7 +266,7 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION INCINTL= fi - m4_if(gt_included_intl, yes, [ + m4_if(gt_building_libintl_in_same_build_tree, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. @@ -341,7 +346,7 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION POSUB=po fi - m4_if(gt_included_intl, yes, [ + m4_if(gt_building_libintl_in_same_build_tree, yes, [ dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes' dnl because some of the testsuite requires it. BUILD_INCLUDED_LIBINTL=yes @@ -352,9 +357,11 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION AC_SUBST([CATOBJEXT]) ]) - dnl For backward compatibility. Some Makefiles may be using this. - INTLLIBS="$LIBINTL" - AC_SUBST([INTLLIBS]) + m4_if(gt_building_libintl_in_same_build_tree, yes, [], [ + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST([INTLLIBS]) + ]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 7c9011906..15ca68bac 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -97,11 +97,20 @@ LT_LANG([Windows Resource]) dnl On mingw and Cygwin, we can activate special Makefile rules which add dnl version information to the shared libraries and executables. case "$host_os" in - mingw* | cygwin*) special_makefile_rules=woe32 ;; + mingw* | cygwin*) is_woe32=yes ;; + *) is_woe32=no ;; +esac +AM_CONDITIONAL([WOE32], [test $is_woe32 = yes]) +if test $is_woe32 = yes; then + dnl Check for a program that compiles Windows resource files. + AC_CHECK_TOOL([WINDRES], [windres]) +fi + +dnl Some other special Makefile rules exist for OS/2. +case "$host_os" in os2*) special_makefile_rules=os2 ;; *) special_makefile_rules=none ;; esac -AM_CONDITIONAL([WOE32], [test $special_makefile_rules = woe32]) AM_CONDITIONAL([OS2], [test $special_makefile_rules = os2]) dnl Some code is only meant to be compiled on native Windows. @@ -332,6 +341,16 @@ AH_BOTTOM([ # include "../gettext-runtime/intl/os2compat.h" #endif ]) +dnl Rename some macros and functions used for locking. +dnl Needed for compiling ../gettext-runtime/intl/localealias.c. +AH_BOTTOM([ +#define __libc_lock_t gl_lock_t +#define __libc_lock_define gl_lock_define +#define __libc_lock_define_initialized gl_lock_define_initialized +#define __libc_lock_init gl_lock_init +#define __libc_lock_lock gl_lock_lock +#define __libc_lock_unlock gl_lock_unlock +]) dnl Check for nm output filter that yields the exported symbols. gt_GLOBAL_SYMBOL_PIPE @@ -499,6 +518,9 @@ dnl Check for tools needed for formatting man pages. CROSS_COMPILING=$cross_compiling AC_SUBST([CROSS_COMPILING]) +dnl Checks for configuration that some tests/ depend on. +gt_GLIBC2 + dnl Checks for optional programs for the tests/lang-*, tests/recode-* tests. gl_PROG_ANSI_CXX([CXX], [ANSICXX]) gt_LOCALE_FR