* 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.
This commit is contained in:
Ralf Wildenhues 2008-04-10 21:01:54 +00:00
parent 56a656a857
commit 3a417017ce
4 changed files with 34 additions and 21 deletions

View File

@ -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,

View 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 ;;
*)

16
libltdl/m4/libtool.m4 vendored
View 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

View File

@ -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