]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Optimize compile script on MSYS.
authorPeter Rosin <peda@lysator.liu.se>
Mon, 16 Aug 2010 11:50:32 +0000 (13:50 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Mon, 16 Aug 2010 11:50:32 +0000 (13:50 +0200)
* lib/compile (func_file_conv): Add new argument 'lazy' which
takes an optional list of conversion types where the requested
conversion isn't needed.
(func_cl_wrapper): Take advantage of the above for cases where
MSYS is doing the conversion for us.
Suggested by Ralf Wildenhues.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
ChangeLog
lib/compile

index 0f90bd0ab6494bb2003caa35840637bf2061f6d4..9a054e272e674bbb5bedeffb9f1e0cb2a7a45e4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-16  Peter Rosin  <peda@lysator.liu.se>
+
+       Optimize compile script on MSYS.
+       * lib/compile (func_file_conv): Add new argument 'lazy' which
+       takes an optional list of conversion types where the requested
+       conversion isn't needed.
+       (func_cl_wrapper): Take advantage of the above for cases where
+       MSYS is doing the conversion for us.
+       Suggested by Ralf Wildenhues.
+
 2010-08-16  Peter Rosin  <peda@lysator.liu.se>
 
        Support more C++ file extensions for MSVC in the compile script.
index cd3b801cff43cd3e18d49906b0cb9a29536052c7..b6419cecf912d4d995a693489be510b7eaaa8ada 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand `-c -o'.
 
-scriptversion=2010-08-16.07; # UTC
+scriptversion=2010-08-16.11; # UTC
 
 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software
 # Foundation, Inc.
@@ -38,9 +38,11 @@ IFS=" ""     $nl"
 
 file_conv=
 
-# func_file_conv build_file
+# func_file_conv build_file lazy
 # Convert a $build file to $host form and store it in $file
-# Currently only supports Win32 hosts.
+# Currently only supports Win32 hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
 func_file_conv ()
 {
   file=$1
@@ -60,14 +62,16 @@ func_file_conv ()
            ;;
        esac
       fi
-      case $file_conv in
-       mingw)
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
          file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
          ;;
-       cygwin)
+       cygwin/*)
          file=`cygpath -m "$file" || echo "$file"`
          ;;
-       wine)
+       wine/*)
          file=`winepath -w "$file" || echo "$file"`
          ;;
       esac
@@ -104,7 +108,7 @@ func_cl_wrapper ()
          esac
          ;;
        -I*)
-         func_file_conv "${1#-I}"
+         func_file_conv "${1#-I}" mingw
          set x "$@" -I"$file"
          shift
          ;;
@@ -139,7 +143,7 @@ func_cl_wrapper ()
          shift
          ;;
        *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib)
-         func_file_conv "$1"
+         func_file_conv "$1" mingw
          set x "$@" "$file"
          shift
          ;;