0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch 7.0 KB

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