]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS) <func_xform>:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 10 Apr 2008 21:01:54 +0000 (21:01 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 10 Apr 2008 21:01:54 +0000 (21:01 +0000)
New function.
* libltdl/config/ltmain.m4sh (func_mode_compile): Use it to
avoid two forks with XSI shells.
* tests/suffix.test: Also test a file with multiple dots.

ChangeLog
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4
tests/suffix.test

index d8bd60f5d81e9e0fa8b0c609a5e70de59f65730f..2ece81d94bc87df4b7d863e3eee5fb84f3d85bd9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-04-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS) <func_xform>:
+       New function.
+       * libltdl/config/ltmain.m4sh (func_mode_compile): Use it to
+       avoid two forks with XSI shells.
+       * tests/suffix.test: Also test a file with multiple dots.
+
 2008-04-10  Peter O'Gorman  <peter@pogma.com>
 
        * libltdl/config/ltmain.m4sh (func_win32_libid,
index 3f5fe63afcfb35c1fea861ea4aec3078bfb73096..905be9d9c903cd64aba31b210abf8f3e7c18edd8 100644 (file)
@@ -769,27 +769,16 @@ func_mode_compile ()
 
     # Recognize several different file suffixes.
     # If the user specifies -o file.o, it is replaced with file.lo
-    xform='[cCFSifmso]'
     case $libobj in
-    *.ada) xform=ada ;;
-    *.adb) xform=adb ;;
-    *.ads) xform=ads ;;
-    *.asm) xform=asm ;;
-    *.c++) xform=c++ ;;
-    *.cc) xform=cc ;;
-    *.ii) xform=ii ;;
-    *.class) xform=class ;;
-    *.cpp) xform=cpp ;;
-    *.cxx) xform=cxx ;;
-    *.[fF][09]?) xform='[fF][09].' ;;
-    *.for) xform=for ;;
-    *.java) xform=java ;;
-    *.obj) xform=obj ;;
-    *.sx) xform=sx ;;
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
     esac
 
-    libobj=`$ECHO "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
index 10846d1081f3dbb468f1f9c439b216e181c1812c..38b9569d77111dd52636019782bbadebdedf5b60 100644 (file)
@@ -7098,6 +7098,7 @@ m4_defun([_LT_PROG_XSI_SHELLFNS],
 [case $xsi_shell in
   yes)
     cat << \_LT_EOF >> "$cfgfile"
+
 # func_dirname file append nondir_replacement
 # Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 # otherwise set result to NONDIR_REPLACEMENT.
@@ -7165,10 +7166,18 @@ func_lo2o ()
     *)    func_lo2o_result=${1} ;;
   esac
 }
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
 _LT_EOF
     ;;
   *) # Bourne compatible functions.
     cat << \_LT_EOF >> "$cfgfile"
+
 # func_dirname file append nondir_replacement
 # Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 # otherwise set result to NONDIR_REPLACEMENT.
@@ -7245,6 +7254,12 @@ func_lo2o ()
 {
   func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
 }
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
 _LT_EOF
 esac
 
@@ -7269,6 +7284,7 @@ func_append ()
 {
   eval "$[1]=\$$[1]\$[2]"
 }
+
 _LT_EOF
     ;;
   esac
index 56f2902bf5426c3aab01fb2bafa8819aa94522d0..a03589700f50276aeb31f845365a9f3f212412a1 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # suffix.test - check that libtool knows how to transform source suffices.
 #
-#   Copyright (C) 2003, 2004, 2007  Free Software Foundation, Inc.
+#   Copyright (C) 2003, 2004, 2007, 2008  Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan, 2003
 #
 #   This file is part of GNU Libtool.
@@ -24,8 +24,8 @@
 ####
 
 # Extensions taken from the ones that Automake recognizes, plus Objective C,
-# and GNU Ada.
-extensions="C F S ada adb ads asm c c++ cc cpp cxx f f90 F90 f95 F95 f03 F03 for m s sx"
+# and GNU Ada.  Also test that multiple dots are handled correctly.
+extensions="C F S ada adb ads asm c c++ cc cpp cxx f f90 F90 f95 F95 f03 F03 for m s sx ada.ada"
 bad_names="foo."
 
 . tests/defs || exit 1