]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix several libtoolize-related bugs:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 12 Jun 2006 17:54:15 +0000 (17:54 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 12 Jun 2006 17:54:15 +0000 (17:54 +0000)
- Do not symlink aclocal.m4, to work around a bug in aclocal
overwriting the linked-to file instead of removing the symlink.
- Have `libtoolize --copy' cause current time stamps, so that
dependents will be rebuilt; for this, install files in order.
- Fix list of distribution files for (non)recursive libltdl.
- Fix some failure cases.

* libtoolize.m4sh (func_copy_cb):
If `$opt_link', still copy `aclocal.m4', so a subsequent
`aclocal' will not overwrite the symlink target.
In `--copy' mode, do `cp -p' and `touch' for each file, so
timestamps are updated but permissions preserved.
(main): Reorder installing of files to match logical order
and timestamp requirements.
(func_fixup_Makefile_inc): Renamed to
(func_fixup_Makefile): this.  Add sed scriptlet to remove
non-existent files from EXTRA_DIST, for either nonrecursive
or recursive mode.
(main): call it to mangle also in recursive mode.
* tests/libtoolize.at (expout): Adjusted.
* tests/testsuite.at (tst_dist): Default to `dist'.

ChangeLog
libtoolize.m4sh
tests/libtoolize.at
tests/testsuite.at

index 84bb4a2e4d5b5b1508cc8ade828533ebce4bb383..8b39c192c96f427f2c5a5328a324eed46be38253 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2006-06-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix several libtoolize-related bugs:
+       - Do not symlink aclocal.m4, to work around a bug in aclocal
+       overwriting the linked-to file instead of removing the symlink.
+       - Have `libtoolize --copy' cause current time stamps, so that
+       dependents will be rebuilt; for this, install files in order.
+       - Fix list of distribution files for (non)recursive libltdl.
+       - Fix some failure cases.
+
+       * libtoolize.m4sh (func_copy_cb):
+       If `$opt_link', still copy `aclocal.m4', so a subsequent
+       `aclocal' will not overwrite the symlink target.
+       In `--copy' mode, do `cp -p' and `touch' for each file, so
+       timestamps are updated but permissions preserved.
+       (main): Reorder installing of files to match logical order
+       and timestamp requirements.
+       (func_fixup_Makefile_inc): Renamed to
+       (func_fixup_Makefile): this.  Add sed scriptlet to remove
+       non-existent files from EXTRA_DIST, for either nonrecursive
+       or recursive mode.
+       (main): call it to mangle also in recursive mode.
+       * tests/libtoolize.at (expout): Adjusted.
+       * tests/testsuite.at (tst_dist): Default to `dist'.
+
 2006-06-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Fix libltdl to always have all generated files up to date.
index 486b564ee1f8e4f68964b8ea94ad46954ec97d00..3853530a8b1abfc63716ce5fbd083464f46991ad 100644 (file)
@@ -262,17 +262,29 @@ func_copy_cb ()
     func_mkdir_p `$ECHO "X$my_destdir/$my_file" | $Xsed -e "$dirname"`
 
     $RM "$my_destdir/$my_file"
-    if $opt_link && $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then
-      $opt_quiet || func_echo "linking $my_copy_msg"
-      copy_return_status=0
-    elif { ( cd "$my_srcdir" 2>/dev/null && $TAR chf - "$my_file" 2>/dev/null; ) \
-        | ( umask 0 && cd "$my_destdir" 2>/dev/null && "$TAR" xf - >/dev/null 2>&1; ); } ; then
-      $opt_quiet || func_echo "copying $my_copy_msg"
-      copy_return_status=0
-    elif $CP -p "$my_srcdir/$my_file" "$my_destdir/$my_file"; then
-      $opt_quiet || func_echo "copying $my_copy_msg"
-      copy_return_status=0
+    if $opt_link; then
+      if test "$my_file" = "aclocal.m4"; then
+       if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
+            | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1 ; }
+       then
+         $opt_quiet || func_echo "copying $my_copy_msg"
+         copy_return_status=0
+       fi
+      else
+       if $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then
+         $opt_quiet || func_echo "linking $my_copy_msg"
+         copy_return_status=0
+       fi
+      fi
     else
+      if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
+           | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1; } \
+        && touch "$my_destdir/$my_file"; then
+       $opt_quiet || func_echo "copying $my_copy_msg"
+       copy_return_status=0
+      fi
+    fi
+    if test "$copy_return_status" != 0; then
       func_error "can not copy \`$my_srcdir/$my_file' to \`$my_destdir/'"
       exit_status=$EXIT_FAILURE
     fi
@@ -312,28 +324,45 @@ func_copy_some_files ()
     IFS="$my_save_IFS"
 }
 
