From: Peter O'Gorman Date: Fri, 25 Feb 2005 14:14:20 +0000 (+0000) Subject: * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): The Portland group's X-Git-Tag: release-1-5-16~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9a791f7f2b6c20c9876e58d174e79760745d4d6;p=thirdparty%2Flibtool.git * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): The Portland group's compiler does not pass --whole-archive. Move gnu ld check for the flag to the top so it can be overridden. (AC_LIBTOOL_LANG_CXX_CONFIG): Unset whole_archive_flag_spec for the portland group's c++ compiler too. Reported by Jeff Squyres --- diff --git a/ChangeLog b/ChangeLog index b9968c441..108268f3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,11 @@ -2005-02-25 Gary V. Vaughan +2005-02-24 Peter O'Gorman - * Makefile.am (install-data-hook): Remove call to - local-install-files, which is no longer required. + * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): The Portland group's + compiler does not pass --whole-archive. Move gnu ld check for + the flag to the top so it can be overridden. + (AC_LIBTOOL_LANG_CXX_CONFIG): Unset whole_archive_flag_spec for + the portland group's c++ compiler too. + Reported by Jeff Squyres 2005-02-24 Gary V. Vaughan diff --git a/libtool.m4 b/libtool.m4 index 6cf99729f..f4d0d5a89 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -3178,6 +3178,7 @@ case $host_os in _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' ;; cxx) # Compaq C++ @@ -5137,7 +5138,8 @@ ifelse([$1],[CXX],[ # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= - + # Just being paranoid about ensuring that cc_basename is set. + cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time @@ -5156,7 +5158,28 @@ ifelse([$1],[CXX],[ if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' - + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) @@ -5266,8 +5289,12 @@ EOF linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= - case $CC,$host_cpu in + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= tmp_addflag=' -fpic' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -5277,14 +5304,7 @@ EOF tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac + if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ @@ -5308,16 +5328,11 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~ ;; esac - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld)