From: Christopher Pfisterer Date: Sun, 2 Sep 2001 22:18:21 +0000 (+0000) Subject: * libtool.m4, ltmain.in: Linker flag and version numbering fixes X-Git-Tag: release-1-4-1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2550e5a92a3e8d3d9afcebd3b9504bdb1bbe3718;p=thirdparty%2Flibtool.git * libtool.m4, ltmain.in: Linker flag and version numbering fixes for darwin. --- diff --git a/ChangeLog b/ChangeLog index fb1012f5e..5e2225461 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-09-02 Christopher Pfisterer + + * libtool.m4, ltmain.in: Linker flag and version numbering fixes + for darwin. + 2001-09-02 Gary V. Vaughan Backported the following patches from the development branch: @@ -142,7 +147,7 @@ * libtool.m4: undefine the m4 builtin `symbols', so that the string `symbols' can be used in the rest of the code without causing errors with autoconf-2.13. - + From "Golubev I. N." * tests/Makefile.am (CPPLAGS): Typo. s/CPPLAGS/CPPFLAGS. @@ -166,7 +171,7 @@ set to `lo' when testing for compiler output to *.lo filenames. 2001-06-28 Gary V. Vaughan - + From Alexander Bluhm * libltdl/ltdl.c (lt_dlopen): Fix bad memory initialisation assumptions. @@ -220,7 +225,7 @@ * libtool.m4: Support $host_os as /sysv5uw7*/ from newer config.guess in addition to older /unixware*/. Use compiler driver, not linker, for linking shared libraries. - + 2001-04-24 Gary V. Vaughan * libtool.m4, ltmain.in, libltdl/configure.in, @@ -257,7 +262,7 @@ * ltmain.in (argument parsing): support dl[pre]open for both .o and .lo files * ltmain.in (deplibs_check): use portable test syntax - * ltmain.in (help): document -prefer-[non-]pic flags + * ltmain.in (help): document -prefer-[non-]pic flags * ltmain.in: improve readablity by adding some comments, rename uninst_* to notinst_* (more adequate name) @@ -282,7 +287,7 @@ suite. * libltdl/ltdl.c (lt_dlexit): Quit loop if only resident modules are left. - + 2001-04-23 Gary V. Vaughan * doc/PLATFORMS: With this patch, my Solaris boxes now pass the @@ -341,7 +346,7 @@ * libtool.m4: Improve NetBSD support. * ltmain.in: ditto. - + 2001-04-19 Dan McNichol * libtool.m4: Build standard shared libraries on AIX POWER @@ -354,7 +359,7 @@ uses a SYSV type linker. Add a comment telling what to do if the TOC starts getting too large on AIX. * NEWS: mention aix5 support. - + 2001-04-18 Alexandre Oliva * TODO: Add -L- flag. @@ -425,7 +430,7 @@ * libltdl/ltdl.c (sys_shl_open): Return a NULL module handle for self opening. (sys_shl_close): Be careful not to close a NULL module handle. - (sys_shl_sym): Allow shl_findsym() to open NULL modules, but + (sys_shl_sym): Allow shl_findsym() to open NULL modules, but discard the modified module address it returns. * libltdl/ltdl.c (lt_dlopen): When reading the .la file, @@ -472,20 +477,20 @@ * libtoolize.in: Check configure.ac and prefer configure.ac to configure.in. - + * libtoolize.in: change recommendation from AM_PROG_LIBTOOL to AC_PROG_LIBTOOL. * libtool.m4: Generate dll/import libraries for cygwin according to the following: libFOO.a (static lib), libFOO.dll.a (import - lib), cygFOO-version.dll (dll). Update postinstall_cmds and + lib), cygFOO-version.dll (dll). Update postinstall_cmds and postuninstall_cmds to reflect this. - * ltmain.in: Generate installed .la files with dlnames set to + * ltmain.in: Generate installed .la files with dlnames set to ../bin/cygFOO-version.dll for normal dlls. dlls for modules remain with the .la file. * libltdl/ltdl.c: Use windows paths while calling LoadLibrary. - + 2001-03-16 Albert Chin * libtool.m4 (save_CPPFLAGS): Fix typo. @@ -509,11 +514,11 @@ From Tor Lillqvist * libtool.m4 (export_symbols): On Windows, if the export_symbols file (which has been passed to libtool with the -export-symbols - command line switch) already is a .def file, use it as is. + command line switch) already is a .def file, use it as is. * libtool.m4 (library_names_spec): Using m4 quotes correctly this time around! - + From Tor Lillqvist * libtool.m4 (library_names_spec): Use an appropriate filename prefix for dlls -- lib for mingw; cyg for cygwin; pw for pw32. diff --git a/libtool.m4 b/libtool.m4 index a5c1aa858..d8bf41ac7 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -360,7 +360,7 @@ fi # will find an echo command which doesn;t interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) + [AC_DIVERT_PUSH(NOTICE)]) _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # Check that we are running under the correct shell. @@ -626,15 +626,15 @@ else *) AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load", [AC_CHECK_LIB(dld, shl_load, - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_LIB(dl, dlopen, - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen", - [AC_CHECK_LIB(svld, dlopen, - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"]) - ]) - ]) - ]) + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_LIB(dl, dlopen, + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen", + [AC_CHECK_LIB(svld, dlopen, + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"]) + ]) + ]) + ]) ]) ;; esac @@ -796,7 +796,7 @@ AC_MSG_RESULT($objdir) ## FIXME: this should be a separate macro ## -AC_ARG_WITH(pic, +AC_ARG_WITH(pic, [ --with-pic try to use only PIC/non-PIC objects [default=use both]], pic_mode="$withval", pic_mode=default) test -z "$pic_mode" && pic_mode=default @@ -862,10 +862,10 @@ AC_CACHE_VAL(lt_cv_prog_cc_pic, lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; @@ -921,9 +921,9 @@ AC_CACHE_VAL(lt_cv_prog_cc_pic, lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' + lt_cv_prog_cc_wl='-LD' else - lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_wl='-Wl,' fi ;; @@ -1310,18 +1310,18 @@ EOF # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; + cp $export_symbols $output_objdir/$soname-def; else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \[$]# in + 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ @@ -1429,12 +1429,12 @@ else # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do + for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi - done + done esac exp_sym_flag='-bexport' @@ -1452,35 +1452,35 @@ else hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' + shared_flag='${wl}-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi fi fi @@ -1495,17 +1495,17 @@ else archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' + hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='${wl}-berok' + # This is a bit strange, but is similar to how AIX traditionally builds + # it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; @@ -1537,11 +1537,18 @@ else ;; darwin* | rhapsody*) - allow_undefined_flag='-undefined suppress' + case "$host_os" in + rhapsody* | darwin1.[[012]]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. - archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' + archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes @@ -1628,15 +1635,15 @@ else hardcode_shlibpath_var=no case "$host_os" in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' ;; *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - if test "`echo __ELF__ | $CC -E - | grep __ELF__`" = "" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - export_dynamic_flag_spec='${wl}-E' - fi + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + if test "`echo __ELF__ | $CC -E - | grep __ELF__`" = "" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + export_dynamic_flag_spec='${wl}-E' + fi ;; esac ;; @@ -1890,11 +1897,11 @@ aix4* | aix5*) case $host_os in [ aix4 | aix4.[01] | aix4.[01].*)] if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : else - can_build_shared=no + can_build_shared=no fi ;; esac @@ -2748,9 +2755,9 @@ EOF # return TRUE; # } # /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # diff --git a/ltmain.in b/ltmain.in index 9fde8ed1e..99eb57ad1 100644 --- a/ltmain.in +++ b/ltmain.in @@ -1040,18 +1040,18 @@ compiler." # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; - *-*-openbsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - esac - fi - if test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; + *-*-openbsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + esac + fi + if test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; esac fi deplibs="$deplibs $arg" @@ -1932,17 +1932,17 @@ compiler." echo "*** Therefore, libtool will create a static module, that should work " echo "*** as long as the dlopening application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes + build_libtool_libs=module + build_old_libs=yes else - build_libtool_libs=no + build_libtool_libs=no fi fi else @@ -2333,6 +2333,16 @@ compiler." if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring="" + ;; + *) + verstring="0.0" + ;; + esac if test "$need_version" = no; then versuffix= else @@ -2429,9 +2439,9 @@ compiler." *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd*) - # Do not include libc due to us having libc/libc_r. - ;; + *-*-openbsd*) + # Do not include libc due to us having libc/libc_r. + ;; *) # Add libc to deplibs on all other systems if necessary. if test $build_libtool_need_lc = "yes"; then @@ -3642,7 +3652,7 @@ else if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else - $echo \"\$relink_command_output\" >&2 + $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi @@ -4660,14 +4670,14 @@ relink_command=\"$relink_command\"" # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then - : + : elif test -d "$file"; then - exit_status=1 + exit_status=1 continue elif test "$rmforce" = yes; then - continue + continue fi rmfiles="$file"