-# func_fixup_Makefile_inc srcfile srcdir destdir
-func_fixup_Makefile_inc ()
+# func_fixup_Makefile srcfile srcdir destdir
+func_fixup_Makefile ()
 {
     my_filename="$1"
     my_srcdir="$2"
     my_destdir="$3"
+    my_fixup_non_subpackage_script="\
+      s,libltdl/configure.ac,,
+      s,libltdl/configure,,
+      s,libltdl/aclocal.m4,,
+      s,libltdl/config-h.in,,
+      s,libltdl/Makefile.am,,
+      s,libltdl/Makefile.in,,"
+    case $my_filename in
+      Makefile.am)
+       my_fixup_non_subpackage_script=`echo "$my_fixup_non_subpackage_script" | \
+               sed 's,libltdl/,,'`
+       my_fixup_inc_paths_script= ;;
+      Makefile.inc)
+       repl=$ltdldir
+       repl_uscore=`$ECHO "X$repl" | $Xsed -e 's,[[/.+-]],_,g'`
+       my_fixup_inc_paths_script="\
+         s,libltdl_,@repl_uscore@_,
+         s,libltdl/,@repl@/,
+         s,: libltdl/,: @repl@/,
+         s,\\\$(libltdl_,\$(@repl_uscore@_,
+         s,)/libltdl ,)/@repl@ ,
+         s,@repl_uscore@,${repl_uscore},g
+         s,@repl@,${repl},g"
+       ;;
+    esac
 
-    repl=$ltdldir
-    repl_uscore=`$ECHO "X$repl" | $Xsed -e 's,[[/.+-]],_,g'`
     $RM "$my_destdir/$my_filename" 2>/dev/null
     $opt_quiet || func_echo "creating file \`$my_destdir/$my_filename'"
     if $opt_dry_run; then :;
     else
-      $SED "\
-       s,libltdl_,@repl_uscore@_,
-       s,libltdl/,@repl@/,
-       s,: libltdl/,: @repl@/,
-       s,\\\$(libltdl_,\$(@repl_uscore@_,
-       s,)/libltdl ,)/@repl@ ,
-       s,@repl_uscore@,${repl_uscore},g
-       s,@repl@,${repl},g
-       "  < "$my_srcdir/$my_filename" > "$my_destdir/$my_filename" ||
+      $SED "$my_fixup_non_subpackage_script
+           $my_fixup_inc_paths_script" \
+       < "$my_srcdir/$my_filename" > "$my_destdir/$my_filename" ||
        func_fatal_error "cannot create $my_destdir/$my_filename"
     fi
 }
@@ -1057,48 +1086,6 @@ func_nonemptydir_p ()
 
   func_scan_files
 
-  # These files are handled specially, depending on ltdl_mode:
-  case $ltdl_mode in
-    *recursive)
-      glob_exclude_pkgltdl_files='Makefile.am|Makefile.in*|aclocal.m4|config*'
-      ;;
-    *)
-      glob_exclude_pkgltdl_files='Makefile.inc'
-      ;;
-  esac
-
-  func_massage_pkgltdl_files "$glob_exclude_pkgltdl_files"
-  func_massage_pkgconfig_files
-
-  # libtool.m4 and ltdl.m4 are handled specially below
-  func_massage_aclocal_DATA 'libtool.m4|ltdl.m4'
-
-  # Copy all the files from installed libltdl to this project, if the
-  # user specified `--ltdl'.
-  if $opt_ltdl; then
-
-    # For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
-    case $ltdl_mode in
-      recursive)    pkgltdl_files="Makefile.am:$pkgltdl_files"  ;;
-    esac
-
-    func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir"
-
-    case $ltdl_mode in
-      nonrecursive) func_fixup_Makefile_inc "Makefile.inc" "$pkgltdldir/libltdl" "$ltdldir" ;;
-    esac
-
-    # Unless we share CONFIG_MACRO_DIR with our parent project,
-    # copy macros here.
-    if test "$ltdldir/m4" != "$m4dir"; then
-      func_copy_some_files "$pkgmacro_files:libtool.m4:ltdl.m4" \
-        "$aclocaldir" "$ltdldir/m4"
-    fi
-
-    # Copy config aux files into libltdl.
-    func_copy_some_files "$pkgconfig_files" "$pkgdatadir" "$ltdldir"
-  fi
-
   # Unless we share CONFIG_AUX_DIR with the libltdl subproject, then
   # if they are newer, copy all the installed utility files to the
   # auxiliary directory if `--install' was passed, or else copy just
@@ -1119,6 +1106,9 @@ func_nonemptydir_p ()
     func_verbose "AC_CONFIG_AUX_DIR not defined, not copying libtool auxiliary files."
   fi
 
