From: Ralf Wildenhues Date: Fri, 15 Apr 2005 13:38:13 +0000 (+0000) Subject: * libtool.m4 (_LT_CC_BASENAME): New macro to figure out $cc_basename. X-Git-Tag: release-1-5-16~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7ec620f64add233ef41900a7b786b85089ef5d5;p=thirdparty%2Flibtool.git * libtool.m4 (_LT_CC_BASENAME): New macro to figure out $cc_basename. Skip ccache, distcc, purify, cmdline options, `$host_alias-' prefix. (AC_LIBTOOL_SETUP, AC_LIBTOOL_LANG_CXX_CONFIG, AC_LIBTOOL_LANG_F77_CONFIG, AC_LIBTOOL_LANG_GCJ_CONFIG, AC_LIBTOOL_LANG_RC_CONFIG, AC_LIBTOOL_PROG_LD_SHLIBS): Use. * NEWS: Update. --- diff --git a/ChangeLog b/ChangeLog index 651f717bc..bebcf7eea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-04-15 Ralf Wildenhues + + * libtool.m4 (_LT_CC_BASENAME): New macro to figure out $cc_basename. + Skip ccache, distcc, purify, cmdline options, `$host_alias-' prefix. + (AC_LIBTOOL_SETUP, AC_LIBTOOL_LANG_CXX_CONFIG, + AC_LIBTOOL_LANG_F77_CONFIG, AC_LIBTOOL_LANG_GCJ_CONFIG, + AC_LIBTOOL_LANG_RC_CONFIG, AC_LIBTOOL_PROG_LD_SHLIBS): Use. + * NEWS: Update. + 2005-04-12 Ralf Wildenhues * libtool.m4 (AC_LIBTOOL_SETUP, AC_LIBTOOL_CONFIG): Fix diff --git a/NEWS b/NEWS index e16b32607..52cab4008 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.5.15a: 2005-??-??; CVS version 1.5.15a, Libtool team: * Allow shell special characters like `$' in source file names, but not in object names, to enhance GCJ support. +* Detection of compiler wrappers like distcc/ccache and $host_alias prefix. * Bug Fixes. New in 1.5.14: 2005-02-12; CVS version 1.5.13a, Libtool team: diff --git a/libtool.m4 b/libtool.m4 index 16cd67b21..444f84295 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -185,8 +185,7 @@ if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -cc_basename=`$echo "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` +_LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in @@ -233,6 +232,20 @@ compiler=$CC ])# _LT_AC_SYS_COMPILER +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + ccache | *[[\\/]]ccache | distcc | *[[\\/]]distcc | purify | *[[\\/]]purify | \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable @@ -2670,8 +2683,7 @@ test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` +_LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately @@ -3736,8 +3748,7 @@ lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` +_LT_CC_BASENAME([$compiler]) AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) @@ -3817,8 +3828,7 @@ lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` +_LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no @@ -3874,8 +3884,7 @@ lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` +_LT_CC_BASENAME([$compiler]) _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) @@ -5151,8 +5160,7 @@ ifelse([$1],[CXX],[ # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. - cc_basename=`$echo "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` + _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time