From 6c449c81c9182e43e738bb75a39cec42f4851660 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Fri, 15 Apr 2005 13:37:29 +0000 Subject: [PATCH] * m4/libtool.m4 (_LT_CC_BASENAME): New macro to figure out $cc_basename. Skip ccache, distcc, purify, cmdline options, `$host_alias-' prefix. (_LT_SETUP, _LT_LANG_CXX_CONFIG, _LT_LANG_F77_CONFIG, _LT_LANG_GCJ_CONFIG, _LT_LANG_RC_CONFIG): Use. * NEWS: Update. --- ChangeLog | 8 ++++++++ NEWS | 1 + m4/libtool.m4 | 29 +++++++++++++++++++---------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e95b6178..c1138a4e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-04-15 Ralf Wildenhues + + * m4/libtool.m4 (_LT_CC_BASENAME): New macro to figure out $cc_basename. + Skip ccache, distcc, purify, cmdline options, `$host_alias-' prefix. + (_LT_SETUP, _LT_LANG_CXX_CONFIG, _LT_LANG_F77_CONFIG, + _LT_LANG_GCJ_CONFIG, _LT_LANG_RC_CONFIG): Use. + * NEWS: Update. + 2005-04-14 Alexandre Oliva , Ralf Wildenhues diff --git a/NEWS b/NEWS index 3e3570f5e..3db63a19d 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ New in 1.9h: 2004-??-??; CVS version 1.9g, Libtool team: * Support (mostly) for DragonFly BSD. * 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. New in 1.9f: 2004-10-23; CVS version 1.9e, Libtool team: * Calculate dllsearchpath correctly for wrapper scripts on cygwin. diff --git a/m4/libtool.m4 b/m4/libtool.m4 index a46ba658a..9628abf16 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -90,6 +90,20 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_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_SETUP # --------- m4_defun([_LT_SETUP], @@ -192,8 +206,7 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o -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 test -z "$MAGIC_CMD" && MAGIC_CMD=file @@ -4680,8 +4693,7 @@ if test "$_lt_caught_CXX_error" != yes; then CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC - cc_basename=`$ECHO "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` + _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the @@ -5784,8 +5796,7 @@ if test "$_lt_caught_F77_error" != yes; then CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC - cc_basename=`$ECHO "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` + _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) @@ -5873,8 +5884,7 @@ lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_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_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5931,8 +5941,7 @@ lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -cc_basename=`$ECHO "X$compiler" \ - | $Xsed -e 's%.*/%%;s%^[ ]*\([^ ]*\).*$%\1%'` +_LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then -- 2.47.2