Daiki Ueno <[email protected]> writes: > Roumen Petrov <[email protected]> writes:
>>> 2008-04-06 Bruno Haible<[email protected]> >>> * m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use >>> CONFIG_SHELL; don't assume that the Makefile.in >>> will set SHELL >>> to ${CONFIG_SHELL}. >> Yes I note above change . I cannot reproduce it . >> In may build environment makefile SHELL macro (variable) is set to >> value of CONFIG_SHELL specified at configuration time. > > I did some archaeologic research and found the original patch: > https://lists.gnu.org/archive/html/bug-libtool/2008-04/msg00018.html > It seems the patch was added for OSF/1. Do you know if the original > issue was fixed these days? > > On the other hand, can't we assume that $(LIBTOOL) is always expanded to > "$(SHELL) $(top_builddir)/libtool"? If so, perhaps we could eliminate > $LIBTOOL substitution in init-env and call the libtool script directly > from the tests (e.g. lang-c) using $CONFIG_SHELL. I've pushed a change in this direction. Patch attached. Regards, -- Daiki Ueno
>From 56d608bb9540eeb25c080ccebbf88d001dacc28b Mon Sep 17 00:00:00 2001 From: Daiki Ueno <[email protected]> Date: Tue, 11 Mar 2014 13:06:40 +0900 Subject: [PATCH] tests: Call included libtool script with $CONFIG_SHELL --- gettext-tools/tests/ChangeLog | 9 +++++++++ gettext-tools/tests/init-env.in | 3 +-- gettext-tools/tests/lang-c | 11 ++++++++--- gettext-tools/tests/lang-c++ | 9 ++++++--- gettext-tools/tests/lang-objc | 11 ++++++++--- 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index e260c63..8aeb95d 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,12 @@ +2014-03-11 Daiki Ueno <[email protected]> + + * init-env.in (top_builddir): Don't set $LIBTOOL. + * lang-c: Explicitly call $top_builddir/libtool script with + $CONFIG_SHELL; also separate compilation/link into two phase as + lang-c++. + * lang-c++: Likewise. + * lang-objc: Likewise. + 2014-03-10 Daiki Ueno <[email protected]> php: Recognize single and double quotes around heredoc label diff --git a/gettext-tools/tests/init-env.in b/gettext-tools/tests/init-env.in index 7c71d18..fa428f9 100644 --- a/gettext-tools/tests/init-env.in +++ b/gettext-tools/tests/init-env.in @@ -1,4 +1,4 @@ -# Variable needed by LIBTOOL and LTLIBINTL. +# Variable needed by LTLIBINTL. top_builddir=../.. OBJEXT="@OBJEXT@" @@ -9,7 +9,6 @@ CXX="@CXX@" CXXFLAGS="@CXXFLAGS@" CPPFLAGS="@CPPFLAGS@" LDFLAGS="@LDFLAGS@" -LIBTOOL="@LIBTOOL@" LTLIBINTL="@LTLIBINTL@" JAVA_CHOICE="@JAVA_CHOICE@" BUILDJAVA="@BUILDJAVA@" diff --git a/gettext-tools/tests/lang-c b/gettext-tools/tests/lang-c index 33935dc..3d7b332 100755 --- a/gettext-tools/tests/lang-c +++ b/gettext-tools/tests/lang-c @@ -42,9 +42,14 @@ 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}. -: ${LIBTOOL=/bin/sh ../../libtool} -${LIBTOOL} --quiet --tag=CC --mode=link ${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-c-prog prog.c ${LTLIBINTL} \ - || exit 1 +${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../intl ${CFLAGS} \ + ${CPPFLAGS} -c prog.c || exit 1 + +: ${CONFIG_SHELL=${SHELL-/bin/sh}} +${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \ + ${CC} -o l-c-prog prog.${OBJEXT} \ + ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \ + || exit 1 : ${XGETTEXT=xgettext} ${XGETTEXT} -o l-c-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 110c511..26e4506 100755 --- a/gettext-tools/tests/lang-c++ +++ b/gettext-tools/tests/lang-c++ @@ -66,9 +66,12 @@ ${CXX} -I../.. -I../../../gettext-runtime/libasprintf -I"$abs_top_srcdir"/gnulib # 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'. -: ${LIBTOOL=/bin/sh ../../libtool} -${LIBTOOL} --quiet --tag=CXX --mode=link --tag=CXX ${CXX} ${CXXFLAGS} `echo "X ${LDFLAGS} " | sed -e 's/^X//' -e 's/ -Wl,--disable-auto-import / /'` -o l-c++-prog l-c++-prog.${OBJEXT} ../../../gettext-runtime/libasprintf/libasprintf.la ../../gnulib-lib/libgettextlib.la ${LTLIBINTL} \ - || exit 1 +: ${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 l-c++-prog l-c++-prog.${OBJEXT} \ + ../../../gettext-runtime/libasprintf/libasprintf.la \ + ../../gnulib-lib/libgettextlib.la ${LTLIBINTL} \ + || exit 1 : ${XGETTEXT=xgettext} ${XGETTEXT} -o l-c++-prog.tmp --omit-header --no-location -k_ l-c++-prog.cc || exit 1 diff --git a/gettext-tools/tests/lang-objc b/gettext-tools/tests/lang-objc index b378d5d..c7766e4 100755 --- a/gettext-tools/tests/lang-objc +++ b/gettext-tools/tests/lang-objc @@ -57,9 +57,14 @@ 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}. -: ${LIBTOOL=/bin/sh ../../libtool} -${LIBTOOL} --quiet --tag=CC --mode=link ${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-objc-prog prog.m ${LTLIBINTL} \ - || exit 1 +${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../intl ${CFLAGS} \ + ${CPPFLAGS} -c prog.m || exit 1 + +: ${CONFIG_SHELL=${SHELL-/bin/sh}} +${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \ + ${CC} -o l-objc-prog prog.${OBJEXT} \ + ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \ + || exit 1 : ${XGETTEXT=xgettext} ${XGETTEXT} -o l-objc-prog.tmp --omit-header --no-location -k_ prog.m || exit 1 -- 1.8.4.2
