]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Restore the ability to build gettext-tools separately, part 1.
authorBruno Haible <bruno@clisp.org>
Sat, 18 May 2019 21:33:06 +0000 (23:33 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Apr 2020 10:49:33 +0000 (12:49 +0200)
Reported by Hanspeter Niederstrasser <nieder@users.sourceforge.net>
in <https://savannah.gnu.org/bugs/?56333>.

Code based on patch by Miguel Ángel Arruga Vivas <rosen644835@gmail.com>.

* autogen.sh: Copy libtextstyle.m4 for use by gettext-tools.
* gettext-tools/configure.ac: New option --with-installed-libtextstyle.
(USE_INSTALLED_LIBTEXTSTYLE): New conditional.
* gettext-tools/src/Makefile.am (textstyle.h): Disable rule if
USE_INSTALLED_LIBTEXTSTYLE is true.
(LT_LIBTEXTSTYLE): New variable.
(libgettextsrc_la_LDFLAGS): Use it instead of hardcoding a relative filename of
libtextstyle.la.
* configure.ac: Filter out --with-installed-libtextstyle from inherited --help
output.
* Makefile.am (distcheck-hook): Compare different copies of libtextstyle.m4.
* PACKAGING: Document that gettext-tools's configure needs to be invoked with
--with-installed-libtextstyle.

Makefile.am
PACKAGING
autogen.sh
configure.ac
gettext-tools/configure.ac
gettext-tools/src/Makefile.am

index be8a2c92819761509e49feb9c88374e782bc36fe..48e8eb007040ad4ded9739c4225cf900ddc32298 100644 (file)
@@ -123,6 +123,7 @@ distcheck-hook:
        test "`sed 1,16d $(srcdir)/gettext-runtime/intl/xsize.h | md5sum`" = "`sed 1,16d $(srcdir)/gettext-tools/gnulib-lib/xsize.h | md5sum`"
        cmp -s $(srcdir)/gettext-runtime/man/help2man $(srcdir)/gettext-tools/man/help2man
        cmp -s $(srcdir)/gettext-runtime/man/x-to-1.in $(srcdir)/gettext-tools/man/x-to-1.in
+       cmp -s $(srcdir)/libtextstyle/m4/libtextstyle.m4 $(srcdir)/gettext-tools/gnulib-m4/libtextstyle.m4
        cmp -s $(srcdir)/gettext-tools/examples/hello-java-awt/m4/TestAWT.java $(srcdir)/gettext-tools/examples/hello-java-swing/m4/TestAWT.java
        cmp -s $(srcdir)/gettext-tools/examples/hello-java-awt/m4/TestAWT.class $(srcdir)/gettext-tools/examples/hello-java-swing/m4/TestAWT.class
        test "`sed 1,15d $(srcdir)/gnulib-local/lib/alloca.in.h | md5sum`" = "`sed 1,15d $(srcdir)/gettext-runtime/libasprintf/alloca.in.h | md5sum`"
index a8ce979f947fcf5092a56f400534d9660542bfd8..52b80ac7e51f46ec25dbb369d93a2575df827aa6 100644 (file)
--- a/PACKAGING
+++ b/PACKAGING
@@ -42,7 +42,7 @@ The 'libtextstyle' binary package can be installed by doing
 The 'gettext-tools' binary package can be installed by doing
 
       cd gettext-tools
-      ./configure
+      ./configure --with-installed-libtextstyle
       make
       make install
 
index 2415b5547513e52b80cbf974aab3cd01ed472a6d..f03a446d5ce1e6ff880db7cb2f129b0ad3d32313 100755 (executable)
@@ -273,6 +273,7 @@ if ! $skip_gnulib; then
   $GNULIB_TOOL --dir=gettext-tools --lib=libgettextlib --source-base=gnulib-lib --m4-base=gnulib-m4 --tests-base=gnulib-tests --makefile-name=Makefile.gnulib --libtool --with-tests --local-dir=gnulib-local --local-symlink \
     --import --avoid=array-list-tests --avoid=linkedhash-list-tests --avoid=hash-tests --avoid=fdutimensat-tests --avoid=futimens-tests --avoid=utime-tests --avoid=utimens-tests --avoid=utimensat-tests \
     `for m in $GNULIB_MODULES_TOOLS_LIBUNISTRING_TESTS; do echo --avoid=$m; done` $GNULIB_MODULES_TOOLS_FOR_SRC $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES $GNULIB_MODULES_TOOLS_OTHER || exit $?
+  $GNULIB_TOOL --copy-file m4/libtextstyle.m4 gettext-tools/gnulib-m4/libtextstyle.m4 || exit $?
   # In gettext-tools/libgrep:
   GNULIB_MODULES_TOOLS_FOR_LIBGREP='
     mbrlen
index 38db6fd3fbd8a9228680b09c6408e420716bcf20..0c84bdd724fc32badbdb0d5d5bfad8a4e8ebe4d6 100644 (file)
@@ -49,7 +49,7 @@ AC_CANONICAL_HOST
 dnl Optional Features: AC_ARG_ENABLE calls
 dnl Optional Packages: AC_ARG_WITH calls
 dnl Some influential environment variables: AC_ARG_VAR calls
-esyscmd([{ cd gettext-runtime && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd libtextstyle && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd gettext-tools && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | sed -f build-aux/ac-help.sed ])
+esyscmd([{ cd gettext-runtime && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd libtextstyle && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; { cd gettext-tools && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | grep -v installed.libtextstyle; } | sed -f build-aux/ac-help.sed ])
 
 AC_CONFIG_FILES([Makefile])
 
index c512480a75442998a1a2e8d166997fd10bf13593..104b067badbe80e703d818bd6a4a91f35d77780f 100644 (file)
@@ -131,6 +131,22 @@ AM_CONDITIONAL([PACKAGE_IS_GETTEXT_TOOLS], [true])
 AM_CONDITIONAL([PRELOADABLE_LIBINTL],
   [test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes && test "$enable_shared" = yes])
 
+dnl This option allows to build gettext-tools without (re)building libtextstyle.
+AC_ARG_WITH([installed-libtextstyle],
+  [AS_HELP_STRING([--with-installed-libtextstyle],
+     [Use an already installed libtextstyle.])],
+  [gt_use_installed_libtextstyle=$withval],
+  [gt_use_installed_libtextstyle=no])
+if test "$gt_use_installed_libtextstyle" != no; then
+  gl_LIBTEXTSTYLE
+else
+  test -f ../libtextstyle/Makefile || {
+    AC_MSG_ERROR([When building the gettext-tools package without building the entire gettext package, you need to pass the --with-installed-libtextstyle option to configure.])
+  }
+fi
+AM_CONDITIONAL([USE_INSTALLED_LIBTEXTSTYLE],
+  [test "$gt_use_installed_libtextstyle" != no])
+
 dnl This line internationalizes the bison generated parsers.
 BISON_I18N
 
index b98b7abd35ca19f14ce362f5843a46f68156661a..af3dcee15480d4b45d5a03602d0d7678e3e48eef 100644 (file)
@@ -250,6 +250,9 @@ cldr_plurals_SOURCES = cldr-plural.y cldr-plural-exp.c cldr-plurals.c
 cldr_plurals_CFLAGS = $(AM_CFLAGS) $(INCXML)
 cldr_plurals_LDADD = libgettextsrc.la $(LDADD)
 
+if USE_INSTALLED_LIBTEXTSTYLE
+LT_LIBTEXTSTYLE = @LTLIBTEXTSTYLE@
+else
 # How to get the include files of libtextstyle.
 textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h:
        here=`pwd`; \
@@ -257,6 +260,9 @@ textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h:
          $(MAKE) install-nobase_includeHEADERS install-nobase_nodist_includeHEADERS includedir="$$here"
 BUILT_SOURCES    += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h
 MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h
+# Where to find the built libtextstyle library.
+LT_LIBTEXTSTYLE = ../../libtextstyle/lib/libtextstyle.la
+endif
 
 # How to build libgettextsrc.la.
 # Need ../gnulib-lib/libgettextlib.la.
@@ -268,7 +274,7 @@ MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyl
 # use iconv().
 libgettextsrc_la_LDFLAGS = \
   -release @VERSION@ \
-  ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) ../../libtextstyle/lib/libtextstyle.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
+  ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) $(LT_LIBTEXTSTYLE) @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
 
 # OS/2 does not support a DLL name longer than 8 characters.
 if OS2