libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 4/4] libtoolize: massage installed auxiliary script list at make


From: Gary V. Vaughan
Subject: [PATCH 4/4] libtoolize: massage installed auxiliary script list at make time.
Date: Sun, 6 Nov 2011 00:09:50 +0700

* Makefile.am (configure_edit): Rename pkgconfig_files
substitution to pkgaux_files, and add pkgaux_install_files and
pkgaux_parent_files substitutions for atlocal.
(pkgauxdir): Where to install pkgaux_files.
(auxfiles): Removed, and replaced by...
(pkgaux_parent_files, pkgaux_install_files, pkgaux_data_files):
...these, which separate the files lists more logically for
easier installation, and use by libtoolize.m4sh.
(uninstall-hook): Adjust.
(tests/atlocal): Adjust.
* bootstrap.conf (libtool_link_libltdl_subdirs): Adjust.
* libtoolize.m4sh (func_install_pkgconfig_files)
(func_install_pkgconfig_subproject)
(func_install_pkgconfig_parent, func_install_pkgconfig_files)
(all_pkgconfig_files): Renamed to...
(func_install_pkgaux_files, unc_install_pkgaux_subproject)
(func_install_pkgaux_parent, func_install_pkgaux_files)
(all_pkgaux_files): ...these, resp. Adjust all callers.
(func_massage_pkgconfig_files): Removed.
(pkgaux_files): List of all auxiliary scripts substituted from
Makefile.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 Makefile.am     |   12 ++++++--
 configure.ac    |    3 +-
 libtoolize.m4sh |   85 +++++++++++++++++-------------------------------------
 3 files changed, 37 insertions(+), 63 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5cf4e36..1a94b0f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -278,7 +278,9 @@ configure_edit = $(SED) \
        -e 's,@host_triplet\@,$(host_triplet),g' \
        -e 's,@LN_S\@,$(LN_S),g' \
        -e 's,@macro_dir\@,$(macro_dir),g' \
-       -e "s,@pkgconfig_files\@,$(auxfiles),g" \
+       -e 's,@pkgaux_files\@,$(pkgaux_scripts) $(pkgaux_data_files),g' \
+       -e 's,@pkgaux_install_files\@,$(pkgaux_install_files),g' \
+       -e 's,@pkgaux_parent_files\@,$(pkgaux_parent_files),g' \
        -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
        -e 's,@pkgltdl_files\@,$(pkgltdl_files),g' \
        -e 's,@extra_pkgltdl_files\@,$(extra_pkgltdl_files),g' \
@@ -433,10 +435,13 @@ $(libtoolize_1): $(libtoolize_in)
 ## ------------- ##
 
 ltdldir                = $(srcdir)/libltdl
+pkgauxdir      = $(pkgdatadir)/build-aux
 
 # The timestamps on these files must be preserved carefully so we install,
 # uninstall and set executable with custom rules here.
-auxfiles       = $(pkgaux_scripts) config/ltmain.sh
+pkgaux_parent_files    = ltmain.sh
+pkgaux_install_files   = config.guess config.sub install-sh
+pkgaux_data_files      = $(pkgaux_parent_files)
 
 # Everything that gets picked up by aclocal is automatically distributed,
 # this is the list of macro files we install on the user's system.
@@ -577,7 +582,8 @@ dist-hook: $(changelog) $(dotversion) $(readme)
 
 uninstall-hook:
        @$(NORMAL_UNINSTALL)
-       @list='$(installed_pkgltdl_files) $(auxfiles)'; for f in $$list; do \
+       @list='$(installed_pkgltdl_files) $(pkgaux_scripts) 
$(pkgaux_data_files)'; \
+       for f in $$list; do \
          echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
          rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
        done
diff --git a/configure.ac b/configure.ac
index f3be952..881bf69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,8 +121,7 @@ fi
 # The list of scripts required to build libltdl, and which need to be
 # installed by libtoolize --ltdl, and consequently need to be placed in
 # $pkgdatadir by our make install rule.
-pkgaux_scripts="config/compile config/config.guess config/config.sub \
- config/depcomp config/install-sh config/missing"
+pkgaux_scripts="compile config.guess config.sub depcomp install-sh missing"
 AC_SUBST([pkgaux_scripts])
 
 # All subdirectories that are configured on demand, but that must be
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 0a446ca..cceb6e7 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -879,7 +879,7 @@ func_install_pkgmacro_files ()
 # func_install_pkgltdl_files
 # Install copies of the libltdl files into this package.  Any auxiliary
 # or m4 macro files needed in the libltdl tree will also be copied by
