diff --git a/ChangeLog b/ChangeLog index 92fce9de..4ced02d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,28 @@ +Fri Aug 1 10:06:55 1997 Gordon Matzigkeit + + * ltmain.sh.in (link): Add -dlopen and -dlpreopen support for + libtool objects. This means that dlopened modules no longer need + to be shared libraries. + + * ltconfig.in (pic_flag): GCC on Irix 6 always builds PIC. + Reported by Ian Lance Taylor. + + * libtool.m4 (LD): Always add `-n32' to the linker if we are using + GCC on Irix 6. Reported by Ian Lance Taylor. + +Wed Jul 30 13:11:09 1997 Gordon Matzigkeit + + * libtool.m4 (AM_PROG_LIBTOOL): Explicitly check enable_shared and + enable_static rather than just enableval. This allows + configure.in scripts to set their own defaults. Suggested by + Tommy Reilly. + Tue Jul 29 11:52:10 1997 Gordon Matzigkeit * ltmain.sh.in: Add NLS environment variable handling copied from ltconfig.in. Reported by Akim Demaille. + (link): If allow_undefined_flag is not supported, then turn on old + libraries. Reported by Akim Demaille. * demo/dlmain.c (main): Use dld_preloaded_symbol_count to display a message about the sortedness of the symbol table. diff --git a/NEWS b/NEWS index c6bf3315..ff36ae9f 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ New in 1.0b: flags. * New tests for a BSD-compatible `nm' program, required for dlopened modules. +* Allow configure.in to change the defaults for AM_PROG_LIBTOOL's + `--enable-{shared,static}' by setting `enable_{shared,static}=no'. New in 1.0: * Bug fixes. diff --git a/TODO b/TODO index 9f329949..ca576550 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,28 @@ +* Kenneth Albanowski suggests an `execute' mode, where the paths from +libtool libraries are extracted and put into shlibpath_var, then a +command is executed with the wrapped binary as argument. + + KA> And 'libtool --mode=execute java test Java/libJavaPisock.la + KA> libsock/libpisock.la' turns into: + + KA> LD_LIBRARY_PATH="libsock/.libs:Java/.libs" java test + +I think this is a good idea, but the nonobvious behaviour with libtool +library arguments should be enabled by a flag, such as -dlopen LIB. +Maybe -dlpreopen LIB should put these libraries in LD_PRELOAD. + +Use *db | *dbx as triggers for this mode. + +* 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 +used to configure it. + +We especially need this for C++ linking, for which libtool currently +does not handle static constructors properly, even on operating +systems that support them. ``Don't use static constructors'' is no +longer a satisfactory answer. + * Another form of convenience library, suggested by Alexandre Oliva, is to have undocumented utility libraries, where only the shared version is installed. @@ -13,11 +38,6 @@ probably static. * A better check to detect broken collect2 on AIX, once the bug is fixed in GCC. -* 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 -used to configure it. - * Need to finalize the documentation, and give a specification of `.la' files so that people can depend on their format. This also needs to be done so that DLD uses a public interface to libtool diff --git a/libtool.m4 b/libtool.m4 index 54b0225c..3bfc9d13 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 9 AM_PROG_LIBTOOL +# serial 10 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_RANLIB]) @@ -37,14 +37,24 @@ AC_SUBST(LIBTOOL) dnl Allow the --disable-shared flag to stop us from building shared libs. AC_ARG_ENABLE(shared, [ --enable-shared build shared libraries [default=yes]], -test "$enableval" = no && libtool_shared=" --disable-shared", -libtool_shared=) +[if test "$enableval" = no; then + enable_shared=no +else + enable_shared=yes +fi]) +libtool_shared= +test "$enable_shared" = no && libtool_shared=" --disable-shared" dnl Allow the --disable-static flag to stop us from building static libs. AC_ARG_ENABLE(static, [ --enable-static build static libraries [default=yes]], -test "$enableval" = no && libtool_static=" --disable-static", -libtool_static=) +[if test "$enableval" = no; then + enable_static=no +else + enable_static=yes +fi]) +libtool_static= +test "$enable_static" = no && libtool_static=" --disable-static" libtool_flags="$libtool_shared$libtool_static" test "$silent" = yes && libtool_flags="$libtool_flags --silent" @@ -55,11 +65,15 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # libtool support. [case "$host" in *-*-irix6*) + ac_save_CFLAGS="$CFLAGS" + # -n32 always needs to be added to the linker when using GCC. + test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32" 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 + CFLAGS="$ac_save_CFLAGS" ;; *-*-sco3.2v5*) diff --git a/ltconfig.in b/ltconfig.in index 62c1fabe..3149dcc2 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -398,11 +398,20 @@ link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then - pic_flag='-fPIC' profile_flag_pattern='-pg?' wl='-Wl,' link_static_flag='-static' no_builtin_flag=' -fno-builtin' + + case "$host_os" in + irix5* | irix6*) + # PIC is the default for these OSes. + pic_flag= + ;; + *) + pic_flag='-fPIC' + ;; + esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in diff --git a/ltmain.sh.in b/ltmain.sh.in index 1ce3b3f0..2b695ad4 100644 --- a/ltmain.sh.in +++ b/ltmain.sh.in @@ -348,7 +348,7 @@ if test -z "$show_help"; then case "$prev" in dlfiles|dlprefiles) case "$arg" in - *.la) ;; # We handle this case below. + *.la | *.lo) ;; # We handle these cases below. *) dlprefiles="$dlprefiles $arg" test "$prev" = dlfiles && dlfiles="$dlfiles $arg" @@ -444,7 +444,23 @@ if test -z "$show_help"; then *.lo) # A library object. - libobjs="$libobjs $arg" + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + if test "$build_libtool_libs" = yes; then + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles "`echo "$arg" | sed 's/\.lo$/\.o/'` + prev= + fi + libobjs="$libobjs $arg" ;; *.la) @@ -806,6 +822,7 @@ if test -z "$show_help"; then if test "$allow_undefined_flag" = unsupported; then echo "$progname: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no + build_old_libs=yes fi else # Clear the flag. @@ -964,7 +981,7 @@ if test -z "$show_help"; then if test "$export_dynamic" = yes && test -n "$global_symbol_pipe" && test -n "$NM"; then # Add our own program objects to the preloaded list. - dlprefiles=`echo "$objs$libobjs$dlprefiles " | sed -e 's/\.lo /.o/g' -e 's/ $//'` + dlprefiles=`echo "$objs$dlprefiles " | sed -e 's/\.lo /.o /g' -e 's/ $//'` # Discover the nlist of each of the dlfiles. dlsyms="$objdir/${output}S.c"