From: Gary V. Vaughan Date: Fri, 28 Oct 2011 09:46:52 +0000 (+0700) Subject: libtoolize: massage installed macro list at make time. X-Git-Tag: v2.4.2.418~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcbf77525dc93c3072245bd9db568391eea52caf;p=thirdparty%2Flibtool.git libtoolize: massage installed macro list at make time. * libtoolize.m4sh (func_massage_aclocal_DATA): Removed function and only caller, because... (pkgmacro_files): ...we substitute the pre-massaged files directly... (func_install_pkgmacro_files): ...from here. * Makefile.am (pkgmacro_files): New pre-massaged list of aclocal macros used by func_install_pkgmacro_files. (configure_edit): Substitute pkgmacro_files instead of aclocalfiles. Signed-off-by: Gary V. Vaughan --- diff --git a/Makefile.am b/Makefile.am index 5e57bfe49..34e6bd7e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -273,7 +273,6 @@ all-local: $(LTDL_BOOTSTRAP_DEPS) ## ---------------- ## configure_edit = $(SED) \ - -e 's,@aclocal_DATA\@,$(aclocalfiles),g' \ -e 's,@aclocaldir\@,$(aclocaldir),g' \ -e 's,@aux_dir\@,$(aux_dir),g' \ -e 's,@datadir\@,$(datadir),g' \ @@ -286,6 +285,7 @@ configure_edit = $(SED) \ -e "s,@pkgconfig_files\@,$(auxfiles),g" \ -e 's,@pkgdatadir\@,$(pkgdatadir),g' \ -e "s,@pkgltdl_files\@,$(ltdldatafiles),g" \ + -e 's,@pkgmacro_files\@,$(pkgmacro_files),g' \ -e 's,@prefix\@,$(prefix),g' \ -e 's,@SED\@,$(SED),g' \ -e 's,@srcdir\@,$(srcdir),g' @@ -443,8 +443,8 @@ auxfiles = $(pkgaux_scripts) config/ltmain.sh # Everything that gets picked up by aclocal is automatically distributed, # this is the list of macro files we install on the user's system. -aclocalfiles = m4/argz.m4 m4/libtool.m4 m4/ltdl.m4 m4/ltoptions.m4 \ - m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 +pkgmacro_files = argz.m4 libtool.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 \ + ltversion.m4 lt~obsolete.m4 ## These are installed as a subdirectory of pkgdatadir so that ## libtoolize --ltdl can find them later: @@ -474,12 +474,11 @@ install-data-local: $(lt_Makefile_in) ## Don't install over the top of an old pkgdatadir -rm -rf '$(DESTDIR)$(pkgdatadir)'/* ## First, put a copy of the libtool m4 macros in the aclocal dir - @list='$(aclocalfiles)'; for p in $$list; do \ - f=`echo "$$p" |'$(SED)' 's|^.*/||'`; \ - d=`echo "$(DESTDIR)$(aclocaldir)/$$f" |$(SED) 's,[^/]*$$,,'`; \ + @list='$(pkgmacro_files)'; for p in $$list; do \ + d=`echo "$(DESTDIR)$(aclocaldir)/$$p" |$(SED) 's,[^/]*$$,,'`; \ test -d "$$d" || $(mkinstalldirs) "$$d"; \ - echo " $(INSTALL_DATA) '$(srcdir)/$(macro_dir)/$$f' '$(DESTDIR)$(aclocaldir)/$$f'"; \ - $(INSTALL_DATA) "$(srcdir)/$(macro_dir)/$$f" "$(DESTDIR)$(aclocaldir)/$$f"; \ + echo " $(INSTALL_DATA) '$(srcdir)/$(macro_dir)/$$p' '$(DESTDIR)$(aclocaldir)/$$p'"; \ + $(INSTALL_DATA) "$(srcdir)/$(macro_dir)/$$p" "$(DESTDIR)$(aclocaldir)/$$p"; \ done ## install the helper scripts @list='config/extract-trace config/options-parser $(pkgaux_scripts)' && \ @@ -561,7 +560,7 @@ uninstall-hook: echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ done - @for p in $(aclocalfiles); do \ + @for p in $(pkgmacro_files); do \ f=`echo "$$p" |$(SED) 's|^.*/||'`; \ echo " rm -f '$(DESTDIR)$(aclocaldir)/$$f'"; \ rm -f "$(DESTDIR)$(aclocaldir)/$$f"; \ diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 11aab8928..bea217e02 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -759,34 +759,6 @@ func_install_update () } -# func_massage_aclocal_DATA [glob_exclude] -# @aclocal_DATA\@ is substituted as per its value in Makefile.am; -# this function massages it into a suitable format for func_copy_some_files. -func_massage_aclocal_DATA () -{ - $debug_cmd - - pkgmacro_files= # GLOBAL VAR - - my_glob_exclude="$1" - - # Massage a value for pkgmacro_files from the value used in Makefile.am. - for my_filename in @aclocal_DATA@; do - func_dirname_and_basename "$my_filename" - my_filename=$func_basename_result - - # 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 - - pkgmacro_files="${pkgmacro_files+$pkgmacro_files }$my_filename" - done -} - - # func_install_pkgmacro_subproject # Unless --quiet was passed, display a message. Then copy pkgmacro_files # from libtool installation tree to subproject libltdl tree. @@ -811,7 +783,7 @@ func_install_pkgmacro_subproject () pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, \`$subproject_macro_dir'." fi - func_copy_some_files "argz.m4 libtool.m4 ltdl.m4 $pkgmacro_files" \ + func_copy_some_files "$pkgmacro_files" \ "$aclocaldir" "$subproject_macro_dir" pkgmacro_header } @@ -842,26 +814,29 @@ func_install_pkgmacro_parent () my_pkgmacro_header="putting macros in \`$macro_dir'." fi - if $opt_ltdl; then - func_serial_update argz.m4 "$aclocaldir" "$macro_dir" \ - my_pkgmacro_header argz.m4 - else - func_verbose "Not copying \`$macro_dir/argz.m4', libltdl not used." - fi + for file in $pkgmacro_files; do + case $file in + argz.m4|ltdl.m4) + $opt_ltdl || { + func_verbose "Not copying \`$macro_dir/$file', libltdl not used." + continue + } + ;; + esac - func_serial_update libtool.m4 "$aclocaldir" "$macro_dir" \ - my_pkgmacro_header LT_INIT 'A[CM]_PROG_LIBTOOL' + case $file in + libtool.m4) + func_serial_update libtool.m4 "$aclocaldir" "$macro_dir" \ + my_pkgmacro_header LT_INIT 'A[CM]_PROG_LIBTOOL' ;; - if $opt_ltdl; then - func_serial_update ltdl.m4 "$aclocaldir" "$macro_dir" \ - my_pkgmacro_header 'LTDL_INIT' - else - func_verbose "Not copying \`$macro_dir/ltdl.m4', libltdl not used." - fi + ltdl.m4) + func_serial_update ltdl.m4 "$aclocaldir" "$macro_dir" \ + my_pkgmacro_header 'LTDL_INIT' ;; - for file in $pkgmacro_files; do - func_serial_update "$file" "$aclocaldir" "$macro_dir" \ - my_pkgmacro_header "$file" + *) + func_serial_update "$file" "$aclocaldir" "$macro_dir" \ + my_pkgmacro_header "$file" ;; + esac done } @@ -878,9 +853,6 @@ func_install_pkgmacro_files () $require_ltdl_mode $require_macro_dir - # argz.m4, libtool.m4 and ltdl.m4 are handled specially: - func_massage_aclocal_DATA 'argz.m4|libtool.m4|ltdl.m4' - # 1. Parent has separate macro_dir to subproject ltdl: if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" && test "x$macro_dir" != "x$subproject_macro_dir" @@ -1179,17 +1151,17 @@ func_check_macros () my_ac_config_macro_srcdir="$subproject_macro_dir" fi - my_needed="libtool.m4 ltoptions.m4 ltversion.m4 ltsugar.m4 lt~obsolete.m4" - $opt_ltdl && my_needed="$my_needed argz.m4 ltdl.m4" - - if test -f "aclocal.m4"; then - for need in $my_needed; do - func_aclocal_update_check $need - $func_aclocal_update_check_result && my_missing="$my_missing $need" - done - else - my_missing="$my_needed" - fi + my_missing= + for file in $pkgmacro_files; do + case $file in + argz.m4|ltdl.m4) $opt_ltdl || continue ;; + esac + if test -f "aclocal.m4"; then + func_aclocal_update_check $file + $func_aclocal_update_check_result || continue + fi + my_missing="$my_missing $file" + done if test -n "$my_missing"; then func_echo "You should add the contents of the following files to \`aclocal.m4':" @@ -1691,6 +1663,10 @@ func_require_seen_libtool () 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_pkgmacro_files(), not including + # libtool.m4 and ltdl.m4 which are handled specially. + pkgmacro_files="@pkgmacro_files@" + # Locations for important files: prefix=@prefix@ datadir=@datadir@ diff --git a/tests/libtoolize.at b/tests/libtoolize.at index 77525f43c..d3500957d 100644 --- a/tests/libtoolize.at +++ b/tests/libtoolize.at @@ -539,8 +539,8 @@ libtoolize: copying file `build-aux/ltmain.sh' libtoolize: You should add the contents of the following files to `aclocal.m4': libtoolize: `/usr/local/share/aclocal/libtool.m4' libtoolize: `/usr/local/share/aclocal/ltoptions.m4' -libtoolize: `/usr/local/share/aclocal/ltversion.m4' libtoolize: `/usr/local/share/aclocal/ltsugar.m4' +libtoolize: `/usr/local/share/aclocal/ltversion.m4' libtoolize: `/usr/local/share/aclocal/lt~obsolete.m4' libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. @@ -674,8 +674,8 @@ AT_DATA([expout], libtoolize: copying file `./ltmain.sh' libtoolize: You should add the contents of the following files to `aclocal.m4': libtoolize: `/usr/local/share/aclocal/libtool.m4' -libtoolize: `/usr/local/share/aclocal/ltversion.m4' libtoolize: `/usr/local/share/aclocal/ltsugar.m4' +libtoolize: `/usr/local/share/aclocal/ltversion.m4' libtoolize: `/usr/local/share/aclocal/lt~obsolete.m4' libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.