libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/6] libtoolize: generate require_ltdl_relative_aux_dir definitio


From: Gary V. Vaughan
Subject: [PATCH 3/6] libtoolize: generate require_ltdl_relative_aux_dir definition.
Date: Mon, 14 Nov 2011 19:01:03 +0700

* libtoolize.m4sh (require_ltdl_relative_macro_dir): Change to
be generated function...
(require_ltdl_relative_aux_dir): ...so that we can easily
generate this very similar function from the same code.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 libtoolize.m4sh |   61 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 1e57afe..5023aad 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -1149,6 +1149,38 @@ func_autoconf_configure ()
 #
 # After that, the rest appear in asciibetical order.
 
+for base in aux_dir macro_dir; do
+
+  # require_ltdl_relative_aux_dir
+  # require_ltdl_relative_macro_dir
+  # -------------------------------
+  # Set ltdl_relative_aux_dir to the relative path from $ltdl_dir to
+  # the parent project auxiliary directory, and similarly for relative
+  # macro directory.
+  r=ltdl_relative_$base        # _r_esource acquired by calling this function
+  v=require_$r         # _v_ariable pointing to the function
+  f=func_$v            # _f_unction name
+  eval $v'='$f'
+  '$f' ()
+  {
+    $debug_cmd
+
+    $require_ltdl_dir
+    $require_'$base'
+
+    func_relative_path "$ltdl_dir" "$'$base'"
+    '$r'=$func_relative_path_result
+
+    test -n "$'$r'" && func_verbose "'$r'='\'\$$r\''"
+
+    '$v'=:
+  }'
+  # Some of these functions need to acquire the resource managed by the
+  # lexically preceding function; $o serves that purpose.
+  o=$r
+
+done
+
 for base in '' ltdl_; do
   if test ltdl_ = "$base"; then p='$pkgltdldir/'; else p=; fi
 
@@ -1158,9 +1190,9 @@ for base in '' ltdl_; do
   # If not already set, set Makefile_am to `Makefile.am' if that file is
   # present in the current directory, and similarly for
   # `$pkgltdldir/Makefile.am'.
-  r=${base}Makefile_am # _r_esource acquired by calling this function
-  v=require_$r         # _v_ariable pointing to the function
-  f=func_$v            # _f_unction name
+  r=${base}Makefile_am
+  v=require_$r
+  f=func_$v
   eval $v'='$f'
   '$f' ()
   {
@@ -1176,8 +1208,6 @@ for base in '' ltdl_; do
 
     '$v'=:
   }'
-  # Some of these functions need to acquire the resource managed by the
-  # lexically preceding function; $o serves that purpose.
   o=$r
 
 
@@ -1580,27 +1610,6 @@ func_require_ltdl_mode ()
 }
 
 
-# require_ltdl_relative_macro_dir
-# -------------------------------
-# Set ltdl_relative_macro_dir to the relative path from $ltdl_dir to
-# the parent project macro directory.
-require_ltdl_relative_macro_dir=func_require_ltdl_relative_macro_dir
-func_require_ltdl_relative_macro_dir ()
-{
-    $debug_cmd
-
-    $require_ltdl_dir
-    $require_macro_dir
-
-    func_relative_path "$ltdl_dir" "$macro_dir"
-    ltdl_relative_macro_dir=$func_relative_path_result
-
-    func_verbose "relative ltdl macro_dir='$ltdl_relative_macro_dir'"
-
-    require_ltdl_relative_macro_dir=:
-}
-
-
 # require_macro_dir
 # -----------------
 # If both are specified, ensure both ACLOCAL_AMFLAGS and
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]