From: Bruno Haible Date: Tue, 15 Jun 2021 10:49:11 +0000 (+0200) Subject: build: Simplify: Don't build libintl+libgnuintl a second time in gettext-tools. X-Git-Tag: v0.22~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=785a89e5df994c2b242f082d60de89e2d520aa4a;p=thirdparty%2Fgettext.git build: Simplify: Don't build libintl+libgnuintl a second time in gettext-tools. * PACKAGING: Document that gettext-tools cannot be built without gettext-runtime. * autogen.sh: Don't create gettext-tools/intl/Makefile.am. * gettext-tools/Makefile.am (SUBDIRS): Remove 'intl'. * gettext-runtime/intl/Makefile.am (dist-hook): Remove. (install-data-local, uninstall-local, uninstall-sources): Moved ... * gettext-tools/misc/Makefile.am (install-data-local, uninstall-local, uninstall-sources): ... to here. * gettext-runtime/configure.ac (PACKAGE_IS_GETTEXT_TOOLS): Remove conditional. * gettext-tools/configure.ac: Add 3rd argument to AM_GNU_GETTEXT invocation. (PACKAGE_IS_GETTEXT_TOOLS): Remove conditional. Update reference to os2compat.h. Don't create intl/Makefile from intl/Makefile.in. * gettext-tools/gnulib-lib/Makefile.am (AM_CPPFLAGS): Use the built header files in gettext-runtime/intl/. * gettext-tools/libgrep/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/src/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/libgettextpo/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/gnulib-tests/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/tests/Makefile.am (AM_CPPFLAGS): Likewise. (LDADD_yes, LDADD_no): Use the built libraries in gettext-runtime/intl/. * gettext-tools/tests/lang-c: Use the built header files in gettext-runtime/intl/. * gettext-tools/tests/lang-c++: Likewise. * gettext-tools/tests/lang-objc: Likewise. --- diff --git a/.gitignore b/.gitignore index 9a7b3ef08..0ad280878 100644 --- a/.gitignore +++ b/.gitignore @@ -316,7 +316,6 @@ # Other files brought in by autogen.sh: /build-aux/config.guess /build-aux/config.sub -/gettext-tools/intl/ # Dummy ChangeLogs: /ChangeLog /gettext-runtime/ChangeLog diff --git a/PACKAGING b/PACKAGING index f4bae4561..cf1ae86ad 100644 --- a/PACKAGING +++ b/PACKAGING @@ -39,7 +39,8 @@ The 'libtextstyle' binary package can be installed by doing make make install -The 'gettext-tools' binary package can be installed by doing +The 'gettext-tools' binary package can be installed by building +'gettext-runtime' first, and then cd gettext-tools ./configure --with-installed-libtextstyle --with-installed-csharp-dll diff --git a/autogen.sh b/autogen.sh index 04b8ca985..7935e2f66 100755 --- a/autogen.sh +++ b/autogen.sh @@ -476,8 +476,6 @@ for file in po.m4; do done echo "$0: generating configure in gettext-tools..." -mkdir -p gettext-tools/intl -cp -p gettext-runtime/intl/Makefile.am gettext-tools/intl/Makefile.am cd gettext-tools aclocal -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 \ && autoconf \ diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 26b8f0745..2b0afc627 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-runtime directory of GNU gettext -dnl Copyright (C) 1995-2010, 2012-2015, 2018-2020 Free Software Foundation, Inc. +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 @@ -101,7 +101,6 @@ 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([PACKAGE_IS_GETTEXT_TOOLS], [false]) AM_CONDITIONAL([PRELOADABLE_LIBINTL], [false]) dnl Checks for header files, functions and declarations. diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am index 329c1410b..ea78e76d8 100644 --- a/gettext-runtime/intl/Makefile.am +++ b/gettext-runtime/intl/Makefile.am @@ -26,26 +26,6 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = SUFFIXES = -# The VPATH variable allows builds with $builddir != $srcdir, assuming a -# 'make' program that supports VPATH (such as GNU make). The VPATH definition -# is removed by autoconf automatically when "$(srcdir)" = ".". -# In this directory, the VPATH handling is particular: -# 1. The .c -> .lo rule carefully uses $(srcdir), so that VPATH can be omitted. -# 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise -# 'make' does the wrong thing if GNU gettext was configured with -# "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la -# files it finds in srcdir = ../../gettext-runtime/intl. -origsrcdir = @srcdir@ -# In gettext-tools/intl/, distribute the right Makefile.in. -dist-hook: -if PACKAGE_IS_GETTEXT_TOOLS - for file in Makefile.am Makefile.in; do \ - cp -p $(origsrcdir)/$$file $(distdir)/$$file || exit 1; \ - done -else - @: -endif - # -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. # -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. AM_CPPFLAGS = \ @@ -630,18 +610,6 @@ uninstall-aliasfile: ref-del.sed endif -# We don't install the source code any more. - -if PACKAGE_IS_GETTEXT_TOOLS - -install-data-local: uninstall-sources -uninstall-local: uninstall-sources -uninstall-sources: - rm -rf $(DESTDIR)$(datadir)/gettext/intl - -endif - - # Clean up after Solaris cc. clean-local: rm -rf SunWS_cache diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am index 449a79754..90f554860 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools directory of GNU gettext -## Copyright (C) 1995-2007, 2010, 2013-2016, 2018-2019 Free Software Foundation, Inc. +## Copyright (C) 1995-2007, 2010, 2013-2016, 2018-2019, 2021 Free Software Foundation, Inc. ## ## 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 @@ -19,7 +19,7 @@ AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 -SUBDIRS = intl gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc +SUBDIRS = gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc EXTRA_DIST = misc/DISCLAIM MOSTLYCLEANFILES = core *.stackdump diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 63a0b1ee5..623fde4fc 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-tools directory of GNU gettext -dnl Copyright (C) 1995-2020 Free Software Foundation, Inc. +dnl Copyright (C) 1995-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 @@ -122,11 +122,10 @@ 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_GNU_GETTEXT([use-libtool], [need-ngettext], [\${top_builddir}/../gettext-runtime/intl]) +dnl Conditionals for referencing the ../gettext-runtime/intl/ directory. AM_CONDITIONAL([USE_INCLUDED_LIBINTL], [test $USE_INCLUDED_LIBINTL = yes]) AM_CONDITIONAL([BUILD_INCLUDED_LIBINTL], [test $BUILD_INCLUDED_LIBINTL = yes]) -AM_CONDITIONAL([PACKAGE_IS_GETTEXT_TOOLS], [true]) AM_CONDITIONAL([PRELOADABLE_LIBINTL], [test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes && test "$enable_shared" = yes]) @@ -335,7 +334,7 @@ AH_BOTTOM([ /* Extra OS/2 (emx+gcc) defines. */ #if defined __EMX__ && !defined __KLIBC__ -# include "intl/os2compat.h" +# include "../gettext-runtime/intl/os2compat.h" #endif ]) @@ -544,15 +543,6 @@ AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([doc/Makefile]) -AC_CONFIG_FILES([intl/Makefile], [ - # Change srcdir variable so that it points to ../gettext-runtime/intl. - sed -e 's|^srcdir =.*$|srcdir = $(top_srcdir)/../gettext-runtime/intl|' \ - -e 's|^VPATH =.*$||' \ - -e 's|^DISTFILES =.*|DISTFILES =|' \ - < intl/Makefile > intl/Makefile.tmp - mv intl/Makefile.tmp intl/Makefile - ]) - AC_CONFIG_FILES([its/Makefile]) AC_CONFIG_FILES([gnulib-lib/Makefile]) diff --git a/gettext-tools/gnulib-lib/Makefile.am b/gettext-tools/gnulib-lib/Makefile.am index e2a935df9..244c3acfa 100644 --- a/gettext-tools/gnulib-lib/Makefile.am +++ b/gettext-tools/gnulib-lib/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools/gnulib-lib subdirectory of GNU gettext -## Copyright (C) 1995-1998, 2000-2006, 2009, 2016, 2019 Free Software +## Copyright (C) 1995-1998, 2000-2006, 2009, 2016, 2019, 2021 Free Software ## Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify @@ -38,7 +38,7 @@ pkgdata_DATA = AM_CPPFLAGS = # Hmm... is this still necessary? -AM_CPPFLAGS += -I$(top_builddir)/intl -I$(top_srcdir)/intl +AM_CPPFLAGS += -I$(top_builddir)/../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl # Needed so that config.h and woe32dll/export.h are found. AM_CPPFLAGS += -I$(top_builddir) -I$(top_srcdir) diff --git a/gettext-tools/gnulib-tests/Makefile.am b/gettext-tools/gnulib-tests/Makefile.am index 68d094c28..d5d53cba1 100644 --- a/gettext-tools/gnulib-tests/Makefile.am +++ b/gettext-tools/gnulib-tests/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools/gnulib-tests subdirectory of GNU gettext -## Copyright (C) 2007, 2009-2010, 2019 Free Software Foundation, Inc. +## Copyright (C) 2007, 2009-2010, 2019, 2021 Free Software Foundation, Inc. ## ## 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 @@ -22,7 +22,7 @@ include Makefile.gnulib AUTOMAKE_OPTIONS += 1.11 color-tests # Ensure that test-quotearg.c finds libintl.h. -AM_CPPFLAGS += -I../intl +AM_CPPFLAGS += -I../../gettext-runtime/intl # Remove .deps directories created by 'configure'. diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am index f5e96027b..e5688b82f 100644 --- a/gettext-tools/libgettextpo/Makefile.am +++ b/gettext-tools/libgettextpo/Makefile.am @@ -38,7 +38,7 @@ AM_CPPFLAGS = \ -I. -I$(srcdir) \ -I.. -I$(top_srcdir) \ -I../src -I$(top_srcdir)/src \ - -I../intl -I$(top_srcdir)/../gettext-runtime/intl + -I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=1 @DEFS@ diff --git a/gettext-tools/libgrep/Makefile.am b/gettext-tools/libgrep/Makefile.am index d5e6b8372..37393a2a3 100644 --- a/gettext-tools/libgrep/Makefile.am +++ b/gettext-tools/libgrep/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for libgrep directory in GNU gettext package. -## Copyright (C) 2005-2007, 2009-2010, 2014 Free Software Foundation, Inc. +## Copyright (C) 2005-2007, 2009-2010, 2014, 2021 Free Software Foundation, Inc. ## ## 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 @@ -27,7 +27,7 @@ MAINTAINERCLEANFILES = noinst_LIBRARIES = -AM_CPPFLAGS = -I.. -I../gnulib-lib -I$(top_srcdir)/gnulib-lib -I../intl +AM_CPPFLAGS = -I.. -I../gnulib-lib -I$(top_srcdir)/gnulib-lib -I../../gettext-runtime/intl # Rules generated and collected by gnulib-tool, for building libgrep.a. include Makefile.gnulib diff --git a/gettext-tools/misc/Makefile.am b/gettext-tools/misc/Makefile.am index a0ade1e45..87fa7806b 100644 --- a/gettext-tools/misc/Makefile.am +++ b/gettext-tools/misc/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools/misc subdirectory of GNU gettext -## Copyright (C) 1995-1997, 2000-2003, 2005-2007, 2009-2010, 2019-2020 Free +## Copyright (C) 1995-1997, 2000-2003, 2005-2007, 2009-2010, 2019-2021 Free ## Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify @@ -99,3 +99,10 @@ archive.git.tar.gz: $(srcdir)/archive.dir.tar # The archive.cvs.tar.gz is generated from archive.dir.tar. archive.cvs.tar.gz: $(srcdir)/archive.dir.tar ./convert-archive dir cvs '$(srcdir)'/archive.dir.tar $@ + + +# We don't install the source code in unpacked form any more. +install-data-local: uninstall-sources +uninstall-local: uninstall-sources +uninstall-sources: + rm -rf $(DESTDIR)$(datadir)/gettext/intl diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 1024992f0..37062367c 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -95,7 +95,7 @@ AM_CPPFLAGS = \ -I.. -I$(top_srcdir) \ -I$(top_srcdir)/libgrep \ -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \ - -I../intl -I$(top_srcdir)/../gettext-runtime/intl + -I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl DEFS = \ -DLOCALEDIR=\"$(localedir)\" -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \ -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index 04db0554f..68f833c0d 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -244,13 +244,13 @@ xg-c-1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c AM_CPPFLAGS = \ -I.. \ -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \ - -I../intl + -I../../gettext-runtime/intl DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ # INTL_MACOSX_LIBS is needed because the programs depend on libintl.la # but libtool doesn't put -Wl,-framework options into .la files. LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@) @INTL_MACOSX_LIBS@ -LDADD_yes = ../intl/libintl.la @LTLIBTHREAD@ -LDADD_no = ../intl/libgnuintl.la @LTLIBTHREAD@ @LTLIBINTL@ +LDADD_yes = ../../gettext-runtime/intl/libintl.la @LTLIBTHREAD@ +LDADD_no = ../../gettext-runtime/intl/libgnuintl.la @LTLIBTHREAD@ @LTLIBINTL@ check_PROGRAMS = tstgettext tstngettext testlocale intl-1-prg intl-3-prg intl-4-prg intl-5-prg intl-6-prg intl-setlocale-1-prg intl-setlocale-2-prg intl-thread-1-prg intl-thread-2-prg intl-thread-3-prg intl-version-prg cake fc3 fc4 fc5 gettextpo-1-prg sentence-1-prg tstgettext_SOURCES = \ tstgettext.c ../../gettext-runtime/src/escapes.h \ diff --git a/gettext-tools/tests/lang-c b/gettext-tools/tests/lang-c index b350899a6..28464689c 100755 --- a/gettext-tools/tests/lang-c +++ b/gettext-tools/tests/lang-c @@ -46,14 +46,13 @@ EOF # Put the -I flags before ${CFLAGS} ${CPPFLAGS}, to make sure that libintl.h # is found in the build directory, regardless of -I options present in # ${CFLAGS} or ${CPPFLAGS}. -${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../intl ${CFLAGS} \ - ${CPPFLAGS} -c prog.c || Exit 1 +${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../../gettext-runtime/intl ${CFLAGS} ${CPPFLAGS} -c prog.c \ + || Exit 1 : ${CONFIG_SHELL=${SHELL-/bin/sh}} ${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \ - ${CC} ${CFLAGS} -o prog prog.${OBJEXT} \ - ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \ - || Exit 1 + ${CC} ${CFLAGS} -o prog prog.${OBJEXT} ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \ + || Exit 1 : ${XGETTEXT=xgettext} ${XGETTEXT} -o prog.tmp --omit-header --no-location -k_ prog.c || Exit 1 diff --git a/gettext-tools/tests/lang-c++ b/gettext-tools/tests/lang-c++ index d5ed00a43..1439ceb1e 100755 --- a/gettext-tools/tests/lang-c++ +++ b/gettext-tools/tests/lang-c++ @@ -65,17 +65,17 @@ EOF # Put the -I flags before ${CXXFLAGS} ${CPPFLAGS}, to make sure that libintl.h # is found in the build directory, regardless of -I options present in # ${CXXFLAGS} or ${CPPFLAGS}. -${CXX} -I../.. -I../../../gettext-runtime/libasprintf -I"$abs_top_srcdir"/gnulib-lib -I../../intl ${CXXFLAGS} ${CPPFLAGS} -c prog.cc \ +${CXX} -I../.. -I../../../gettext-runtime/libasprintf -I"$abs_top_srcdir"/gnulib-lib -I../../../gettext-runtime/intl ${CXXFLAGS} ${CPPFLAGS} -c prog.cc \ || Exit 1 # Remove the -Wl,--disable-auto-import option here that is added by # woe32-dll.m4. Cygwin 1.7.2 does not support it in C++ mode: It gives # a link error about 'std::cout'. : ${CONFIG_SHELL=${SHELL-/bin/sh}} ${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CXX --mode=link \ - ${CXX} ${CXXFLAGS} `echo "X ${LDFLAGS} " | sed -e 's/^X//' -e 's/ -Wl,--disable-auto-import / /'` -o prog prog.${OBJEXT} \ - ../../../gettext-runtime/libasprintf/libasprintf.la \ - ../../gnulib-lib/libgettextlib.la ${LTLIBINTL} \ - || Exit 1 + ${CXX} ${CXXFLAGS} `echo "X ${LDFLAGS} " | sed -e 's/^X//' -e 's/ -Wl,--disable-auto-import / /'` -o prog prog.${OBJEXT} \ + ../../../gettext-runtime/libasprintf/libasprintf.la \ + ../../gnulib-lib/libgettextlib.la ${LTLIBINTL} \ + || Exit 1 : ${XGETTEXT=xgettext} ${XGETTEXT} -o prog.tmp --omit-header --no-location -k_ prog.cc || Exit 1 diff --git a/gettext-tools/tests/lang-objc b/gettext-tools/tests/lang-objc index bc2578cc1..a40311a5e 100755 --- a/gettext-tools/tests/lang-objc +++ b/gettext-tools/tests/lang-objc @@ -61,14 +61,13 @@ EOF # Put the -I flags before ${CFLAGS} ${CPPFLAGS}, to make sure that libintl.h # is found in the build directory, regardless of -I options present in # ${CFLAGS} or ${CPPFLAGS}. -${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../intl ${CFLAGS} \ - ${CPPFLAGS} -c prog.m || Exit 1 +${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../../gettext-runtime/intl ${CFLAGS} ${CPPFLAGS} -c prog.m \ + || Exit 1 : ${CONFIG_SHELL=${SHELL-/bin/sh}} ${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \ - ${CC} ${CFLAGS} -o prog prog.${OBJEXT} \ - ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \ - || Exit 1 + ${CC} ${CFLAGS} -o prog prog.${OBJEXT} ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \ + || Exit 1 : ${XGETTEXT=xgettext} ${XGETTEXT} -o prog.tmp --omit-header --no-location -k_ prog.m || Exit 1