libtool-patches
[Top][All Lists]
Advanced

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

Re: patch-6: several changes to libtoolize.m4sh


From: Ralf Wildenhues
Subject: Re: patch-6: several changes to libtoolize.m4sh
Date: Mon, 12 Jun 2006 19:54:19 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hello Gary,

This has been so long ago it's a shame:
http://lists.gnu.org/archive/html/libtool-patches/2005-12/msg00075.html

* Gary V. Vaughan wrote on Wed, Dec 14, 2005 at 01:39:55PM CET:
> Ralf Wildenhues wrote:
> >This patch is the last of the queue, and the most intertwined.  Maybe I
> >should make the effort to rip it apart -- please say so.
> 
> Yes please.  Unless it is a disproportionate amount of effort, in which
> case I'd rather spend that effort on rolling 1.9h.

The fact that I haven't found the time to rip it apart in 6 months is
enough reason for me to just apply it in one go.

> >Several open bugs:
> 
> Open until these patches are applied I presume?

Yes, sorry for not being precise.

> >  Note that in the symlink-case, this file *must* retain its old time
> >  stamp, hence `cp -p'.  Maybe we'd need `tar' instead here?
> 
> I'm not sure `cp -p' is portable enough.  We've used `tar' previously
> because of this (among other things).

I've changed the patch to use tar.  Although I really really doubt there
to be any real advantage here of tar over cp -p.  If there were such an
issue, it should definitly be mentioned in the Autoconf portability
section.

> >  (Luckily the subsecond problem is not *so* much of an issue here:
> >  `cd libltdl && aclocal' still takes a second on a fast machine --
> >  maybe we should put a `sleep 1' into the manual rule even?)
> 
> Yes, I think the sleep is a good idea for future proof against ultra
> fast machines that decide not to upgrade to libtool-3.0 in 2025 ;-)

Let's not do that yet.  Maybe after the stuff has stabilized.

> >- in case of `libtoolize --copy', it would actually be wise to have the
> >  copied files have *current* time stamps, so that its dependents will
> >  be rebuilt.  Bob and I noted this some time ago.
> >  This patch does `cp -p' and a subsequent `touch', to preserve
> >  permission bits.
> 
> Again, I'm dubious about the use of `cp -p'.

See above, fixed.

*much snippage*

> >As a final bit, we default $tst_dist to `dist' now -- should work. :)
> 
> I'd rather not have casual installers be even more likely to get bored
> and abort the testsuite run.  What do you think of my LT_TEST_EXHAUSTIVE
> idea?

The dist part isn't so much more expensive at all; you may have been
thinking of distcheck, which would really be expensive.  But dist
uncovers the bugs fixed in this patch, and I definitely want to see
those.

> >OK to apply?
> 
> Not yet...
> 
> As a general rule, the ChangeLog entry itself should be sufficient
> documentation for why the changeset is necessary.  If you find yourself
> wanting to add more description to the libtool-patches post, rather
> add it to the ChangeLog entry instead for future readers.

I've added some of the description to the ChangeLog entry now.

> So far, we only use `cp -p' as a fallback for a failed `ln -s' or tar
> copy... unless we can come up with good evidence that `cp -p' won't
> fail on any of the host environments we care about, I don't want to
> divert from that.

See above, I've fixed that now.

I've applied the patch as shown below.

Cheers,
Ralf

        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'.

Index: libtoolize.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libtoolize.m4sh,v
retrieving revision 1.54
diff -u -r1.54 libtoolize.m4sh
--- libtoolize.m4sh     18 May 2006 05:43:00 -0000      1.54
+++ libtoolize.m4sh     12 Jun 2006 04:08:03 -0000
@@ -262,17 +262,29 @@
     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 @@
     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_,@address@hidden,
+         s,libltdl/,@repl@/,
+         s,: libltdl/,: @repl@/,
+         s,\\\$(libltdl_,\$(@address@hidden,
+         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_,@address@hidden,
-       s,libltdl/,@repl@/,
-       s,: libltdl/,: @repl@/,
-       s,\\\$(libltdl_,\$(@address@hidden,
-       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_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_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 @@
     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: tests/libtoolize.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/libtoolize.at,v
retrieving revision 1.8
diff -u -r1.8 libtoolize.at
--- tests/libtoolize.at 20 Nov 2005 10:33:27 -0000      1.8
+++ tests/libtoolize.at 12 Jun 2006 04:08:07 -0000
@@ -308,11 +308,19 @@
 ]])
 
 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/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: tests/testsuite.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/testsuite.at,v
retrieving revision 1.41
diff -u -r1.41 testsuite.at
--- tests/testsuite.at  15 May 2006 16:14:24 -0000      1.41
+++ tests/testsuite.at  12 Jun 2006 04:08:07 -0000
@@ -19,7 +19,7 @@
 # 02110-1301, USA.
 
 m4_divert_push([PREPARE_TESTS])dnl
-: ${tst_dist=""}
+: ${tst_dist=dist}
 : ${ACLOCAL=aclocal}
 : ${AUTOHEADER=autoheader}
 : ${AUTOCONF=autoconf}




reply via email to

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