]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* m4/libtool.m4 (_LT_CC_BASENAME): New macro to figure out $cc_basename.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 15 Apr 2005 13:37:29 +0000 (13:37 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 15 Apr 2005 13:37:29 +0000 (13:37 +0000)
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
NEWS
m4/libtool.m4

index 5e95b617830a9d25e6b08d7c064f27f459c09a83..c1138a4e3256abbd5161fd16c16b5cc10fcadea6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-04-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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  <aoliva@redhat.com>,
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
diff --git a/NEWS b/NEWS
index 3e3570f5ecbcfec96260d923d3fdb9eb14ba6244..3db63a19da4f6606a51abaadf1749e34be1ea75d 100644 (file)
--- 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.
 \f
 New in 1.9f: 2004-10-23; CVS version 1.9e, Libtool team:
 * Calculate dllsearchpath correctly for wrapper scripts on cygwin.
index a46ba658a322a23d2fe4ca7cbafdc8fa36fd94d0..9628abf1644da50cadc3556c9dcec084ae89d723 100644 (file)
@@ -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