From: Ralf Wildenhues Date: Thu, 10 Apr 2008 21:01:54 +0000 (+0000) Subject: * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS) : X-Git-Tag: v2.2.4~33 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a417017ce89dd17503a9445fbd6caf33a220ef2;p=thirdparty%2Flibtool.git * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS) : 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. --- diff --git a/ChangeLog b/ChangeLog index d8bd60f5d..2ece81d94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-04-10 Ralf Wildenhues + + * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS) : + 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 * libltdl/config/ltmain.m4sh (func_win32_libid, diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 3f5fe63af..905be9d9c 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -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 ;; *) diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 10846d108..38b9569d7 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -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 diff --git a/tests/suffix.test b/tests/suffix.test index 56f2902bf..a03589700 100755 --- a/tests/suffix.test +++ b/tests/suffix.test @@ -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