From: Ralf Wildenhues Date: Mon, 7 Sep 2009 19:08:50 +0000 (+0200) Subject: Fix and split recent testsuite addition for compile/link flags. X-Git-Tag: v2.2.7b~61 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=1e4e1984b07e4ce21f421b45854b846a93a12128;p=thirdparty%2Flibtool.git Fix and split recent testsuite addition for compile/link flags. * tests/flags.at (passing flags through libtool): Split into ... (passing CC flags through libtool) (passing CXX flags through libtool) (passing F77 flags through libtool) (passing FC flags through libtool) (passing GCJ flags through libtool): ... these five tests, factorized with m4_foreach. Fix F77 and FC compile and link commands; add GCJ tag. Use LT_AT_TAG to correctly skip tags for which no compiler exists. Use $EXEEXT where appropriate. Drop unneeded use of reload_cmds. Reports by Peter Rosin and Peter O'Gorman. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index cc43535b6..26afae704 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-09-07 Ralf Wildenhues + + Fix and split recent testsuite addition for compile/link flags. + * tests/flags.at (passing flags through libtool): Split into ... + (passing CC flags through libtool) + (passing CXX flags through libtool) + (passing F77 flags through libtool) + (passing FC flags through libtool) + (passing GCJ flags through libtool): ... these five tests, + factorized with m4_foreach. Fix F77 and FC compile and link + commands; add GCJ tag. Use LT_AT_TAG to correctly skip tags + for which no compiler exists. Use $EXEEXT where appropriate. + Drop unneeded use of reload_cmds. + Reports by Peter Rosin and Peter O'Gorman. + 2009-09-07 Peter O'Gorman &1 | grep 'unknown tag'; then - continue - fi - case $tag in - CC) compile="$CC $CPPFLAGS $CFLAGS" link="$CC $CFLAGS $LDFLAGS" source=a.c ;; - CXX) compile="$CXX $CPPFLAGS $CXXFLAGS" link="$CXX $CXXFLAGS $LDFLAGS" source=a.cpp;; - F77) compile="$CC $CPPFLAGS $CFLAGS" link="$CC $CFLAGS $LDFLAGS" source=a.f ;; - FC) compile="$CC $CPPFLAGS $CFLAGS" link="$CC $CFLAGS $LDFLAGS" source=a.f90 ;; - esac +eval "`$LIBTOOL --tag=lt_tag --config | $EGREP '^(wl|archive_cmds)='`" - eval "`$LIBTOOL --tag=$tag --config | $EGREP '^(wl|archive_cmds|reload_cmds)='`" +AT_CHECK([$LIBTOOL --tag=lt_tag --mode=compile $compile -c $source], + [], [ignore], [ignore]) - AT_CHECK([$LIBTOOL --tag=$tag --mode=compile $compile -c $source], - [], [ignore], [ignore]) +# Linker flags are prefixed with ${wl} iff they are passed to the +# compiler driver, instead of directly to the linker. +case $archive_cmds in +*\$LD*\$linker_flags*) maybe_wl= ;; +*) maybe_wl=$wl ;; +esac - # Linker flags are prefixed with ${wl} iff they are passed to the - # compiler driver, instead of directly to the linker. - case $archive_cmds in - *\$LD*\$linker_flags*) maybe_wl= ;; - *) maybe_wl=$wl ;; +for flag in -Wc, -Wl, '-Xcompiler ' '-Xlinker '; do + case $flag in + -Wc, | -Xcompiler\ ) + AT_CHECK([$LIBTOOL -n --tag=lt_tag --mode=compile $compile ]dnl + [$flag-foo -c $source], [], [stdout], [ignore]) + AT_CHECK([$FGREP " -foo" stdout], [], [ignore]) + flag_prefix= + ;; + -Wl, | -Xlinker\ ) + flag_prefix=$maybe_wl + ;; esac - for flag in -Wc, -Wl, '-Xcompiler ' '-Xlinker '; do - case $flag in - -Wc, | -Xcompiler\ ) - AT_CHECK([$LIBTOOL -n --tag=$tag --mode=compile $compile ]dnl - [$flag-foo -c $source], [], [stdout], [ignore]) - AT_CHECK([$FGREP " -foo" stdout], [], [ignore]) - flag_prefix= - ;; - -Wl, | -Xlinker\ ) - flag_prefix=$maybe_wl - ;; - esac - - eval set program "$library_and_module" - for output - do - AT_CHECK([$LIBTOOL -n --tag=$tag --mode=link $link ]dnl - [-o $output a.lo -rpath /nowhere $flag-foo], [], [stdout], [ignore]) - AT_CHECK([$FGREP " $flag_prefix-foo" stdout], [], [ignore]) - done + eval set program$EXEEXT "$library_and_module" + for output + do + AT_CHECK([$LIBTOOL -n --tag=lt_tag --mode=link $link ]dnl + [-o $output a.lo -rpath /nowhere $flag-foo], [], [stdout], [ignore]) + AT_CHECK([$FGREP " $flag_prefix-foo" stdout], [], [ignore]) done done AT_CLEANUP +])dnl m4_foreach(tag)