From 10189e82e571419ade5c7a2c8a9a7a28e97e9060 Mon Sep 17 00:00:00 2001 From: Gordon Matzigkeit Date: Sat, 12 Jul 1997 21:39:00 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 22 ++++ Makefile.am | 2 +- NEWS | 9 ++ TODO | 16 +++ configure.in | 3 +- demo/Makefile.am | 6 +- doc/libtool.texi | 29 ++++++ doc/platforms.texi | 2 +- libtool.m4 | 38 ++++++- libtool.spec | 2 +- ltconfig.in | 67 +++++++++++- ltmain.sh.in | 236 ++++++++++++++++++++++++++++--------------- tests/ChangeLog | 5 + tests/demo-exec.test | 10 +- tests/demo-inst.test | 13 +++ 15 files changed, 367 insertions(+), 93 deletions(-) diff --git a/ChangeLog b/ChangeLog index 373f482f..afcf774f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +Sat Jul 12 10:07:28 1997 Gordon Matzigkeit + + * demo/Makefile.am: Add helldl, made from dlmain.c, to demostrate + `-dlopen' usage. + + * demo/dlmain.c: New file to demonstrate preloaded modules. + + * ltmain.sh.in (link): Add `-dlopen' flag to preload dynamic + modules, even on static platforms. Use `$NM' and + `$global_symbol_cmd' to extract symbols from required files. + (dlname): Delete dlname mode entirely. It is rendered obsolete + because the `.la' file format is now a public interface. + + * ltconfig.in (NM): New variable for BSD-compatible nm program. + (global_symbol_cmd): Pipeline to extract global symbols from the + nm output. + + * ltmain.sh.in: The .la file header should depend on `ltmain.sh', + not `$PROGRAM'. + (link): Make sure $export_dynamic_flag is eval'ed before it is + used. + Fri Jul 11 19:33:02 1997 Gordon Matzigkeit * libtool.spec: New Red Hat Package Manager specification file in diff --git a/Makefile.am b/Makefile.am index 90af84aa..81641895 100644 --- a/Makefile.am +++ b/Makefile.am @@ -34,7 +34,7 @@ bin_SCRIPTS = libtool libtoolize libtool: ltconfig @echo 'WARNING: Warnings from ltconfig can be ignored. :-)' CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ - LD="$(LD)" LN_S="$(LN_S)" RANLIB="$(RANLIB)" \ + LD="$(LD)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \ $(srcdir)/ltconfig --srcdir=$(srcdir) $(pkgdatadir)/ltmain.sh libtoolize: libtoolize.in $(top_builddir)/config.status diff --git a/NEWS b/NEWS index 7754f7a9..151c1c29 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,14 @@ NEWS - list of user-visible changes between releases of GNU libtool. +New in 1.0a: +* Bug fixes. +* Full support for dynamically loaded modules, even on static-only + platforms, via a new `-dlopen' link flag. +* New tests for a BSD-compatible `nm' program, required for dlopened + modules. +* FIXME: Deleted `dlname' mode, now that the internal structure of `.la' + files is a public interface. + New in 1.0: * Bug fixes. * Better configuration test to find the system linker. The old test diff --git a/TODO b/TODO index 4c433c85..2239f42c 100644 --- a/TODO +++ b/TODO @@ -17,6 +17,22 @@ symbols to be included in a libtool archive. different major versions of the same .la to coexist. This also involves writing a better uninstall mode, so that nothing breaks. +Semantics: + +# Just link a library normally. +./libtool gcc -o testld testld.o libhello.la -lm + +# Again, link normally. +./libtool gcc -o testld -export-dynamic testld.o libhello.la -lm + +# This time, preload the symbols from the specified library (or +# object), as well as normal linking. +./libtool gcc -o testld -export-dynamic testld.o -dlopen libhello.la -lm +dlfiles="$dlfiles libhello.la" + +This defines an array called `dld_preloaded_symbols', that can be used +to lookup symbols already present in the running executable. + * Implement full multi-language support. Currently, this is only for C++, but there are beginnings of this in the manual (Other Languages). This includes writing libtool not to be so dependent on the compiler diff --git a/configure.in b/configure.in index 52f41c83..d6ab9607 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to create configure. AC_INIT(ltmain.sh.in) -AM_INIT_AUTOMAKE(libtool,1.0) +AM_INIT_AUTOMAKE(libtool,1.0a) pkgdatadir='${datadir}/libtool' AC_SUBST(pkgdatadir) @@ -11,6 +11,7 @@ dnl Use the specified CC, RANLIB, and LD while running ltconfig. AC_PROG_CC AC_PROG_RANLIB AM_PROG_LD +AM_PROG_NM AC_PROG_LN_S AC_OUTPUT([Makefile doc/Makefile tests/Makefile]) diff --git a/demo/Makefile.am b/demo/Makefile.am index c7d7a9ed..d6738420 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -13,7 +13,7 @@ libhello_la_LDFLAGS = -version-info 3:12:1 include_HEADERS = foo.h -bin_PROGRAMS = hell hell.static +bin_PROGRAMS = hell hell.static helldl # Build hell from main.c and libhello.la hell_SOURCES = main.c @@ -24,6 +24,10 @@ hell_static_SOURCES = main.c hell_static_LDADD = libhello.la hell_static_LDFLAGS = -static +# Create a version of hell that does its own dlopening. +helldl_SOURCES = dlmain.c +helldl_LDFLAGS = -dlopen libhello.la + TESTS = run.test # The following rules are only for the libtool demo and tests. diff --git a/doc/libtool.texi b/doc/libtool.texi index 149b905d..b26a076b 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -2425,6 +2425,10 @@ within @code{ltmain.sh}: The name of the system library archiver. @end defvar +@defvar CC +The name of the C compiler used to configure libtool. +@end defvar + @defvar LD The name of the linker that libtool should use internally for reloadable linking and possibly shared libraries. @@ -2436,6 +2440,17 @@ prevent mismatches between the configuration information in @code{libtool}, and how that information is used in @code{ltmain.sh}. @end defvar +@defvar NM +The name of a BSD-compatible @code{nm} program, which produces listings +of global symbols in one the following formats: + +@example +@var{address} C @var{global-variable-name} +@var{address} D @var{global-variable-name} +@var{address} T @var{global-function-name} +@end example +@end defvar + @defvar RANLIB Set to the name of the ranlib program, if any. @end defvar @@ -2473,6 +2488,20 @@ Commands to tell the dynamic linker how to find shared libraries in a specific directory. @end defvar +@defvar global_symbol_cmd +A pipeline that takes the output of @var{NM}, and produces a listing of +raw symbols followed by their C names. For example: + +@example +$ @kbd{$NM | $global_symbol_cmd} +@var{symbol1} @var{C-symbol1} +@var{symbol2} @var{C-symbol2} +@var{symbol3} @var{C-symbol3} +@dots{} +$ +@end example +@end defvar + @defvar hardcode_action Either @samp{immediate} or @samp{relink}, depending on whether shared library paths can be hardcoded into executables before they are installed, diff --git a/doc/platforms.texi b/doc/platforms.texi index 9505907b..bdae826d 100644 --- a/doc/platforms.texi +++ b/doc/platforms.texi @@ -15,7 +15,7 @@ i386-unknown-freebsd2.1.5 gcc 0.5 ok i386-unknown-gnu0.0 gcc 0.5 ok i386-unknown-netbsd1.2 gcc 0.9g ok i586-pc-linux-gnu1.3.20 gcc 1.0 ok -i586-pc-linux-gnu2.0.16 gcc 1.0 ok +i586-pc-linux-gnu2.0.16 gcc 1.0a ok mips-sgi-irix5.3 cc 0.8 ok mips-sgi-irix5.3 gcc 0.8 ok mips-sgi-irix6.2 cc -32 0.9 ok diff --git a/libtool.m4 b/libtool.m4 index f7d1d9b4..e449e9a7 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -24,9 +24,10 @@ # serial 9 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_RANLIB]) +AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AM_PROG_LD]) +AC_REQUIRE([AM_PROG_NM]) AC_REQUIRE([AC_PROG_LN_S]) # Always use our own libtool. @@ -69,7 +70,7 @@ esac] # Actually configure libtool. ac_aux_dir is where install-sh is found. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \ +LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ || AC_MSG_ERROR([libtool configure failed]) @@ -129,3 +130,36 @@ else ac_cv_prog_gnu_ld=no fi]) ]) + +# AM_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN(AM_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, +[case "$NM" in +/*) + ac_cv_path_NM="$NM" # Let the user override the test with a path. + ;; +*) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in /usr/ucb:$PATH:/bin; do + test -z "$ac_dir" && dir=. + if test -f $ac_dir/nm; then + # Check to see if the nm accepts a BSD-compat flag. + if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + else + ac_cv_path_NM="$ac_dir/nm" + fi + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm + ;; +esac]) +NM="$ac_cv_path_NM" +AC_MSG_RESULT([$NM]) +AC_SUBST(NM) +]) diff --git a/libtool.spec b/libtool.spec index 4ca76281..ab5e1c71 100644 --- a/libtool.spec +++ b/libtool.spec @@ -1,6 +1,6 @@ Summary: GNU libtool - shared library support for source packages Name: libtool -Version: 1.0 +Version: 1.1 Release: 1 Copyright: GPL Group: Development/Build diff --git a/ltconfig.in b/ltconfig.in index 37b367db..19b5ba3d 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -61,6 +61,7 @@ old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LD="$LD" old_LN_S="$LN_S" +old_NM="$NM" old_RANLIB="$RANLIB" test -z "$AR" && AR=ar @@ -607,7 +608,7 @@ else case "$host_os" in aix3*) allow_undefined_flag=unsupported - archive_cmds='/usr/ucb/nm$libobjs | egrep \" [BD] \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;$AR cru $lib $objdir/$soname' + archive_cmds='$NM$libobjs | $global_symbol_pipe | sed \"s/.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes @@ -615,7 +616,7 @@ else aix4*) allow_undefined_flag=unsupported - archive_cmds='/bin/nm -B$libobjs | egrep \" [BD] \" | sed \"s/^.* //\" > $lib.exp;$cc -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;$AR cru $lib $objdir/$soname' + archive_cmds='$NM$libobjs | $global_symbol_pipe | sed \"s/.* //\" > $lib.exp;$cc -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;$AR cru $lib $objdir/$soname' hardcode_direct=yes hardcode_minus_L=yes ;; @@ -708,6 +709,57 @@ else fi echo $ac_t "$ld_shlibs" 1>&6 +if test -z "$NM"; then + echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 + case "$NM" in + /*) ;; # Let the user override the test with a path. + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in /usr/ucb:$PATH:/bin; do + test -z "$ac_dir" && dir=. + if test -f $ac_dir/nm; then + # Check to see if the nm accepts a BSD-compat flag. + if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then + NM="$ac_dir/nm -B" + elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then + NM="$ac_dir/nm -p" + else + NM="$ac_dir/nm" + fi + break + fi + done + IFS="$ac_save_ifs" + test -z "$NM" && NM=nm + ;; + esac + echo "$ac_t$NM" 1>&6 +fi + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 +global_symbol_pipe= +# WARNING: these filters need to be compatible with GNU nm, so they should +# accept at least [BDT]. +case "$host_os" in +aix*) + global_symbol_pipe="sed '/^.* [BCDT] [^.]/!d; s/^.* [BCDT] \(.*\)$/\1 \1/'" + ;; + +# These platforms may need to strip leading underscores from C symbols. +linux-gnuoldld*) ;; + +linux*) + global_symbol_pipe="sed '/^.* [BCDT] /!d; s/^.* [BCDT] \(.*\)$/\1 \1/'" + ;; +esac + +if test -z "$global_symbol_pipe"; then + echo "$ac_t"no +else + echo "$ac_t"yes +fi + # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= @@ -925,7 +977,7 @@ cat < $ofile # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\ -# LD="$old_LD" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\ +# LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for @@ -947,12 +999,18 @@ host="$host" # The archiver. AR='$AR' +# The default C compiler. +CC='$CC' + # The linker used to build libraries. LD='$LD' # Whether we need hard or soft links. LN_S='$LN_S' +# A BSD-compatible nm program. +NM='$NM' + # How to create reloadable object files. reload_flag='$reload_flag' reload_cmds='$reload_cmds' @@ -997,6 +1055,9 @@ allow_undefined_flag='$allow_undefined_flag' # Commands used to finish a libtool library installation in a directory. finish_cmds='$finish_cmds' +# Take the output of nm and produce a listing of raw symbols and C names +global_symbol_pipe="$global_symbol_pipe" + # How to strip a library file. striplib='$striplib' old_striplib='$old_striplib' diff --git a/ltmain.sh.in b/ltmain.sh.in index e4382047..27b24333 100644 --- a/ltmain.sh.in +++ b/ltmain.sh.in @@ -158,9 +158,6 @@ if test -z "$show_help"; then *rm) mode=uninstall ;; - *.la) - mode=dlname - ;; *) # Just use the default operation mode. if test -z "$mode"; then @@ -295,6 +292,7 @@ if test -z "$show_help"; then compile_shlibpath= finalize_shlibpath= deplibs= + dlfiles= export_dynamic=no hardcode_libdirs= install_libdir= @@ -333,10 +331,22 @@ if test -z "$show_help"; then ;; esac - eval "$prev=\$arg" - prev= - - continue + case "$prev" in + dlopen) + if test -z "$dlfiles"; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$compile_command @SYMFILE@" + fi + dlfiles="$dlfiles $arg" + prev= + ;; + *) + eval "$prev=\$arg" + prev= + continue + ;; + esac fi args="$args $arg" @@ -345,10 +355,15 @@ if test -z "$show_help"; then case "$arg" in -allow-undefined) allow_undefined=yes ;; + -dlopen) + prev=dlopen + continue + ;; + -export-dynamic) export_dynamic=yes - compile_command="$compile_command $export_dynamic_flag" - finalize_command="$finalize_command $export_dynamic_flag" + compile_command="$compile_command "`eval echo "$export_dynamic_flag"` + finalize_command="$finalize_command "`eval echo "$export_dynamic_flag"` continue ;; @@ -421,7 +436,7 @@ if test -z "$show_help"; then old_library= # Check to see that this really is a libtool archive. - if egrep "^# Generated by $PROGRAM" $arg >/dev/null 2>&1; then : + if egrep "^# Generated by ltmain.sh" $arg >/dev/null 2>&1; then : else echo "$progname: \`$arg' is not a valid libtool archive" 1>&2 exit 1 @@ -621,6 +636,13 @@ if test -z "$show_help"; then exit 1 fi + if test -n "$dlfiles"; then + echo "$progname: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2 + # Nullify the symbol file. + compile_command=`echo "$compile_command" | sed "s%@SYMFILE@%%"` + finalize_command=`echo "$finalize_command" | sed "s%@SYMFILE@%%"` + fi + if test -z "$install_libdir"; then echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2 exit 1 @@ -794,6 +816,13 @@ if test -z "$show_help"; then echo "$progname: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2 fi + if test -n "$dlfiles"; then + echo "$progname: warning: \`-dlopen' is ignored while creating objects" 1>&2 + # Nullify the symbol file. + compile_command=`echo "$compile_command" | sed "s%@SYMFILE@%%"` + finalize_command=`echo "$finalize_command" | sed "s%@SYMFILE@%%"` + fi + if test -n "$install_libdir"; then echo "$progname: warning: \`-rpath' is ignored while creating objects" 1>&2 fi @@ -878,6 +907,116 @@ if test -z "$show_help"; then # Transform all the library objects into standard objects. compile_command=`echo "$compile_command " | sed 's/\.lo /.o /g; s/ $//'` finalize_command=`echo "$finalize_command " | sed 's/\.lo /.o /g; s/ $//'` + dlfiles=`echo "$dlfiles " | sed 's/\.lo /.o /g; s/ $//'` + fi + + if test -n "$dlfiles"; then + if test -z "$global_symbol_pipe" || test -z "$NM"; then + echo "$progname: not configured to extract global symbols from \`-dlopen' files" 1>&2 + exit 1 + fi + + # Discover the nlist of each of the dlfiles. + dlsyms="$objdir/${output}S.c" + nlist="$objdir/${output}.syms" + + $run rm -f $nlist + for arg in $dlfiles; do + pre_dlname= + case "$arg" in + *.a | *.o) pre_dlname="$arg" ;; + *.la) + # We already checked for libtool archive validity above. + + # Find the directory that the archive lives in. + ltlib=`echo "$arg" | sed 's%^.*/%%'` + dir=`echo "$arg" | sed 's%/[^/]*$%%'` + test "X$dir" = "X$arg" && dir=. + + # Read the libtool archive. + old_library= + library_names= + . $dir/$ltlib + + # Prefer the new library to the old one. + if test -n "$library_names"; then + set dummy $library_names + pre_dlname="$2" + else + pre_dlname="$old_library" + fi + + if test -f "$dir/$objdir/$pre_dlname"; then + pre_dlname="$dir/$objdir/$pre_dlname" + elif test -f "$dir/$pre_dlname"; then + pre_dlname="$dir/$pre_dlname" + else + echo "$progname: cannot find \`$pre_dlname' in \`$dir/$objdir' or \`$dir'" 1>&2 + pre_dlname= + fi + ;; + esac + + if test -z "$pre_dlname"; then + echo "$progname: \`$arg' is not a dlopenable file" 1>&2 + exit 1 + fi + + echo "extracting global symbols from \`$pre_dlname'" + $run eval "$NM $pre_dlname | $global_symbol_pipe >> $nlist" + done + + # Parse the name list into a C file. + echo "creating $dlsyms" + if test -z "$run"; then + cat < $dlsyms +/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */ + +/* External symbol declarations for the compiler. */ +EOF + if test -f "$nlist"; then + # Prevent the only kind of circular reference mistake we can make. + sed '/ dld_preloaded_symbols$/d; s/^.* \(.*\)$/extern char \1;/' < $nlist >> $dlsyms + else + echo "/* NONE */" >> $dlsyms + fi + + cat <<\EOF >> $dlsyms + +#if defined (__STDC__) && __STDC__ +# define __ptr_t void * +#else +# define __ptr_t char * +#endif + +/* The mapping between symbol names and symbols. */ +struct { + char *name; + __ptr_t address; +} +dld_preloaded_symbols[] = +{ +EOF + + if test -f "$nlist"; then + sed 's/^\(.*\) \(.*\)$/ {"\1", \&\1},/' < $nlist >> $dlsyms + fi + + cat <<\EOF >> $dlsyms + {0}, +}; +EOF + fi + $run rm -f "$nlist" + + # Now compile the dynamic symbol file. + $show "(cd $objdir && $CC -c ${output}S.c)" + $run eval "(cd $objdir && $CC -c ${output}S.c)" || exit $? + + # Transform the symbol file into the correct name. + compile_command=`echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"` + finalize_command=`echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"` fi if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then @@ -973,7 +1112,7 @@ if test -z "$show_help"; then #! /bin/sh # $output - temporary wrapper script for $objdir/$output -# Generated by $PROGRAM - GNU $PACKAGE $VERSION +# Generated by ltmain.sh - GNU $PACKAGE $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -1087,7 +1226,7 @@ EOF if test -z "$run"; then cat > $output </dev/null 2>&1; then : + if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then : else echo "$progname: \`$file' is not a valid libtool archive" 1>&2 echo "$help" 1>&2 @@ -1385,7 +1524,7 @@ EOF *) # Do a test to see if this is really a libtool program. - if egrep "^# Generated by $PROGRAM" $file >/dev/null 2>&1; then + if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" @@ -1499,58 +1638,6 @@ EOF exit 0 ;; - # libtool dlname mode - dlname) - progname="$progname: dlname" - ltlibs="$nonopt" - for lib - do - ltlibs="$ltlibs $lib" - done - - if test -z "$ltlibs"; then - echo "$progname: you must specify at least one LTLIBRARY" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - # Now check to make sure each one is a valid libtool library. - status=0 - for lib in $ltlibs; do - dlname= - libdir= - library_names= - - # Check to see that this really is a libtool archive. - if egrep "^# Generated by $PROGRAM" $arg >/dev/null 2>&1; then : - else - echo "$progname: \`$arg' is not a valid libtool archive" 1>&2 - status=1 - continue - fi - - # If there is no directory component, then add one. - case "$arg" in - */*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$libdir"; then - echo "$progname: \`$arg' contains no -rpath information" 1>&2 - status=1 - elif test -n "$dlname"; then - echo "$libdir/$dlname" - elif test -z "$library_names"; then - echo "$progname: \`$arg' is not a shared library" 1>&2 - status=1 - else - echo "$progname: \`$arg' was not linked with \`-export-dynamic'" 1>&2 - status=1 - fi - done - exit $status - ;; - # libtool finish mode finish) progname="$progname: finish" @@ -1613,7 +1700,7 @@ EOF case "$name" in *.la) # Possibly a libtool archive, so verify it. - if egrep "^# Generated by $PROGRAM" $file >/dev/null 2>&1; then + if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. @@ -1671,7 +1758,6 @@ Provide generalized library-building support services. MODE must be one of the following: compile compile a source file into a libtool object - dlname print filenames to use to \`dlopen' libtool libraries finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable @@ -1697,19 +1783,6 @@ library object suffix, \`.lo'. EOF ;; -dlname) - cat < + + * demo-exec.test, demo-inst.test: Check the new helldl program, + too. + Fri Jul 11 19:31:43 1997 Gordon Matzigkeit * nomode.test: New test to make sure there is correct behaviour diff --git a/tests/demo-exec.test b/tests/demo-exec.test index 841e149d..286e8c5c 100755 --- a/tests/demo-exec.test +++ b/tests/demo-exec.test @@ -21,13 +21,19 @@ echo "Executing uninstalled programs in ../demo" if ../demo/hell.static | grep 'Welcome to GNU Hell'; then : else - echo "$0: cannot execute ./hell.static" 1>&2 + echo "$0: cannot execute ../demo/hell.static" 1>&2 exit 1 fi if ../demo/hell | grep 'Welcome to GNU Hell'; then : else - echo "$0: cannot execute ./hell" 1>&2 + echo "$0: cannot execute ../demo/hell" 1>&2 + exit 1 +fi + +if ../demo/helldl | grep 'Welcome to GNU Hell'; then : +else + echo "$0: cannot execute ../demo/helldl" 1>&2 exit 1 fi diff --git a/tests/demo-inst.test b/tests/demo-inst.test index ac2309d8..57e05517 100755 --- a/tests/demo-inst.test +++ b/tests/demo-inst.test @@ -42,4 +42,17 @@ else fi status=1 fi + +if $prefix/bin/helldl | grep 'Welcome to GNU Hell'; then : +else + echo "$0: cannot execute $prefix/bin/helldl" 1>&2 + + # Simple check to see if they are superuser. + if test -w /; then : + else + echo "You may need to run $0 as the superuser." + fi + status=1 +fi + exit $status