From: Thomas Tanner Date: Wed, 24 Mar 1999 22:42:59 +0000 (+0000) Subject: * TODO: support -dlopen for libraries X-Git-Tag: release-1-3b~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64d868411f649edc61b0332b62d080fbb5be4bdc;p=thirdparty%2Flibtool.git * TODO: support -dlopen for libraries * doc/PLATFORMS: Erez Zadok reported that libtool works on bsdi 4.0.1 * doc/libtool.texi (libltdl): libltdl supports BeOS * libltdl/ltdl.c: shlib_ext was declared even if LTDL_SHLIB_EXT didn't exist, partially reverted my previous patch: BeOS will automatically search in ADDON_PATH * ltmain.in: don't allow relative run-paths, fixed a typo in a warning, ignore -dlopen self for libraries and objects, only accept -L paths that exist, minor cleanups, bugfix: add -lc for normal libraries, not convenicence libraries removed offensive warnings/comments --- diff --git a/ChangeLog b/ChangeLog index 7d2c01122..a0ef98ef1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +1999-03-24 Thomas Tanner + + * TODO: support -dlopen for libraries + * doc/PLATFORMS: Erez Zadok reported that libtool works on bsdi 4.0.1 + * doc/libtool.texi (libltdl): libltdl supports BeOS + * libltdl/ltdl.c: shlib_ext was declared even if LTDL_SHLIB_EXT + didn't exist, partially reverted my previous patch: BeOS will + automatically search in ADDON_PATH + * ltmain.in: don't allow relative run-paths, fixed a typo in a warning, + ignore -dlopen self for libraries and objects, + only accept -L paths that exist, minor cleanups, + bugfix: add -lc for normal libraries, not convenicence libraries + removed offensive warnings/comments + 1999-03-24 Alexandre Oliva * ltconfig.in (ld_shlibs, amigaos*): disable shared libraries diff --git a/TODO b/TODO index f4b855a35..eb9ff598f 100644 --- a/TODO +++ b/TODO @@ -30,6 +30,11 @@ In the future: possible would greatly improve libltdl's ability to be embedded in and used by other systems. +* Support -dlopen/dlpreopen for libraries. + This requires adding two new variables (dlopen/dlpreopen) to + the pseudo-library and later dlopening them when a program is linked + against such a library. + * Fix */demo on win32. This may simply require resolving the item below. diff --git a/doc/PLATFORMS b/doc/PLATFORMS index 2a417b82d..fbbc145ec 100644 --- a/doc/PLATFORMS +++ b/doc/PLATFORMS @@ -21,6 +21,7 @@ hppa1.1-hp-hpux9.07 cc 1.0f ok hppa1.1-hp-hpux9.05 gcc 1.2f ok hppa1.1-hp-hpux9.01 gcc 1.2f ok i*86-*-bsdi4.0 gcc 1.2f ok +i*86-*-bsdi4.0.1 gcc 1.2f ok i*86-*-bsdi3.1 gcc 1.2e NS i*86-*-bsdi3.0 gcc 1.2e NS i*86-*-bsdi2.1 gcc 1.2e NS diff --git a/doc/libtool.texi b/doc/libtool.texi index 708a3c2f9..5f6a95e2a 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -2599,6 +2599,8 @@ shl_load (HP-UX) @item LoadLibrary (Win16 and Win32) @item +load_add_on (BeOS) +@item GNU DLD (emulates dynamic linking for static libraries) @item libtool's dlpreopen (see @pxref{Dlpreopening}) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 221da1237..df93ce077 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -76,7 +76,9 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define LTDL_SYMBOL_OVERHEAD 5 static const char objdir[] = LTDL_OBJDIR; +#ifdef LTDL_SHLIB_EXT static const char shlib_ext[] = LTDL_SHLIB_EXT; +#endif static const char unknown_error[] = "unknown error"; static const char dlopen_not_supported_error[] = "dlopen support not available"; @@ -1205,12 +1207,6 @@ lt_dlopen (filename) file = (FILE*) find_file(basename, getenv("LTDL_LIBRARY_PATH"), &dir, 0); -#ifdef __BEOS__ - if (!file) - file = (FILE*) find_file(basename, - getenv("ADDON_PATH"), - &dir, 0); -#endif #ifdef LTDL_SHLIBPATH_VAR if (!file) file = (FILE*) find_file(basename, diff --git a/ltmain.in b/ltmain.in index 70e84d6b7..0d881ebdf 100644 --- a/ltmain.in +++ b/ltmain.in @@ -877,6 +877,7 @@ compiler." elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else + dlself=needless export_dynamic=yes fi prev= @@ -916,12 +917,8 @@ compiler." case "$arg" in /* | [A-Za-z]:[/\\]*) ;; *) - absdir=`cd "$arg" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 - fi - arg="$absdir" + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 ;; esac if test "$prev" = rpath; then @@ -998,6 +995,11 @@ compiler." -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + if test -d "$dir"; then : + else + $echo "$modename: directory \`$dir' does not exist" 1>&2 + exit 1 + fi # We need an absolute path. case "$dir" in /* | [A-Za-z]:[/\\]*) ;; @@ -1073,12 +1075,8 @@ compiler." case "$dir" in /* | [A-Za-z]:[/\\]*) ;; *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 - fi - dir="$absdir" + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 ;; esac case "$xrpath " in @@ -1282,7 +1280,7 @@ compiler." $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi @@ -1346,7 +1344,7 @@ compiler." exit 1 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 fi @@ -1553,16 +1551,12 @@ compiler." # Save some variables name_save=$name libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - old_deplibs="$deplibs" # Find libtool libraries and add their dependencies and directories + old_deplibs="$deplibs" deplibs= # libraries to link (used in archive_cmds) newdependency_libs= # all dependency libraries uninst_path= # paths that contain uninstalled libtool libraries - shlibpath= new_lib_search_path= for deplib in $old_deplibs; do lib= @@ -1610,6 +1604,13 @@ compiler." library_names= old_library= + # Check to see that this really is a libtool archive. + if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." # We need an absolute path. @@ -1625,13 +1626,6 @@ compiler." esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - # Check to see that this really is a libtool archive. - if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes @@ -1653,6 +1647,14 @@ compiler." exit 1 fi + if test -z "$libdir"; then + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$deplibs $dir/$old_library" + continue + fi + # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then @@ -1904,9 +1906,6 @@ compiler." fi # Restore the variables - versuffix=$versuffix_save - major=$major_save - release=$release_save libname=$libname_save name=$name_save @@ -2121,7 +2120,7 @@ EOF # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then - if test -z "$rpath"; then + if test -n "$rpath"; then case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! @@ -2244,7 +2243,6 @@ EOF if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linkopts="$linkopts $flag" fi @@ -2321,7 +2319,7 @@ EOF $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi @@ -2547,7 +2545,7 @@ EOF continue ;; -R*) - dir=`$echo "X$deplib" | $Xsed -e 's/^-lR/'` + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; @@ -2594,6 +2592,13 @@ EOF library_names= old_library= + # Check to see that this really is a libtool archive. + if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." # We need an absolute path. @@ -2609,13 +2614,6 @@ EOF esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - # Check to see that this really is a libtool archive. - if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes @@ -3211,7 +3209,6 @@ static const void *lt_preloaded_setup() { link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" - # AGH! Flame the AIX and HP-UX people for me, will ya? $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else @@ -3825,7 +3822,7 @@ relink_command=\"$relink_command\"" continue fi else - $echo "$modename: error: cannot relink \`$file' on behalf of your buggy system linker" 1>&2 + $echo "$modename: error: cannot relink \`$file'" 1>&2 continue fi fi @@ -3987,7 +3984,6 @@ relink_command=\"$relink_command\"" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else @@ -3996,7 +3992,7 @@ relink_command=\"$relink_command\"" fi file="$outputname" else - $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2 + $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier.