From: Bruno Haible Date: Fri, 26 Jan 2001 13:55:19 +0000 (+0000) Subject: Use libtool to create a shared libintl.so. X-Git-Tag: v0.10.36~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=485c1aa79d99d9771ff2917a78a40afd0ea45ac4;p=thirdparty%2Fgettext.git Use libtool to create a shared libintl.so. --- diff --git a/Admin/plans b/Admin/plans index 55c43962d..4c874fd8c 100644 --- a/Admin/plans +++ b/Admin/plans @@ -20,8 +20,6 @@ Things we plan to do. Comments welcome. - Stop documenting AM_WITH_NLS. AM_GNU_GETTEXT is the right macro to use. -- Build also libintl.so, using libtool. - - Check the *.m4 macros with bleeding-edge autoconf & automake. - Documentation: Distinguish more clearly between gettext/xgettext, @@ -51,8 +49,13 @@ Things we plan to do. Comments welcome. - Add msvc Makefile. +- Look at Christian Gafton's msghack. + - Look at Ben Bullock's manual: http://www.hayamasa.demon.co.uk/doc/gettext.texi +- Check whether ../lib/libsupport.a @@INTLLIBS@@ @@LIBS@@ is sufficient (see + gettext.texi:5083) on HP-UX 10.01 and other systems lacking alloca. + - Provide a way to merge two .po files, coming from different translators of the same pot file. diff --git a/ChangeLog b/ChangeLog index c0c916d2f..f49de2b5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-01-21 Bruno Haible + + Use libtool. + * configure.in: Add argument 'use-libtool' to AM_GNU_GETTEXT call. + 2001-01-20 Bruno Haible * configure.in: Add a third argument to AC_DEFINE. diff --git a/NEWS b/NEWS index 8738df4b3..49a8b986b 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,12 @@ Version 0.10.36 - XXX 2001, by Ulrich Drepper and Bruno Haible * Support for the old Linux specific .msg catalog format has been dropped. +* When the included GNU libintl is installed (i.e. on GNU platforms, when + the configure option --with-included-gettext is given, or on non-GNU + platforms, when the configure option --disable-nls is not given), it is + also installed as a shared library, unless the configure option + --disable-shared is given. + * PO mode changes: ** PO mode does not use recursive edit anymore, many edits may be worked on diff --git a/configure.in b/configure.in index 8abd7027f..da5ebcedc 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13) -AC_REVISION($Revision: 1.8 $) +AC_REVISION($Revision: 1.9 $) AC_INIT(src/msgfmt.c) AM_INIT_AUTOMAKE(gettext, 0.10.36) AM_CONFIG_HEADER(config.h) @@ -58,7 +58,7 @@ gt_SETLOCALE dnl These are the only lines required to internationalize the package. dnl (OK, not quite, the AC_OUTPUT has also some parts.) -AM_GNU_GETTEXT +AM_GNU_GETTEXT(use-libtool) dnl Check for Emacs and where to install .elc files. AM_PATH_LISPDIR diff --git a/intl/ChangeLog b/intl/ChangeLog index cfebb3510..e9bf88bc2 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,16 @@ +2001-01-21 Bruno Haible + + Use libtool. + * Makefile.in (l): Use INTL_LIBTOOL_SUFFIX_PREFIX instead of l. + (all-no): When USE_INCLUDED_LIBINTL is 'no' but BUILD_INCLUDED_LIBINTL + is 'yes', still build libintl.$la because the testsuite needs it. + (libintl.la): Add $(CPPFLAGS) $(CFLAGS) $(XCFLAGS). Linking via $(CC) + must use all $(CFLAGS). + (install-exec): Use libtool to install libintl.$la. + (uninstall): Use libtool to uninstall libintl.$la. + (mostlyclean): Remove *.la and the .libs subdir. + * intl-compat.c: Reorder. Add comment. + 2001-01-20 Bruno Haible * loadmsgcat.c (O_BINARY): Define on platforms that don't have it. diff --git a/intl/Makefile.in b/intl/Makefile.in index 04e178ada..c28819aa3 100644 --- a/intl/Makefile.in +++ b/intl/Makefile.in @@ -41,7 +41,7 @@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` -l = @l@ +l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar CC = @CC@ @@ -76,6 +76,10 @@ DISTFILES.normal = VERSION DISTFILES.gettext = libintl.glibc plural.c # Libtool's library version information for libintl. +# Before making a gettext release, the gettext maintainer must change this +# according to the libtool documentation, section "Library interface versions". +# Maintainers of other packages that include the intl directory must *not* +# change these values. LTV_CURRENT=1 LTV_REVISION=0 LTV_AGE=0 @@ -98,9 +102,10 @@ LTV_AGE=0 INCLUDES = -I.. -I. -I$(top_srcdir)/intl all: all-@USE_INCLUDED_LIBINTL@ - all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed -all-no: +all-no: all-no-@BUILD_INCLUDED_LIBINTL@ +all-no-yes: libintl.$la +all-no-no: libintl.a: $(OBJECTS) rm -f $@ @@ -108,9 +113,10 @@ libintl.a: $(OBJECTS) $(RANLIB) $@ libintl.la: $(OBJECTS) - $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \ - -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ - -rpath $(libdir) + $(LIBTOOL) --mode=link \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) libintl.h: libgnuintl.h cp $(srcdir)/libgnuintl.h libintl.h @@ -135,7 +141,8 @@ install-exec: all && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ - $(INSTALL_DATA) libintl.a $(DESTDIR)$(libdir)/libintl.a; \ + $(LIBTOOL) --mode=install \ + $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi @@ -181,7 +188,8 @@ uninstall: if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ rm -f $(DESTDIR)$(includedir)/libintl.h; \ - rm -f $(DESTDIR)$(libdir)/libintl.a; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi @@ -238,8 +246,9 @@ ID: $(HEADERS) $(SOURCES) mostlyclean: - rm -f *.a *.o *.lo core core.* + rm -f *.a *.la *.o *.lo core core.* rm -f libintl.h charset.alias ref-add.sed ref-del.sed + rm -f -r .libs _libs clean: mostlyclean diff --git a/intl/intl-compat.c b/intl/intl-compat.c index 3550c78a4..b8edaa17a 100644 --- a/intl/intl-compat.c +++ b/intl/intl-compat.c @@ -25,6 +25,48 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* @@ end of prolog @@ */ +/* This file redirects the gettext functions (without prefix or suffix) to + those defined in the included GNU gettext library (with "__" suffix). + It is compiled into libintl when the included GNU gettext library is + configured --with-included-gettext. + + This redirection works also in the case that the system C library or + the system libintl library contain gettext/textdomain/... functions. + If it didn't, we would need to add preprocessor level redirections to + libgnuintl.h of the following form: + +# define gettext gettext__ +# define dgettext dgettext__ +# define dcgettext dcgettext__ +# define ngettext ngettext__ +# define dngettext dngettext__ +# define dcngettext dcngettext__ +# define textdomain textdomain__ +# define bindtextdomain bindtextdomain__ +# define bind_textdomain_codeset bind_textdomain_codeset__ + + How does this redirection work? There are two cases. + A. When libintl.a is linked into an executable, it works because + functions defined in the executable always override functions in + the shared libraries. + B. When libintl.so is used, it works because + 1. those systems defining gettext/textdomain/... in the C library + (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are + ELF systems and define these symbols as weak, thus explicitly + letting other shared libraries override it. + 2. those systems defining gettext/textdomain/... in a standalone + libintl.so library (namely, Solaris 2.3 and newer) have this + shared library in /usr/lib, and the linker will search /usr/lib + *after* the directory where the GNU gettext library is installed. + + A third case, namely when libintl.a is linked into a shared library + whose name is not libintl.so, is not supported. In this case, on + Solaris, when -lintl precedes the linker option for the shared library + containing GNU gettext, the system's gettext would indeed override + the GNU gettext. Anyone doing this kind of stuff must be clever enough + to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker + command line. */ + #undef gettext #undef dgettext @@ -38,20 +80,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ char * -bindtextdomain (domainname, dirname) - const char *domainname; - const char *dirname; +gettext (msgid) + const char *msgid; { - return bindtextdomain__ (domainname, dirname); + return gettext__ (msgid); } char * -bind_textdomain_codeset (domainname, codeset) +dgettext (domainname, msgid) const char *domainname; - const char *codeset; + const char *msgid; { - return bind_textdomain_codeset__ (domainname, codeset); + return dgettext__ (domainname, msgid); } @@ -66,19 +107,23 @@ dcgettext (domainname, msgid, category) char * -dgettext (domainname, msgid) - const char *domainname; - const char *msgid; +ngettext (msgid1, msgid2, n) + const char *msgid1; + const char *msgid2; + unsigned long int n; { - return dgettext__ (domainname, msgid); + return ngettext__ (msgid1, msgid2, n); } char * -gettext (msgid) - const char *msgid; +dngettext (domainname, msgid1, msgid2, n) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; { - return gettext__ (msgid); + return dngettext__ (domainname, msgid1, msgid2, n); } @@ -95,29 +140,26 @@ dcngettext (domainname, msgid1, msgid2, n, category) char * -dngettext (domainname, msgid1, msgid2, n) +textdomain (domainname) const char *domainname; - const char *msgid1; - const char *msgid2; - unsigned long int n; { - return dngettext__ (domainname, msgid1, msgid2, n); + return textdomain__ (domainname); } char * -ngettext (msgid1, msgid2, n) - const char *msgid1; - const char *msgid2; - unsigned long int n; +bindtextdomain (domainname, dirname) + const char *domainname; + const char *dirname; { - return ngettext__ (msgid1, msgid2, n); + return bindtextdomain__ (domainname, dirname); } char * -textdomain (domainname) +bind_textdomain_codeset (domainname, codeset) const char *domainname; + const char *codeset; { - return textdomain__ (domainname); + return bind_textdomain_codeset__ (domainname, codeset); } diff --git a/m4/ChangeLog b/m4/ChangeLog index 88406db3b..3d102c63c 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,17 @@ +2001-01-21 Bruno Haible + + Use libtool. + * libtool.m4: New file, from libtool-1.3.5. + * Makefile.am (EXTRA_DIST): Add it. + * gettext.m4 (AM_WITH_NLS): Accept 'use-libtool' as first argument. + New variable BUILD_INCLUDED_LIBINTL. Don't force USE_NLS, force only + BUILD_INCLUDED_LIBINTL. + Remove unused variable INTLDEPS. + Fix value of INTLLIBS to match documentation. + Avoid unwanted matches of po/Makefile.in with AC_OUTPUT argument. + (AM_GNU_GETTEXT): Accept 'use-libtool' as first argument. Rename + variable l to INTL_LIBTOOL_SUFFIX_PREFIX. + 2001-01-20 Bruno Haible * gettext.m4 (AM_GNU_GETTEXT): Change computation of NEW_LINGUAS to diff --git a/m4/Makefile.am b/m4/Makefile.am index 00f37f057..399b9f759 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -8,4 +8,4 @@ aclocal_DATA = gettext.m4 isc-posix.m4 lcmessage.m4 progtest.m4 # |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012' EXTRA_DIST = README \ c-bs-a.m4 codeset.m4 gettext.m4 iconv.m4 inttypes_h.m4 isc-posix.m4 \ -lcmessage.m4 progtest.m4 setlocale.m4 uintmax_t.m4 ulonglong.m4 +lcmessage.m4 libtool.m4 progtest.m4 setlocale.m4 uintmax_t.m4 ulonglong.m4 diff --git a/m4/gettext.m4 b/m4/gettext.m4 index 51a2481fd..18aef6c6e 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -9,6 +9,11 @@ # serial 8 dnl Usage: AM_WITH_NLS([SYMBOL], [LIBDIR]). +dnl If SYMBOL is specified and is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/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). Otherwise, a static library +dnl $(top_builddir)/intl/libintl.a will be created. dnl LIBDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl @@ -37,6 +42,7 @@ AC_DEFUN(AM_WITH_NLS, AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) + BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no dnl If we use NLS figure out what method @@ -116,10 +122,10 @@ return (int) gettext ("") + _nl_msg_cat_cntr], AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_SUBST(MSGFMT) + BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo - INTLDEPS='ifelse([$2],[],$(top_builddir)/intl/libintl.a,[$2])' - INTLLIBS=$INTLDEPS + INTLLIBS='ifelse([$2],[],$(top_builddir)/intl,[$2])/libintl.ifelse([$1], use-libtool, [l], [])a' LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi @@ -140,16 +146,15 @@ return (int) gettext ("") + _nl_msg_cat_cntr], POSUB=po fi AC_OUTPUT_COMMANDS( - [case "$CONFIG_FILES" in *po/Makefile.in*) + [case " $CONFIG_FILES " in *" po/Makefile.in "*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. + # If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + # to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes + BUILD_INCLUDED_LIBINTL=yes fi dnl These rules are solely for the distribution goal. While doing this @@ -161,11 +166,11 @@ return (int) gettext ("") + _nl_msg_cat_cntr], done dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(GMOFILES) - AC_SUBST(INTLDEPS) AC_SUBST(INTLLIBS) AC_SUBST(INTLOBJS) AC_SUBST(POFILES) @@ -250,9 +255,9 @@ __argz_count __argz_stringify __argz_next]) fi AC_SUBST(MKINSTALLDIRS) - dnl *** For now the libtool support in intl/Makefile is not for real. - l= - AC_SUBST(l) + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], []) + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. But only do this if the po directory diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 000000000..c41d84aa4 --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,434 @@ +## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- +## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +# serial 40 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| AC_MSG_ERROR([libtool configure failed]) + +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) + +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_RANLIB])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +dnl + +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], +[libtool_flags="$libtool_flags --enable-dlopen"]) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[libtool_flags="$libtool_flags --enable-win32-dll"]) +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +]) +esac +]) + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN(AC_PROG_LD, +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(ac_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$ac_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +]) + +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi]) +]) + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN(AC_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi]) +NM="$ac_cv_path_NM" +AC_MSG_RESULT([$NM]) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN(AC_CHECK_LIBM, +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case "$lt_target" in +*-*-beos* | *-*-cygwin*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-convenience to the +# configure arguments. Note that LIBLTDL and INCLTDL are not +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not +# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed +# with '${top_builddir}/' and INCLTDL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-install to the configure +# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is +# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed +# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed +# with '${top_srcdir}/' (note the single quotes!). If your package is +# not flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl diff --git a/po/ChangeLog b/po/ChangeLog index 0c1baad34..fb1818b6a 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,9 @@ +2001-01-21 Bruno Haible + + * Makefile.in.in (install-data, install-data-yes): Move installation + of po/Makefile.in.in from install-data-yes to install-data, so it is + also installed when gettext is configured with --disable-nls. + 2001-01-20 Bruno Haible * no.po: Update from Trond Endrestøl . diff --git a/po/Makefile.in.in b/po/Makefile.in.in index c6ae119c2..4d2fc8cb8 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -88,6 +88,13 @@ $(srcdir)/$(PACKAGE).pot: $(POTFILES) install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @@ -106,13 +113,6 @@ install-data-yes: all "$(DESTDIR)$$dir/$(PACKAGE).mo"; \ fi; \ done - if test "$(PACKAGE)" = "gettext"; then \ - $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ - $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ - else \ - : ; \ - fi # Define this as empty until I found a useful application. installcheck: diff --git a/src/ChangeLog b/src/ChangeLog index 22fde7850..426918885 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-01-21 Bruno Haible + + Use libtool. + * Makefile.am (LDADD): Remove ../intl/libintl.$la, not needed any more. + (l): Remove macro. + 2001-01-20 Bruno Haible * msgcomm.c (main): Options '-<' and '->' want an argument. diff --git a/src/Makefile.am b/src/Makefile.am index 24c7a7799..4db82f169 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,12 +29,10 @@ EXTRA_DIST = FILES datadir = $(prefix)/share localedir = $(datadir)/locale -l = @l@ - INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/lib -I../intl \ -I$(top_srcdir)/intl DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ -LDADD = ../lib/libnlsut.a @INTLLIBS@ ../intl/libintl.$la +LDADD = ../lib/libnlsut.a @INTLLIBS@ SED = sed YACC = @YACC@ -d diff --git a/tests/ChangeLog b/tests/ChangeLog index 64b790fe9..cb26fc69e 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2001-01-21 Bruno Haible + + Use libtool. + * Makefile.am (LDADD): Use libintl.la instead of libintl.a. + 2001-01-07 Bruno Haible * setlocale.c: New file, moved here from ../src. diff --git a/tests/Makefile.am b/tests/Makefile.am index 742bf2936..b01247ef5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,7 +46,7 @@ xg-test1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c \ # Two auxiliary programs used by the tests. INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/intl DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ -LDADD = ../intl/libintl.a +LDADD = ../intl/libintl.la EXTRA_PROGRAMS = tstgettext cake tstgettext_SOURCES = tstgettext.c setlocale.c tstgettext_LDADD = ../lib/libnlsut.a $(LDADD)