-# func_install_pkgconfig_files and func_install_pkgmacro_files resp.
+# func_install_pkgaux_files and func_install_pkgmacro_files resp.
 func_install_pkgltdl_files ()
 {
     $debug_cmd
@@ -926,40 +926,10 @@ func_install_pkgltdl_files ()
 }
 
 
-# func_massage_pkgconfig_files [glob_exclude]
-# @pkgconfig_files\@ is substituted as per its value in Makefile.am; this
-# function massages it into a suitable format for func_copy_some_files.
-func_massage_pkgconfig_files ()
-{
-    $debug_cmd
-
-    pkgconfig_files=   # GLOBAL VAR
-
-    my_glob_exclude="$1"
-
-    # Massage a value for pkgconfig_files from the value used in Makefile.am
-    for my_filename in @pkgconfig_files@; do
-
-      # ignore excluded filenames
-      if test -n "$my_glob_exclude"; then
-       my_cont=false
-       eval 'case $my_filename in '$my_glob_exclude') my_cont=: ;; esac'
-       $my_cont && continue
-      fi
-
-      # ignore duplicates
-      case " "$pkgconfig_files" " in
-        *" $my_filename "*) ;;
-       *) pkgconfig_files="${pkgconfig_files+$pkgconfig_files }$my_filename" ;;
-      esac
-    done
-}
-
-
-# func_install_pkgconfig_subproject
-# Unless --quiet was passed, display a message. Then copy pkgconfig_files
+# func_install_pkgaux_subproject
+# Unless --quiet was passed, display a message. Then copy pkgaux_files
 # from libtool installation tree to subproject libltdl tree.
-func_install_pkgconfig_subproject ()
+func_install_pkgaux_subproject ()
 {
     $debug_cmd
 
@@ -968,7 +938,7 @@ func_install_pkgconfig_subproject ()
 
     # Remove any lingering files that my have been installed by some
     # previous libtoolize release:
-    $opt_force && for file in $all_pkgconfig_files; do
+    $opt_force && for file in $all_pkgaux_files; do
       test -f "$subproject_aux_dir/$file" && func_verbose "rm -f 
'$subproject_aux_dir/$file'"
       rm -f "$subproject_aux_dir/$file"
     done
@@ -976,21 +946,21 @@ func_install_pkgconfig_subproject ()
     # Copy all the files from installed libltdl to this project, if the
     # user specified an aux_dir.
     $opt_quiet || if test "x$ac_aux_dir" = "x$subproject_aux_dir"; then
-      pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$subproject_aux_dir'."
+      pkgaux_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$subproject_aux_dir'."
     else
-      pkgconfig_header="putting auxiliary files in \`$aux_dir'."
+      pkgaux_header="putting auxiliary files in \`$aux_dir'."
     fi
 
-    func_copy_some_files "$pkgconfig_files" \
-      "$pkgdatadir" "$ltdl_dir" pkgconfig_header
+    func_copy_some_files "$pkgaux_files" \
+      "$pkgdatadir/config" "$ltdl_dir/config" pkgaux_header
 }
 
 
-# func_install_pkgconfig_parent
+# func_install_pkgaux_parent
 # Unless --quiet was passed, or AC_CONFIG_AUX_DIR was not seen, display a
 # message.  Then update appropriate auxiliary files if newer ones are
 # available from the libtool installation tree.
-func_install_pkgconfig_parent ()
+func_install_pkgaux_parent ()
 {
     $debug_cmd
 
@@ -999,35 +969,35 @@ func_install_pkgconfig_parent ()
 
     # Remove any lingering files that my have been installed by some
     # previous libtoolize release:
-    $opt_force && for file in $all_pkgconfig_files; do
+    $opt_force && for file in $all_pkgaux_files; do
       test -f "$aux_dir/$file" && func_verbose "rm -f '$aux_dir/$file'"
       rm -f "$aux_dir/$file"
     done
 
     if test -n "$ac_aux_dir"; then
-      pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$ac_aux_dir'."
+      pkgaux_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$ac_aux_dir'."
     else
-      pkgconfig_header="putting auxiliary files in \`$aux_dir'."
+      pkgaux_header="putting auxiliary files in \`$aux_dir'."
     fi
 
     if $opt_install; then
       func_config_update config.guess \
-        "$pkgdatadir/config" "$aux_dir" pkgconfig_header
+        "$pkgdatadir/config" "$aux_dir" pkgaux_header
       func_config_update config.sub \
-        "$pkgdatadir/config" "$aux_dir" pkgconfig_header
+        "$pkgdatadir/config" "$aux_dir" pkgaux_header
       func_install_update install-sh \
-        "$pkgdatadir/config" "$aux_dir" pkgconfig_header
+        "$pkgdatadir/config" "$aux_dir" pkgaux_header
     fi
     func_ltmain_update ltmain.sh \
-      "$pkgdatadir/config" "$aux_dir" pkgconfig_header
+      "$pkgdatadir/config" "$aux_dir" pkgaux_header
 }
 
 
