1*4882a593SmuzhiyunFrom e4b3a3f56fa6fc2a51769e286545f0631bb4837c Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Bruno Haible <bruno@clisp.org> 3*4882a593SmuzhiyunDate: Sat, 18 May 2019 23:33:06 +0200 4*4882a593SmuzhiyunSubject: [PATCH] build: Restore the ability to build gettext-tools separately, part 1. 5*4882a593SmuzhiyunMIME-Version: 1.0 6*4882a593SmuzhiyunContent-Type: text/plain; charset=UTF-8 7*4882a593SmuzhiyunContent-Transfer-Encoding: 8bit 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunReported by Hanspeter Niederstrasser <nieder@users.sourceforge.net> 10*4882a593Smuzhiyunin <https://savannah.gnu.org/bugs/?56333>. 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunCode based on patch by Miguel Ángel Arruga Vivas <rosen644835@gmail.com>. 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun* autogen.sh: Copy libtextstyle.m4 for use by gettext-tools. 15*4882a593Smuzhiyun* gettext-tools/configure.ac: New option --with-installed-libtextstyle. 16*4882a593Smuzhiyun(USE_INSTALLED_LIBTEXTSTYLE): New conditional. 17*4882a593Smuzhiyun* gettext-tools/src/Makefile.am (textstyle.h): Disable rule if 18*4882a593SmuzhiyunUSE_INSTALLED_LIBTEXTSTYLE is true. 19*4882a593Smuzhiyun(LT_LIBTEXTSTYLE): New variable. 20*4882a593Smuzhiyun(libgettextsrc_la_LDFLAGS): Use it instead of hardcoding a relative filename of 21*4882a593Smuzhiyunlibtextstyle.la. 22*4882a593Smuzhiyun* configure.ac: Filter out --with-installed-libtextstyle from inherited --help 23*4882a593Smuzhiyunoutput. 24*4882a593Smuzhiyun* Makefile.am (distcheck-hook): Compare different copies of libtextstyle.m4. 25*4882a593Smuzhiyun* PACKAGING: Document that gettext-tools's configure needs to be invoked with 26*4882a593Smuzhiyun--with-installed-libtextstyle. 27*4882a593Smuzhiyun 28*4882a593SmuzhiyunUpstream-status: committed. 29*4882a593Smuzhiyunhttps://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=e4b3a3f56fa6fc2a51769e286545f0631bb4837c 30*4882a593Smuzhiyun 31*4882a593SmuzhiyunSigned-off-by: Bruno Haible <bruno@clisp.org> 32*4882a593Smuzhiyun[Backported to 0.20.1] 33*4882a593SmuzhiyunSigned-off-by: Adam Duskett <Aduskett@gmail.com> 34*4882a593Smuzhiyun--- 35*4882a593Smuzhiyun PACKAGING | 2 +- 36*4882a593Smuzhiyun autogen.sh | 1 + 37*4882a593Smuzhiyun configure.ac | 2 +- 38*4882a593Smuzhiyun gettext-tools/configure.ac | 16 ++++++++++++++++ 39*4882a593Smuzhiyun gettext-tools/src/Makefile.am | 8 +++++++- 40*4882a593Smuzhiyun 5 files changed, 26 insertions(+), 3 deletions(-) 41*4882a593Smuzhiyun 42*4882a593Smuzhiyundiff --git a/PACKAGING b/PACKAGING 43*4882a593Smuzhiyunindex a8ce979..52b80ac 100644 44*4882a593Smuzhiyun--- a/PACKAGING 45*4882a593Smuzhiyun+++ b/PACKAGING 46*4882a593Smuzhiyun@@ -42,7 +42,7 @@ The 'libtextstyle' binary package can be installed by doing 47*4882a593Smuzhiyun The 'gettext-tools' binary package can be installed by doing 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun cd gettext-tools 50*4882a593Smuzhiyun- ./configure 51*4882a593Smuzhiyun+ ./configure --with-installed-libtextstyle 52*4882a593Smuzhiyun make 53*4882a593Smuzhiyun make install 54*4882a593Smuzhiyun 55*4882a593Smuzhiyundiff --git a/autogen.sh b/autogen.sh 56*4882a593Smuzhiyunindex 5c28b6f..2ccf373 100755 57*4882a593Smuzhiyun--- a/autogen.sh 58*4882a593Smuzhiyun+++ b/autogen.sh 59*4882a593Smuzhiyun@@ -268,6 +268,7 @@ if ! $skip_gnulib; then 60*4882a593Smuzhiyun $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 \ 61*4882a593Smuzhiyun --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 \ 62*4882a593Smuzhiyun `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 $? 63*4882a593Smuzhiyun+ $GNULIB_TOOL --copy-file m4/libtextstyle.m4 gettext-tools/gnulib-m4/libtextstyle.m4 || exit $? 64*4882a593Smuzhiyun # In gettext-tools/libgrep: 65*4882a593Smuzhiyun GNULIB_MODULES_TOOLS_FOR_LIBGREP=' 66*4882a593Smuzhiyun mbrlen 67*4882a593Smuzhiyundiff --git a/configure.ac b/configure.ac 68*4882a593Smuzhiyunindex 38db6fd..0c84bdd 100644 69*4882a593Smuzhiyun--- a/configure.ac 70*4882a593Smuzhiyun+++ b/configure.ac 71*4882a593Smuzhiyun@@ -49,7 +49,7 @@ AC_CANONICAL_HOST 72*4882a593Smuzhiyun dnl Optional Features: AC_ARG_ENABLE calls 73*4882a593Smuzhiyun dnl Optional Packages: AC_ARG_WITH calls 74*4882a593Smuzhiyun dnl Some influential environment variables: AC_ARG_VAR calls 75*4882a593Smuzhiyun-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 ]) 76*4882a593Smuzhiyun+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 ]) 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun AC_CONFIG_FILES([Makefile]) 79*4882a593Smuzhiyun 80*4882a593Smuzhiyundiff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac 81*4882a593Smuzhiyunindex cf1dd73..a6816b8 100644 82*4882a593Smuzhiyun--- a/gettext-tools/configure.ac 83*4882a593Smuzhiyun+++ b/gettext-tools/configure.ac 84*4882a593Smuzhiyun@@ -121,6 +121,22 @@ AM_CONDITIONAL([PACKAGE_IS_GETTEXT_TOOLS], [true]) 85*4882a593Smuzhiyun AM_CONDITIONAL([PRELOADABLE_LIBINTL], 86*4882a593Smuzhiyun [test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes]) 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun+dnl This option allows to build gettext-tools without (re)building libtextstyle. 89*4882a593Smuzhiyun+AC_ARG_WITH([installed-libtextstyle], 90*4882a593Smuzhiyun+ [AS_HELP_STRING([--with-installed-libtextstyle], 91*4882a593Smuzhiyun+ [Use an already installed libtextstyle.])], 92*4882a593Smuzhiyun+ [gt_use_installed_libtextstyle=$withval], 93*4882a593Smuzhiyun+ [gt_use_installed_libtextstyle=no]) 94*4882a593Smuzhiyun+if test "$gt_use_installed_libtextstyle" != no; then 95*4882a593Smuzhiyun+ gl_LIBTEXTSTYLE 96*4882a593Smuzhiyun+else 97*4882a593Smuzhiyun+ test -f ../libtextstyle/Makefile || { 98*4882a593Smuzhiyun+ 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.]) 99*4882a593Smuzhiyun+ } 100*4882a593Smuzhiyun+fi 101*4882a593Smuzhiyun+AM_CONDITIONAL([USE_INSTALLED_LIBTEXTSTYLE], 102*4882a593Smuzhiyun+ [test "$gt_use_installed_libtextstyle" != no]) 103*4882a593Smuzhiyun+ 104*4882a593Smuzhiyun dnl This line internationalizes the bison generated parsers. 105*4882a593Smuzhiyun BISON_I18N 106*4882a593Smuzhiyun 107*4882a593Smuzhiyundiff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am 108*4882a593Smuzhiyunindex b98b7ab..af3dcee 100644 109*4882a593Smuzhiyun--- a/gettext-tools/src/Makefile.am 110*4882a593Smuzhiyun+++ b/gettext-tools/src/Makefile.am 111*4882a593Smuzhiyun@@ -250,6 +250,9 @@ cldr_plurals_SOURCES = cldr-plural.y cldr-plural-exp.c cldr-plurals.c 112*4882a593Smuzhiyun cldr_plurals_CFLAGS = $(AM_CFLAGS) $(INCXML) 113*4882a593Smuzhiyun cldr_plurals_LDADD = libgettextsrc.la $(LDADD) 114*4882a593Smuzhiyun 115*4882a593Smuzhiyun+if USE_INSTALLED_LIBTEXTSTYLE 116*4882a593Smuzhiyun+LT_LIBTEXTSTYLE = @LTLIBTEXTSTYLE@ 117*4882a593Smuzhiyun+else 118*4882a593Smuzhiyun # How to get the include files of libtextstyle. 119*4882a593Smuzhiyun textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h: 120*4882a593Smuzhiyun here=`pwd`; \ 121*4882a593Smuzhiyun@@ -257,6 +260,9 @@ textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h: 122*4882a593Smuzhiyun $(MAKE) install-nobase_includeHEADERS install-nobase_nodist_includeHEADERS includedir="$$here" 123*4882a593Smuzhiyun BUILT_SOURCES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h 124*4882a593Smuzhiyun MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h 125*4882a593Smuzhiyun+# Where to find the built libtextstyle library. 126*4882a593Smuzhiyun+LT_LIBTEXTSTYLE = ../../libtextstyle/lib/libtextstyle.la 127*4882a593Smuzhiyun+endif 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun # How to build libgettextsrc.la. 130*4882a593Smuzhiyun # Need ../gnulib-lib/libgettextlib.la. 131*4882a593Smuzhiyun@@ -268,7 +274,7 @@ MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyl 132*4882a593Smuzhiyun # use iconv(). 133*4882a593Smuzhiyun libgettextsrc_la_LDFLAGS = \ 134*4882a593Smuzhiyun -release @VERSION@ \ 135*4882a593Smuzhiyun- ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) ../../libtextstyle/lib/libtextstyle.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined 136*4882a593Smuzhiyun+ ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) $(LT_LIBTEXTSTYLE) @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined 137*4882a593Smuzhiyun 138*4882a593Smuzhiyun # OS/2 does not support a DLL name longer than 8 characters. 139*4882a593Smuzhiyun if OS2 140*4882a593Smuzhiyun-- 141*4882a593Smuzhiyun2.24.1 142*4882a593Smuzhiyun 143