]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* config/ltmain.m4sh (func_source): New function.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 12 Aug 2005 21:06:13 +0000 (21:06 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 12 Aug 2005 21:06:13 +0000 (21:06 +0000)
(func_mode_execute, func_mode_install, func_mode_link): Use it.
Do not append a dot to a file name to source, it breaks on
cygwin managed mounts and is not necessary anywhere.
Reported by Eric Blake <ebb9@byu.net>.

ChangeLog
config/ltmain.m4sh

index e4fa38a312c0234ccaf02c5d1d04cac31c368bc2..bd0c76fcf6e4a0ac9fe629202b8cad0c959b31f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-08-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * config/ltmain.m4sh (func_source): New function.
+       (func_mode_execute, func_mode_install, func_mode_link): Use it.
+       Do not append a dot to a file name to source, it breaks on
+       cygwin managed mounts and is not necessary anywhere.
+       Reported by Eric Blake <ebb9@byu.net>.
+
        * config/ltmain.m4sh (func_execute_cmds): New function.
        (func_mode_finish, func_mode_install, func_mode_link)
        (func_mode_uninstall): Use it.
index 1dd73b109a03afb36c5c7a0f3f6475c189eac56a..59a994964159733440c2cd7bac1f6aee188f15bb 100644 (file)
@@ -643,6 +643,22 @@ func_execute_cmds ()
 }
 
 
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)        . "$1" ;;
+    *)         . "./$1" ;;
+    esac
+}
+
+
 # Generated shell functions inserted here.
 
 
@@ -1502,12 +1518,7 @@ func_mode_execute ()
        # Read the libtool library.
        dlname=
        library_names=
-
-       # If there is no directory component, then add one.
-       case $file in
-       */* | *\\*) . $file ;;
-       *) . ./$file ;;
-       esac
+       func_source "$file"
 
        # Skip this library if it cannot be dlopened.
        if test -z "$dlname"; then
@@ -1564,11 +1575,7 @@ func_mode_execute ()
       *)
        # Do a test to see if this is really a libtool program.
        if func_ltwrapper_p "$file"; then
-         # If there is no directory component, then add one.
-         case $file in
-         */* | *\\*) . $file ;;
-         *) . ./$file ;;
-         esac
+         func_source "$file"
 
          # Transform arg to wrapped name.
          file="$progdir/$program"
@@ -1831,11 +1838,7 @@ func_mode_install ()
        library_names=
        old_library=
        relink_command=
-       # If there is no directory component, then add one.
-       case $file in
-       */* | *\\*) . $file ;;
-       *) . ./$file ;;
-       esac
+       func_source "$file"
 
        # Add the libdir to current_libdirs if it is the destination.
        if test "X$destdir" = "X$libdir"; then
@@ -2007,18 +2010,7 @@ func_mode_install ()
          notinst_deplibs=
          relink_command=
 
-         # To insure that "foo" is sourced, and not "foo.exe",
-         # finese the cygwin/MSYS system by explicitly sourcing "foo."
-         # which disallows the automatic-append-.exe behavior.
-         case $build in
-         *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-         *) wrapperdot=${wrapper} ;;
-         esac
-         # If there is no directory component, then add one.
-         case $file in
-         */* | *\\*) . ${wrapperdot} ;;
-         *) . ./${wrapperdot} ;;
-         esac
+         func_source "$wrapper"
 
          # Check the variables that should have been set.
          test -z "$generated_by_libtool_version" && \
@@ -2029,11 +2021,7 @@ func_mode_install ()
            # Check to see that each library is installed.
            libdir=
            if test -f "$lib"; then
-             # If there is no directory component, then add one.
-             case $lib in
-             */* | *\\*) . $lib ;;
-             *) . ./$lib ;;
-             esac
+             func_source "$lib"
            fi
            libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
            if test -n "$libdir" && test ! -f "$libfile"; then
@@ -2043,18 +2031,7 @@ func_mode_install ()
          done
 
          relink_command=
-         # To insure that "foo" is sourced, and not "foo.exe",
-         # finese the cygwin/MSYS system by explicitly sourcing "foo."
-         # which disallows the automatic-append-.exe behavior.
-         case $build in
-         *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-         *) wrapperdot=${wrapper} ;;
-         esac
-         # If there is no directory component, then add one.
-         case $file in
-         */* | *\\*) . ${wrapperdot} ;;
-         *) . ./${wrapperdot} ;;
-         esac
+         func_source "$wrapper"
 
          outputname=
          if test "$fast_install" = no && test -n "$relink_command"; then
@@ -2359,11 +2336,7 @@ func_mode_link ()
                non_pic_object=
 
                # Read the .lo file
-               # If there is no directory component, then add one.
-               case $arg in
-               */* | *\\*) . $arg ;;
-               *) . ./$arg ;;
-               esac
+               func_source "$arg"
 
                if test -z "$pic_object" ||
                   test -z "$non_pic_object" ||
@@ -2868,11 +2841,7 @@ func_mode_link ()
          non_pic_object=
 
          # Read the .lo file
-         # If there is no directory component, then add one.
-         case $arg in
-         */* | *\\*) . $arg ;;
-         *) . ./$arg ;;
-         esac
+         func_source "$arg"
 
          if test -z "$pic_object" ||
             test -z "$non_pic_object" ||
@@ -3119,8 +3088,7 @@ func_mode_link ()
          # Ignore non-libtool-libs
          dependency_libs=
          case $lib in
-         *[[\\/]]*.la) . $lib   ;;
-         *.la)       . ./$lib ;;
+         *.la) func_source "$lib" ;;
          esac
 
          # Collect preopened libtool deplibs, except any this library
@@ -3200,10 +3168,7 @@ func_mode_link ()
                if func_lalib_p "$lib"; then
                  library_names=
                  old_library=
-                 case $lib in
-                 */* | *\\*) . $lib ;;
-                 *) . ./$lib ;;
-                 esac
+                 func_source "$lib"
                  for l in $old_library $library_names; do
                    ll="$l"
                  done
@@ -3390,10 +3355,7 @@ func_mode_link ()
 
 
        # Read the .la file
-       case $lib in
-       */* | *\\*) . $lib ;;
-       *) . ./$lib ;;
-       esac
+       func_source "$lib"
 
        case $host in
        *-*-darwin*)