-# func_install_pkgconfig_files
+# func_install_pkgaux_files
 # Install copies of the auxiliary files into this package according to
 # the whether libltdl is included as a subproject, and whether the parent
 # shares the AC_CONFIG_AUX_DIR setting.
-func_install_pkgconfig_files ()
+func_install_pkgaux_files ()
 {
     $debug_cmd
 
@@ -1035,26 +1005,24 @@ func_install_pkgconfig_files ()
     $require_configure_ac
     $require_ltdl_mode
 
-    func_massage_pkgconfig_files
-
   # 1. Parent shares aux_dir with subproject ltdl:
     if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" &&
        test "x$aux_dir" = "x$subproject_aux_dir"
     then
-      func_install_pkgconfig_subproject
+      func_install_pkgaux_subproject
 
   # 2. Parent has separate aux_dir to subproject ltdl:
     elif $opt_ltdl && test "x$ltdl_mode" = "xsubproject"
        # && test "x$aux_dir" != "x$subproject_aux_dir" is implied
     then
       if test -n "$configure_ac"; then
-       func_install_pkgconfig_parent
+       func_install_pkgaux_parent
       fi
-      func_install_pkgconfig_subproject
+      func_install_pkgaux_subproject
 
   # 3. Not subproject, but AC_CONFIG_AUX_DIR was used in parent:
     elif test -n "$ac_aux_dir" || test "x$aux_dir" = "x."; then
-      func_install_pkgconfig_parent
+      func_install_pkgaux_parent
 
   # 4. AC_CONFIG_AUX_DIR was not specified:
     else
@@ -1619,13 +1587,14 @@ func_require_seen_libtool ()
   # ensure a clean upgrade.
   # Do not remove config.guess nor config.sub, we don't install them
   # without --install, and the project may not be using Automake.
-  all_pkgconfig_files="ltmain.sh"
+  all_pkgaux_files="compile install-sh depcomp missing ltmain.sh 
snippet/_Noreturn.h snippet/arg-nonnull.h snippet/c++defs.h 
snippet/warn-on-use.h"
   all_pkgmacro_files="argz.m4 libtool.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 
ltversion.in ltversion.m4 lt~obsolete.m4"
   all_pkgltdl_files="COPYING.LIB Makefile Makefile.in Makefile.inc Makefile.am 
README acinclude.m4 aclocal.m4 argz_.h argz.c config.h.in config-h.in configure 
configure.ac configure.in libltdl/lt__alloc.h libltdl/lt__dirent.h 
libltdl/lt__glibc.h libltdl/lt__private.h libltdl/lt__strl.h 
libltdl/lt_dlloader.h libltdl/lt_error.h libltdl/lt_system.h libltdl/slist.h 
loaders/dld_link.c loaders/dlopen.c loaders/dyld.c loaders/load_add_on.c 
loaders/loadlibrary.c loaders/preopen.c loaders/shl_load.c lt__alloc.c 
lt__dirent.c lt__strl.c lt_dlloader.c lt_error.c ltdl.c ltdl.h slist.c"
 
   # Files installed by func_install_*, some files are missing from these
   # lists deliberately because their respective func_install has to handle
   # the missing filenames specially.
+  pkgaux_files="@pkgaux_files@"
   pkgltdl_files="@pkgltdl_files@"
   extra_pkgltdl_files="@extra_pkgltdl_files@"
   pkgmacro_files="@pkgmacro_files@"
@@ -1679,7 +1648,7 @@ func_require_seen_libtool ()
   $require_seen_ltdl
   $seen_ltdl && opt_ltdl=:
 
-  func_install_pkgconfig_files
+  func_install_pkgaux_files
   func_install_pkgmacro_files
   func_install_pkgltdl_files
 
-- 
1.7.7.2

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


reply via email to

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