+  # libtool.m4 and ltdl.m4 were handled specially above
+  func_massage_aclocal_DATA 'libtool.m4|ltdl.m4'
+
   # Copy libtool's m4 macros to the macro directory, if they are newer.
   if test -n "$m4dir"; then
     $opt_quiet || func_echo "putting macros in AC_CONFIG_MACRO_DIR, \`$m4dir'."
@@ -1141,6 +1131,42 @@ func_nonemptydir_p ()
     IFS="$my_save_IFS"
   fi
 
+  # These files are handled specially, depending on ltdl_mode:
+  case $ltdl_mode in
+    *recursive)
+      glob_exclude_pkgltdl_files='Makefile.am|Makefile.in*|aclocal.m4|config*'
+      ;;
+    *)
+      glob_exclude_pkgltdl_files='Makefile.inc'
+      ;;
+  esac
+
+  func_massage_pkgltdl_files "$glob_exclude_pkgltdl_files"
+  func_massage_pkgconfig_files
+
+  # Copy all the files from installed libltdl to this project, if the
+  # user specified `--ltdl'.
+  if $opt_ltdl; then
+
+    # Unless we share CONFIG_MACRO_DIR with our parent project,
+    # copy macros here.
+    if test "$ltdldir/m4" != "$m4dir"; then
+      func_copy_some_files "$pkgmacro_files:libtool.m4:ltdl.m4" \
+        "$aclocaldir" "$ltdldir/m4"
+    fi
+
+    func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir"
+
+    # For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
+    case $ltdl_mode in
+      recursive)    func_fixup_Makefile "Makefile.am" "$pkgltdldir/libltdl" "$ltdldir" ;;
+      nonrecursive) func_fixup_Makefile "Makefile.inc" "$pkgltdldir/libltdl" "$ltdldir" ;;
+    esac
+
+    # Copy config aux files into libltdl.
+    func_copy_some_files "$pkgconfig_files" "$pkgdatadir" "$ltdldir"
+  fi
+
   $opt_quiet || func_check_macros
 }
 
index c97b394734dfd5ff59b1b4027b72751e433e18c0..ac49ceae92d5fe317fe9fd879ba071ae009704d9 100644 (file)
@@ -308,11 +308,19 @@ AC_OUTPUT
 ]])
 
 AT_DATA(expout,
-[[libtoolize: linking file `ltdl/COPYING.LIB'
+[[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `ltdl/m4'.
+libtoolize: linking file `ltdl/m4/libtool.m4'
+libtoolize: linking file `ltdl/m4/ltdl.m4'
+libtoolize: linking file `ltdl/m4/argz.m4'
+libtoolize: linking file `ltdl/m4/ltoptions.m4'
+libtoolize: linking file `ltdl/m4/ltsugar.m4'
+libtoolize: linking file `ltdl/m4/ltversion.m4'
+libtoolize: linking file `ltdl/m4/lt~obsolete.m4'
+libtoolize: linking file `ltdl/COPYING.LIB'
 libtoolize: linking file `ltdl/README'
 libtoolize: linking file `ltdl/Makefile.am'
 libtoolize: linking file `ltdl/configure.ac'
-libtoolize: linking file `ltdl/aclocal.m4'
+libtoolize: copying file `ltdl/aclocal.m4'
 libtoolize: linking file `ltdl/Makefile.in'
 libtoolize: linking file `ltdl/config-h.in'
 libtoolize: linking file `ltdl/configure'
@@ -349,14 +357,6 @@ libtoolize: linking file `ltdl/config/depcomp'
 libtoolize: linking file `ltdl/config/install-sh'
 libtoolize: linking file `ltdl/config/missing'
 libtoolize: linking file `ltdl/config/ltmain.sh'
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `ltdl/m4'.
-libtoolize: linking file `ltdl/m4/libtool.m4'
-libtoolize: linking file `ltdl/m4/ltdl.m4'
-libtoolize: linking file `ltdl/m4/argz.m4'
-libtoolize: linking file `ltdl/m4/ltoptions.m4'
-libtoolize: linking file `ltdl/m4/ltsugar.m4'
-libtoolize: linking file `ltdl/m4/ltversion.m4'
-libtoolize: linking file `ltdl/m4/lt~obsolete.m4'
 ]])
 
 LT_AT_CHECK_LIBTOOLIZE([--ltdl], 0, expout)
index 6d449c70b1a5159c2cbc7b229c1c6fd95053ee65..486d111feccd73ebd936c70d790207376b78aba2 100644 (file)
@@ -19,7 +19,7 @@
 # 02110-1301, USA.
 
 m4_divert_push([PREPARE_TESTS])dnl
-: ${tst_dist=""}
+: ${tst_dist=dist}
 : ${ACLOCAL=aclocal}
 : ${AUTOHEADER=autoheader}
 : ${AUTOCONF=autoconf}