From: Ossama Othman Date: Tue, 1 Feb 2000 05:42:00 +0000 (+0000) Subject: * configure.in (CONF_SUBDIRS): Added the `tagdemo' directory to X-Git-Tag: multi-language-merge-point~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8267110e98c1fee7fb458e3843cfa9126bf584c2;p=thirdparty%2Flibtool.git * configure.in (CONF_SUBDIRS): Added the `tagdemo' directory to the list. * ltcf-cxx.sh: Remove any residual `a.out' files resulting from the "eval $output_verbose_link_cmds." * ltconfig.in: Cleaned up nested quotes that were introduced with the tags patch. This fixes part sh.test failure. * ltmain.in: Check if "$run" is of zero length before creating a `.lo' file. This fixes the dryrun.test failure. Cleaned up nested quotes that were introduced with the tags patch. This fixes another part sh.test failure. Remove "$libobj" not "libobj." Exit with an error if both $object_name and $old_object are set to "none" in the corresponding `.lo' file. This should never happen. Changed remaining uses of "mkdir" to "$mkdir." Added dry run case to `.lo' case in link mode. This fixes the link-2.test failure. (object_name, old_object): Prepend the subdirectory the `.lo' resides in to the object names extracted from the `.lo' file. This fixes the build-relink2.test failure. (tempemovelist): Use $echo "X..." instead of echo "..." since $Xsed is being used. This fixes the last part of the sh.test failure. * tagdemo/Makefile.am, tagdemo/Makefile.in, tagdemo/README, tagdemo/acinclude.m4, tagdemo/aclocal.m4, tagdemo/configure, tagdemo/configure.in, tagdemo/foo.cpp, tagdemo/foo.h, tagdemo/main.cpp, tests/tagdemo-conf.test tests/tagdemo-exec.test tests/tagdemo-make.test tests/tagdemo-shared.test tests/tagdemo-static.test: Added a new tagdemo that exercises libtool's tagged configuration support found in the multilanguage branch. * tests/Makefile.am (TESTS): Added the tagdemo tests to the list. * tests/quote.test: Updated to HEAD branch version. This fixes the quote.test failure. --- diff --git a/ChangeLog b/ChangeLog index 284edded8..12ceb1275 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2000-01-31 Ossama Othman + + * configure.in (CONF_SUBDIRS): Added the `tagdemo' directory to + the list. + * ltcf-cxx.sh: Remove any residual `a.out' files resulting from + the "eval $output_verbose_link_cmds." + * ltconfig.in: Cleaned up nested quotes that were introduced with + the tags patch. This fixes part sh.test failure. + * ltmain.in: Check if "$run" is of zero length before creating a + `.lo' file. This fixes the dryrun.test failure. + Cleaned up nested quotes that were introduced with + the tags patch. This fixes another part sh.test failure. + Remove "$libobj" not "libobj." + Exit with an error if both $object_name and $old_object are set to + "none" in the corresponding `.lo' file. This should never happen. + Changed remaining uses of "mkdir" to "$mkdir." + Added dry run case to `.lo' case in link mode. This fixes the + link-2.test failure. + (object_name, old_object): Prepend the subdirectory the `.lo' + resides in to the object names extracted from the `.lo' file. + This fixes the build-relink2.test failure. + (tempemovelist): Use $echo "X..." instead of echo "..." since + $Xsed is being used. This fixes the last part of the sh.test + failure. + * tagdemo/Makefile.am, tagdemo/Makefile.in, tagdemo/README, + tagdemo/acinclude.m4, tagdemo/aclocal.m4, tagdemo/configure, + tagdemo/configure.in, tagdemo/foo.cpp, tagdemo/foo.h, + tagdemo/main.cpp, tests/tagdemo-conf.test tests/tagdemo-exec.test + tests/tagdemo-make.test tests/tagdemo-shared.test + tests/tagdemo-static.test: Added a new tagdemo that exercises + libtool's tagged configuration support found in the multilanguage + branch. + * tests/Makefile.am (TESTS): Added the tagdemo tests to the list. + * tests/quote.test: Updated to HEAD branch version. This fixes + the quote.test failure. + 2000-01-31 Ossama Othman * ltconfig.in (compile_c_lo): Removed the test that checks if diff --git a/configure.in b/configure.in index 9acfdd5d6..c3f674f0a 100644 --- a/configure.in +++ b/configure.in @@ -63,7 +63,7 @@ AC_CONFIG_SUBDIRS(libltdl) dnl all subdirectories that are configured on demand, but that must be dnl included in the distribution -CONF_SUBDIRS="cdemo demo depdemo mdemo" +CONF_SUBDIRS="cdemo demo depdemo mdemo tagdemo" AC_SUBST(CONF_SUBDIRS) ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4 ${srcdir}/libltdl/acinclude.m4 " diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh index d3dd7c676..7d8a5c35f 100644 --- a/ltcf-cxx.sh +++ b/ltcf-cxx.sh @@ -505,6 +505,9 @@ if eval $ac_compile 2>&5; then *) ;; # Ignore the rest. esac done + + # Clean up. + rm -f a.out else echo "ltcf-cxx.sh: error: problem compiling test program" fi diff --git a/ltconfig.in b/ltconfig.in index 0672736f7..f52ca639b 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -428,7 +428,7 @@ if test -n "$tagname"; then fi if test -z "$LTCC"; then - eval "`\"$SHELL\" \"$ofile\" --config | grep '^LTCC='`" + eval "`$SHELL $ofile --config | grep '^LTCC='`" if test -z "$LTCC"; then echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2 else diff --git a/ltmain.in b/ltmain.in index 458e03081..003aab2fd 100644 --- a/ltmain.in +++ b/ltmain.in @@ -138,7 +138,7 @@ do if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. - eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < \"$0\"`" + eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" else echo "$progname: ignoring unknown tag $tagname" 1>&2 fi @@ -520,10 +520,11 @@ compiler." eval srcfile=\"$fix_srcfile_path\" fi - $run $rm "libobj" + $run $rm "$libobj" - # Create a libtool object file (analogous to a `.la' file) - cat > $libobj < $libobj <> $libobj <> $libobj <> $libobj <> $libobj <> $libobj <> $libobj <> $libobj <> $libobj <&2 exit 1 fi + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + if test "$object_name" != none; then + # Prepend the subdirectory the object is found in. + object_name="$xdir$object_name" + if test "$prev" = dlfiles; then dlfiles="$dlfiles $object_name" if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then @@ -1213,12 +1228,33 @@ EOF # Non-PIC object. if test "$old_object" != none; then + # Prepend the subdirectory the object is found in. + old_object="$xdir$old_object" + # A standard non-PIC object old_objects="$old_objects $old_object" fi else - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + object_name=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + old_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $object_name" + old_objects="$old_objects $old_object" + fi fi ;; @@ -2306,9 +2342,11 @@ EOF # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= - tempremovelist=`echo $output_objdir/* | $Xsed -e "s/.*\.$objext//"` + tempremovelist=`echo "$output_objdir/*"` for p in $tempremovelist; do case "$p" in + *.$objext) + ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) removelist="$removelist $p" ;; @@ -2701,8 +2739,8 @@ EOF gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status @@ -2720,8 +2758,8 @@ EOF $show "${rm}r $xdir" $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status @@ -2840,8 +2878,8 @@ EOF gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status @@ -2859,8 +2897,8 @@ EOF $show "${rm}r $xdir" $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status @@ -3585,8 +3623,8 @@ fi\ gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status @@ -3605,8 +3643,8 @@ fi\ $show "${rm}r $xdir" $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status diff --git a/tests/Makefile.am b/tests/Makefile.am index 83f4a13d9..208ec7fff 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,7 +30,10 @@ TESTS = cdemo-static.test cdemo-make.test cdemo-exec.test \ mdemo-shared.test mdemo-make.test mdemo-exec.test \ mdemo-inst.test mdemo-unst.test \ assign.test link.test link-2.test nomode.test \ - quote.test sh.test suffix.test + quote.test sh.test suffix.test \ + tagdemo-static.test tagdemo-make.test tagdemo-exec.test \ + tagdemo-conf.test tagdemo-make.test tagdemo-exec.test \ + tagdemo-shared.test tagdemo-make.test tagdemo-exec.test demo-conf.test: $(top_builddir)/libtool @@ -56,4 +59,5 @@ clean-local: -test -f ../demo/Makefile && cd ../demo && $(MAKE) distclean -test -f ../depdemo/Makefile && cd ../depdemo && $(MAKE) distclean -test -f ../mdemo/Makefile && cd ../mdemo && $(MAKE) distclean + -test -f ../tagdemo/Makefile && cd ../mdemo && $(MAKE) distclean rm -rf _inst diff --git a/tests/quote.test b/tests/quote.test index f671f82b7..f71ecda03 100755 --- a/tests/quote.test +++ b/tests/quote.test @@ -63,18 +63,21 @@ for mode in compile link install; do case "$mode" in compile) preargs="gcc -c" + preflag= flag="-DVAR=" postargs="foo.c" ;; link) preargs="gcc -o hell -g -O" - flag="-Wl,-someflag=" + preflag=-Wl, + flag="-someflag=" postargs="foo.o" ;; install) preargs="install -c" + preflag= flag="--something=" postargs="hell /usr/local/bin/hell" ;; @@ -82,9 +85,9 @@ for mode in compile link install; do # Trivial. $echo "= trying: no quoting" - result=`$libtool -n --mode=$mode $preargs "${flag}test" $postargs` || status=1 + result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}test" $postargs` || status=1 case "$result" in - *"$preargs ${flag}test "*) + *"$preargs ${preflag}${flag}test "*) $echo "= passed: $result" ;; *) @@ -96,9 +99,9 @@ for mode in compile link install; do # Metacharacters that should be backslashified. for mchar in \\ \" \` \$; do $echo "= trying: \\$mchar quoting" - result=`$libtool -n --mode=$mode $preargs "${flag}${mchar}test${mchar}" $postargs` || status=1 + result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1 case "$result" in - *"$preargs ${flag}\\${mchar}test\\${mchar} "*) + *"$preargs ${preflag}${flag}\\${mchar}test\\${mchar} "*) $echo "= passed: $result" ;; *) @@ -113,9 +116,9 @@ for mode in compile link install; do "'" " " " "; do $echo "= trying: \"$mchar\" quoting" - result=`$libtool -n --mode=$mode $preargs "${flag}${mchar}test${mchar}" $postargs` || status=1 + result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1 case "$result" in - *"$preargs \"${flag}${mchar}test${mchar}\" "*) + *"$preargs ${preflag}\"${flag}${mchar}test${mchar}\" "*) $echo "= passed: $result" ;; *) diff --git a/tests/tagdemo-conf.test b/tests/tagdemo-conf.test new file mode 100755 index 000000000..3f7135f13 --- /dev/null +++ b/tests/tagdemo-conf.test @@ -0,0 +1,35 @@ +#! /bin/sh +# tagdemo-conf.test - try configuring the ../tagdemo subdirectory + +# Test script header. +need_prefix=yes +if test -z "$srcdir"; then + srcdir=`echo "$0" | sed 's%/[^/]*$%%'` + test "$srcdir" = "$0" && srcdir=. + test "${VERBOSE+set}" != "set" && VERBOSE=yes +fi +. $srcdir/defs || exit 1 + +# Maybe we have a VPATH build, in which case, create a new subdir. +test -d ../tagdemo || mkdir ../tagdemo + +# Change to our build directory. +cd ../tagdemo || exit 1 + +# Possibly clean up the distribution. +if test -f Makefile; then + echo "= Running $make distclean in ../tagdemo" + $make distclean +fi +rm -f config.cache + +# Configure the demonstration. +echo "= Configuring in ../tagdemo (prefix=$prefix)" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../tagdemo/configure --srcdir=$srcdir/../tagdemo --prefix=$prefix || exit 1 + +if egrep '^build_old_libs=yes' libtool > /dev/null && + egrep '^build_libtool_libs=yes' libtool > /dev/null; then : +else rm -f Makefile && exit 77 +fi + +exit 0 diff --git a/tests/tagdemo-exec.test b/tests/tagdemo-exec.test new file mode 100755 index 000000000..21db056df --- /dev/null +++ b/tests/tagdemo-exec.test @@ -0,0 +1,28 @@ +#! /bin/sh +# tagdemo-exec.test - check that programs in the ../tagdemo subdirectory are viable + +# Test script header. +need_prefix=no +if test -z "$srcdir"; then + srcdir=`echo "$0" | sed 's%/[^/]*$%%'` + test "$srcdir" = "$0" && srcdir=. + test "${VERBOSE+set}" != "set" && VERBOSE=yes +fi +. $srcdir/defs || exit 1 + +if test -f ../tagdemo/tagdemo; then : +else + echo "You must run tagdemo-make.test before running $0" 1>&2 + exit 77 +fi + +# Check to see if the programs really run. +echo "Executing uninstalled programs in ../tagdemo" + +if ../tagdemo/tagdemo; then : +else + echo "$0: cannot execute ../tagdemo/tagdemo" 1>&2 + status=1 +fi + +exit $status diff --git a/tests/tagdemo-make.test b/tests/tagdemo-make.test new file mode 100755 index 000000000..5cf0d87e6 --- /dev/null +++ b/tests/tagdemo-make.test @@ -0,0 +1,25 @@ +#! /bin/sh +# tagdemo-make.test - try building in the ../tagdemo subdirectory + +# Test script header. +need_prefix=no +if test -z "$srcdir"; then + srcdir=`echo "$0" | sed 's%/[^/]*$%%'` + test "$srcdir" = "$0" && srcdir=. + test "${VERBOSE+set}" != "set" && VERBOSE=yes +fi +. $srcdir/defs || exit 1 + +if test -f ../tagdemo/Makefile; then : +else + echo "You must run tagdemo-conf.test before running $0" 1>&2 + exit 77 +fi + +# Change to our build directory. +cd ../tagdemo || exit 1 + +# Do the actual build. +echo "Making in ../tagdemo" +$make || exit 1 +exit 0 diff --git a/tests/tagdemo-shared.test b/tests/tagdemo-shared.test new file mode 100755 index 000000000..0a738a633 --- /dev/null +++ b/tests/tagdemo-shared.test @@ -0,0 +1,35 @@ +#! /bin/sh +# tagdemo-conf.test - try configuring the ../tagdemo subdirectory + +# Test script header. +need_prefix=yes +if test -z "$srcdir"; then + srcdir=`echo "$0" | sed 's%/[^/]*$%%'` + test "$srcdir" = "$0" && srcdir=. + test "${VERBOSE+set}" != "set" && VERBOSE=yes +fi +. $srcdir/defs || exit 1 + +# Maybe we have a VPATH build, in which case, create a new subdir. +test -d ../tagdemo || mkdir ../tagdemo + +# Change to our build directory. +cd ../tagdemo || exit 1 + +# Possibly clean up the distribution. +if test -f Makefile; then + echo "= Running $make distclean in ../tagdemo" + $make distclean +fi +rm -f config.cache + +# Configure the demonstration. +echo "= Configuring in ../tagdemo (prefix=$prefix) with --disable-static" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../tagdemo/configure --srcdir=$srcdir/../tagdemo --prefix=$prefix --disable-static || exit 1 + +if egrep '^build_old_libs=no' libtool > /dev/null && + egrep '^build_libtool_libs=yes' libtool > /dev/null; then : +else rm -f Makefile && exit 77 +fi + +exit 0 diff --git a/tests/tagdemo-static.test b/tests/tagdemo-static.test new file mode 100755 index 000000000..13b03c34f --- /dev/null +++ b/tests/tagdemo-static.test @@ -0,0 +1,35 @@ +#! /bin/sh +# tagdemo-conf.test - try configuring the ../tagdemo subdirectory + +# Test script header. +need_prefix=yes +if test -z "$srcdir"; then + srcdir=`echo "$0" | sed 's%/[^/]*$%%'` + test "$srcdir" = "$0" && srcdir=. + test "${VERBOSE+set}" != "set" && VERBOSE=yes +fi +. $srcdir/defs || exit 1 + +# Maybe we have a VPATH build, in which case, create a new subdir. +test -d ../tagdemo || mkdir ../tagdemo + +# Change to our build directory. +cd ../tagdemo || exit 1 + +# Possibly clean up the distribution. +if test -f Makefile; then + echo "= Running $make distclean in ../tagdemo" + $make distclean +fi +rm -f config.cache + +# Configure the demonstration. +echo "= Configuring in ../tagdemo (prefix=$prefix) with --disable-shared" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../tagdemo/configure --srcdir=$srcdir/../tagdemo --prefix=$prefix --disable-shared || exit 1 + +if egrep '^build_old_libs=yes' libtool > /dev/null && + egrep '^build_libtool_libs=no' libtool > /dev/null; then : +else rm -f Makefile && exit 77 +fi + +exit 0