]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtoolize: aux scripts go in ltdl dir when parent has no configure.
authorGary V. Vaughan <gary@gnu.org>
Mon, 14 Nov 2011 04:54:22 +0000 (11:54 +0700)
committerGary V. Vaughan <gary@gnu.org>
Thu, 17 Nov 2011 10:51:15 +0000 (17:51 +0700)
When using libtoolize to install subproject libltdl into a
parent project that does not use autotools, set the default
directory for auxiliary scripts inside libltdl rather than
littering the parent project with files it doesn't use.
* libtoolize.m4sh (func_require_ac_aux_dir): In verbose mode,
report results like other require_ funcs.
(func_require_aux_dir): Put subproject auxiliary files into ltdl
directory where libltdl/configure will be able to find
`install-sh' and others.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
libtoolize.m4sh

index 3e663c37ae86d4776ebc0129fdcea72d4788167c..9a2726e4cf24bd44feaa0eaf7451759c57c81a36 100644 (file)
@@ -1365,7 +1365,7 @@ func_require_ac_aux_dir ()
 
     $require_configure_ac
 
-    if test -n "$configure_ac"; then
+    test -n "$configure_ac" && {
       func_extract_trace AC_CONFIG_AUX_DIR
       ac_aux_dir=$func_extract_trace_result
 
@@ -1375,7 +1375,9 @@ func_require_ac_aux_dir ()
 can not expand unknown variable in AC_CONFIG_AUX_DIR argument."
           ;;
       esac
-    fi
+    }
+
+    test -n "$ac_aux_dir" && func_verbose "ac_aux_dir='$ac_aux_dir'"
 
     require_ac_aux_dir=:
 }
@@ -1515,8 +1517,22 @@ func_require_aux_dir ()
 
     $require_ac_aux_dir
 
-    test -n "$aux_dir" || aux_dir=$ac_aux_dir
-    test -n "$aux_dir" || {
+    test -z "$aux_dir" && aux_dir=$ac_aux_dir
+
+    # Subproject ltdl without $configure_ac keeps pkgauxfiles in
+    # specified --ltdl optarg directory.
+    test -z "$aux_dir" && $opt_ltdl && {
+      $require_configure_ac
+
+      test -n "$configure_ac" || {
+        $require_ltdl_dir
+        $require_ltdl_mode
+
+        test subproject = "$ltdl_mode" && aux_dir="$ltdl_dir"
+      }
+    }
+
+    test -z "$aux_dir" && {
       # Try to intuit aux_dir using the same heuristic as Autoconf.
       for _G_dir in . .. ../..; do
         if test -f "$_G_dir/install-sh" || test -f "$_G_dir/install.sh"
@@ -1528,7 +1544,7 @@ func_require_aux_dir ()
     }
 
     # Use the current directory if all else fails.
-    test -n "$aux_dir" || aux_dir=.
+    test -z "$aux_dir" && aux_dir=.
 
     require_aux_dir=:
 }