+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>
* 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.
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],
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
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
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])
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
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