From b884cf4b19fef60b7dac07b19b0a3a4d3cbd1c9e Mon Sep 17 00:00:00 2001 From: Gordon Matzigkeit Date: Thu, 5 Jun 1997 16:50:29 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 16 ++++++++++++++++ libtool.m4 | 13 ++++++++----- ltconfig.in | 9 ++++++++- ltmain.sh.in | 15 +++++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe42bc2d1..692c4c498 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Thu Jun 5 10:40:15 1997 Gordon Matzigkeit + + * ltconfig.in (allow_undefined_flag): New variable that implements + `-allow-undefined'. + + * ltmain.sh.in (link): Accept new `-allow-undefined' flag when + building libtool libraries. This tells libtool to allow + unresolved symbols to exist in shared libraries. Basically, this + turns off shared libraries on AIX. Suggested by Ian Lance Taylor. + +Mon May 26 08:24:55 1997 Gordon Matzigkeit + + * libtool.m4 (LD): On at least IRIX, many different flags need to + be propagated to the linker if they are part of the compiler + command line. Reported by Anthony Green. + Sat May 10 12:21:58 1997 Gordon Matzigkeit * ltconfig.in: Trivial port to FreeBSD 3. From David Nugent. diff --git a/libtool.m4 b/libtool.m4 index 9f47df63b..abe14a7d3 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -21,7 +21,7 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 5 AM_PROG_LIBTOOL +# serial 6 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) @@ -47,12 +47,15 @@ libtool_flags="$libtool_shared$libtool_static" test "$silent" = yes && libtool_flags="$libtool_flags --silent" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +# Some flags need to be propagated to the compiler or linker for good +# libtool support. [case "$host" in *-*-irix6*) - # For IRIX 6, ld needs -n32 if cc uses it. - if echo " $CC $CFLAGS " | egrep -e '[ ]-n32[ ]' > /dev/null; then - LD="${LD-ld} -n32" - fi + for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do + if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then + LD="${LD-ld} $f" + fi + done ;; *-*-sco3.2v5*) diff --git a/ltconfig.in b/ltconfig.in index 01d5b7fc1..4e3a4ab2b 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -514,6 +514,7 @@ echo $ac_t "$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking if $linker supports shared libraries... $ac_c" 1>&6 +allow_undefined_flag= archive_cmds= export_dynamic_flag= hardcode_libdir_flag_spec= @@ -555,6 +556,7 @@ else # PORTME fill in a description of your system's linker (not GNU ld) 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' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. @@ -562,6 +564,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' hardcode_direct=yes hardcode_minus_L=yes @@ -609,7 +612,8 @@ else ;; osf3* | osf4*) - archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs' + allow_undefined_flag=' -expect_unresolved' + archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; @@ -912,6 +916,9 @@ old_postinstall_cmds='$old_postinstall_cmds' archive_cmds='$archive_cmds' postinstall_cmds='$postinstall_cmds' +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag='$allow_undefined_flag' + # Commands used to finish a libtool library installation in a directory. finish_cmds='$finish_cmds' diff --git a/ltmain.sh.in b/ltmain.sh.in index de1a350ca..55b3ff0e6 100644 --- a/ltmain.sh.in +++ b/ltmain.sh.in @@ -279,6 +279,7 @@ if test -z "$show_help"; then # Go through the arguments, transforming them on the way. cc="$nonopt" args="$cc" + allow_undefined=no compile_command="$cc" finalize_command="$cc" compile_shlibpath= @@ -325,6 +326,8 @@ if test -z "$show_help"; then prevarg="$arg" case "$arg" in + -allow-undefined) allow_undefined=yes ;; + -export-dynamic) export_dynamic=yes compile_command="$compile_command $export_dynamic_flag" @@ -716,6 +719,17 @@ if test -z "$show_help"; then $run $mkdir $objdir || exit $? fi + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if "$allow_undefined_flag" = unsupported; then + echo "$progname: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + fi + else + # Clear the flag. + allow_undefined_flag= + fi + if test "$build_libtool_libs" = yes; then # Get the real and link names of the library. library_names=`eval echo \"$library_names_spec\"` @@ -1644,6 +1658,7 @@ a program from several object files. The following components of LINK-COMMAND are treated specially: + -allow-undefined allow a libtool library to reference undefined symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -- 2.47.2