libtool-patches
[Top][All Lists]
Advanced

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

Re: [patch 1/2] 307-gary-fix-recursive-ltdl-dist-rules.diff


From: Gary V. Vaughan
Subject: Re: [patch 1/2] 307-gary-fix-recursive-ltdl-dist-rules.diff
Date: Thu, 10 Nov 2005 20:39:27 +0000
User-agent: quilt/0.42-1

Argh! I seem to have posted an in development version of this patch
somehow, sorry.  Here is the real patch.  If you had weird non-repeatable
results in tests, and corrupted libltdl/Makefile.am before, this version
doesn't have that problem.

Okay to commit this version?

Cheers,
        Gary.

 Makefile.am           |   10 +++++++-
 libltdl/Makefile.inc  |   10 --------
 libtoolize.m4sh       |   61 +++++++++++++++++++++++++++++++++-----------------
 tests/libtoolize.at   |    2 -
 tests/nonrecursive.at |   30 ++++++++++++++++++++++++
 tests/recursive.at    |   25 ++++++++++++++++++++
 tests/subproject.at   |   21 +++++++++++++++++
 7 files changed, 128 insertions(+), 31 deletions(-)

Index: libtool--devo--1.0/ChangeLog
from  Gary V. Vaughan  <address@hidden>
        * libltdl/Makefile.inc (EXTRA_DIST): Move files that are not
        installed unconditionally to a client from here...
        * Makefile.am (EXTRA_DIST): ...to here.
        * libtoolize.m4sh: Append the paths to installed files to
        EXTRA_DIST in newly copied Makefile.am.
        (func_copy_cb): Add glob_nolink argument for files that cannot be
        softlinked during ltdl installation.  Changed all callers.
        * tests/libtoolize.at: Adjust output matching for glob_nolink
        files.
        * tests/nonrecursive.at, tests/recursive.at, tests/subproject.at:
        Add new dist tests to prevent a regression.

Index: libtool--devo--1.0/Makefile.am
===================================================================
--- libtool--devo--1.0.orig/Makefile.am
+++ libtool--devo--1.0/Makefile.am
@@ -214,7 +214,6 @@ $(srcdir)/libltdl/Makefile.am: $(srcdir)
        $(SED) -n '/^.. DO NOT REMOVE THIS LINE -- /,$$ \
            { s,libltdl_,,; s,libltdl/,,; s,: libltdl/,: ,; \
              s,\$$(libltdl_,$$(,; p; }' $$in >> $$out;
-       chmod a-w $(srcdir)/libltdl/Makefile.am
 
 $(srcdir)/libltdl/Makefile.in: $(srcdir)/libltdl/Makefile.am
        cd $(srcdir)/libltdl && $(AUTOMAKE) Makefile
@@ -229,6 +228,15 @@ all-local: $(srcdir)/libltdl/Makefile.in
 
 include libltdl/Makefile.inc
 
+EXTRA_DIST +=    libltdl/Makefile.am \
+                 libltdl/Makefile.in \
+                 libltdl/Makefile.inc \
+                 libltdl/config-h.in \
+                 libltdl/configure \
+                 libltdl/configure.ac \
+                 libltdl/aclocal.m4 \
+                 libltdl/m4/lt~obsolete.m4
+
 if ! LTDL_SUBDIR_LIBOBJS
 ## workaround for Autoconf 2.59, Automake 1.9.6:
 ## we include these files twice, because of missing LIBOBJDIR support.
Index: libtool--devo--1.0/libltdl/Makefile.inc
===================================================================
--- libtool--devo--1.0.orig/libltdl/Makefile.inc
+++ libtool--devo--1.0/libltdl/Makefile.inc
@@ -117,15 +117,7 @@ CLEANFILES                += libltdl/libltdl.la
 CLEANFILES            += $(LIBOBJS) $(LTLIBOBJS)
 
 EXTRA_DIST            += libltdl/COPYING.LIB \
-                         libltdl/Makefile.am \
-                         libltdl/Makefile.in \
-                         libltdl/Makefile.inc \
-                         libltdl/README \
-                         libltdl/config-h.in \
-                         libltdl/configure \
-                         libltdl/configure.ac \
-                         libltdl/aclocal.m4 \
-                         libltdl/m4/lt~obsolete.m4
+                         libltdl/README
 
 ## --------------------------- ##
 ## Gnulib Makefile.am snippets ##
Index: libtool--devo--1.0/libtoolize.m4sh
===================================================================
--- libtool--devo--1.0.orig/libtoolize.m4sh
+++ libtool--devo--1.0/libtoolize.m4sh
@@ -192,7 +192,7 @@ configure_ac=configure.in
 }
 
 
-# func_copy srcfile destfile
+# func_copy srcfile destfile [glob_nolink]
 # A wrapper for func_copy_cb that accepts arguments in the same order
 # as the cp(1) shell command.
 func_copy ()
@@ -217,7 +217,8 @@ func_copy ()
 
       func_copy_cb "$my_f1" \
         `$ECHO "X$1" | $Xsed -e "$dirname"` \
-        `$ECHO "X$2" | $Xsed -e "$dirname"`
+        `$ECHO "X$2" | $Xsed -e "$dirname"` \
+       "$3"
 
     fi
 
@@ -225,16 +226,18 @@ func_copy ()
 }
 
 
-# func_copy_cb filename srcdir destdir
+# func_copy_cb filename srcdir destdir [glob_nolink]
 # If option `--copy' was specified, or soft-linking SRCFILE to DESTFILE fails,
 # then try to copy SRCFILE to DESTFILE (without changing the timestamp if
-# possible).
+# possible).  If FILENAME matches GLOB_NOLINK, it will never be softlinked.
 func_copy_cb ()
 {
     $opt_debug
     my_file="$1"
     my_srcdir="$2"
     my_destdir="$3"
+    my_glob_nolink="$4"
+    my_opt_link="$opt_link"
     copy_return_status=1
 
     # Libtool is probably misinstalled if this happens:
@@ -248,7 +251,11 @@ 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
+    if test -n "$my_glob_nolink"; then
+      eval 'case $my_file in '$my_glob_nolink') my_opt_link=false ;; esac'
+    fi
+
+    if $my_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; 
) \
@@ -265,7 +272,8 @@ func_copy_cb ()
 }
 
 
-# func_copy_all_files [-r] srcdir destdir [glob_exclude] [copy_cb=func_copy_cb]
+# func_copy_all_files [-r] srcdir destdir \
+#                    [glob_exclude] [glob_nolink] [copy_cb=func_copy_cb]
 # For each file in SRCDIR, then try to copy the file to DESTDIR by calling
 # COPY_CB with the src and dest files.  With the `-r' option, recurse into
 # subdirectories of srcdir too.  If GLOB_EXCLUDE is given, exclude any
@@ -285,7 +293,8 @@ func_copy_all_files ()
     my_srcdir="$1"
     my_destdir="$2"
     my_glob_exclude="$3"
-    my_copy_cb="${4-func_copy_cb}"
+    my_glob_nolink="$4"
+    my_copy_cb="${5-func_copy_cb}"
 
     my_srcfiles=
     my_basedir="$my_srcdir"
@@ -319,11 +328,12 @@ func_copy_all_files ()
     IFS="$my_save_IFS"
 
     func_copy_some_files "$my_srcfiles" "$my_basedir" \
-      "$my_destdir" "$my_copy_cb"
+      "$my_destdir" "$my_glob_nolink" "$my_copy_cb"
 }
 
 
-# func_copy_some_files srcfile_spec srcdir destdir [copy_cb=func_copy_cb]
+# func_copy_some_files srcfile_spec srcdir destdir \
+#                     [glob_nolink] [copy_cb=func_copy_cb]
 # Call COPY_CB for each regular file in SRCDIR named by the ':' delimited
 # names in SRCFILE_SPEC.  The odd calling convention is needed to allow
 # spaces in file and directory names.
@@ -333,7 +343,8 @@ func_copy_some_files ()
     my_srcfile_spec="$1"
     my_srcdir="$2"
     my_destdir="$3"
-    my_copy_cb="${4-func_copy_cb}"
+    my_glob_nolink="$4"
+    my_copy_cb="${5-func_copy_cb}"
 
     my_save_IFS="$IFS"
     IFS=:
@@ -352,7 +363,7 @@ func_copy_some_files ()
         continue
       fi
 
-      $my_copy_cb "$my_filename" "$my_srcdir" "$my_destdir"
+      $my_copy_cb "$my_filename" "$my_srcdir" "$my_destdir" "$my_glob_nolink"
     done
     IFS="$my_save_IFS"
 }
@@ -1039,10 +1050,13 @@ func_nonemptydir_p ()
 
   # 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*'
+    nonrecursive)
+      glob_exclude_pkgltdl_files='Makefile.am|Makefile.in|aclocal.m4|config*'
+      ;;
+    recursive)
+      glob_exclude_pkgltdl_files='Makefile.in*|aclocal.m4|config*'
       ;;
-    *)
+    subproject)
       glob_exclude_pkgltdl_files='Makefile.inc'
       ;;
   esac
@@ -1059,13 +1073,20 @@ func_nonemptydir_p ()
   # 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"  ;;
-      nonrecursive) pkgltdl_files="Makefile.inc:$pkgltdl_files" ;;
-    esac
+    func_copy_some_files "$pkgltdl_files" \
+      "$pkgltdldir/libltdl" "$ltdldir" "Makefile.am|Makefile.inc"
 
-    func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir"
+    # Fixup the EXTRA_DIST contents in Makefile.{am,inc} if necessary
+    my_makefile="$ltdldir/Makefile.am"
+    test -f "$ltdldir/Makefile.inc" && my_makefile="$ltdldir/Makefile.inc"
+    my_save_IFS="$IFS"
+    IFS=:
+    for file in $pkgltdl_files; do
+      IFS="$my_save_IFS"
+      test nonrecursive = "$ltdl_mode" && file="$ltdldir/$file"
+      echo "EXTRA_DIST += $file" >> $my_makefile
+    done
+    IFS="$my_save_IFS"
 
     # Unless we share CONFIG_MACRO_DIR with our parent project,
     # copy macros here.
Index: libtool--devo--1.0/tests/libtoolize.at
===================================================================
--- libtool--devo--1.0.orig/tests/libtoolize.at
+++ libtool--devo--1.0/tests/libtoolize.at
@@ -290,7 +290,7 @@ AC_OUTPUT
 AT_DATA(expout,
 [[libtoolize: linking file `ltdl/COPYING.LIB'
 libtoolize: linking file `ltdl/README'
-libtoolize: linking file `ltdl/Makefile.am'
+libtoolize: copying file `ltdl/Makefile.am'
 libtoolize: linking file `ltdl/configure.ac'
 libtoolize: linking file `ltdl/aclocal.m4'
 libtoolize: linking file `ltdl/Makefile.in'
Index: libtool--devo--1.0/tests/nonrecursive.at
===================================================================
--- libtool--devo--1.0.orig/tests/nonrecursive.at
+++ libtool--devo--1.0/tests/nonrecursive.at
@@ -132,5 +132,35 @@ AT_CHECK([test -f $prefix/include/ltdl.h
 
 AT_CLEANUP
 
+
+## --------------------------------- ##
+## Distributing libtoolized project. ##
+## --------------------------------- ##
+
+AT_SETUP([distributing libltdl])
+
+test ! -d subdirectory-demo-[]AT_PACKAGE_VERSION || {
+  find subdirectory-demo-[]AT_PACKAGE_VERSION -type d ! -perm -200 \
+      -exec chmod u+w {} ';' &&
+  rm -fr subdirectory-demo-[]AT_PACKAGE_VERSION
+}
+
+_LTDL_SETUP
+
+LT_AT_LIBTOOLIZE([--copy --ltdl --install --nonrecursive])
+AT_CHECK([if test -f libltdl/configure.ac; then false; fi])
+
+# Support vanilla autoconf-2.59 & automake-1.9.6
+for file in argz.c lt__dirent.c lt__strl.c; do
+  cp libltdl/$file $file
+done
+
+LT_AT_BOOTSTRAP([ignore], [-I libltdl/m4], [ignore], [--add-missing --copy],
+       [], [], [all distcheck])
+
+AT_CHECK([test -f subdirectory-demo-]AT_PACKAGE_VERSION[.tar.gz])
+
+AT_CLEANUP
+
 dnl Be careful not to let the definition leak into other tests
 m4_popdef([_LTDL_SETUP])
Index: libtool--devo--1.0/tests/recursive.at
===================================================================
--- libtool--devo--1.0.orig/tests/recursive.at
+++ libtool--devo--1.0/tests/recursive.at
@@ -106,5 +106,30 @@ AT_CHECK([test -f $prefix/include/ltdl.h
 
 AT_CLEANUP
 
+
+## --------------------------------- ##
+## Distributing libtoolized project. ##
+## --------------------------------- ##
+
+AT_SETUP([distributing libltdl])
+
+test ! -d subdirectory-demo-[]AT_PACKAGE_VERSION || {
+  find subdirectory-demo-[]AT_PACKAGE_VERSION -type d ! -perm -200 \
+      -exec chmod u+w {} ';' &&
+  rm -fr subdirectory-demo-[]AT_PACKAGE_VERSION
+}
+
+_LTDL_SETUP
+
+LT_AT_LIBTOOLIZE([--copy --ltdl --install --recursive])
+AT_CHECK([if test -f libltdl/configure.ac; then false; fi])
+
+LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [ignore], [--add-missing --copy],
+       [], [], [all distcheck])
+
+AT_CHECK([test -f subdirectory-demo-]AT_PACKAGE_VERSION[.tar.gz])
+
+AT_CLEANUP
+
 dnl Be careful not to let the definition leak into other tests
 m4_popdef([_LTDL_SETUP])
Index: libtool--devo--1.0/tests/subproject.at
===================================================================
--- libtool--devo--1.0.orig/tests/subproject.at
+++ libtool--devo--1.0/tests/subproject.at
@@ -95,6 +95,27 @@ AT_CHECK([test -f $prefix/include/ltdl.h
 AT_CLEANUP
 
 
+## --------------------------------- ##
+## Distributing libtoolized project. ##
+## --------------------------------- ##
+
+AT_SETUP([distributing libltdl])
+
+test ! -d subproject-demo-[]AT_PACKAGE_VERSION || {
+  find subproject-demo-[]AT_PACKAGE_VERSION -type d ! -perm -200 \
+      -exec chmod u+w {} ';' &&
+  rm -fr subproject-demo-[]AT_PACKAGE_VERSION
+}
+
+_LTDL_SETUP
+
+LT_AT_BOOTSTRAP([--copy --ltdl --install], [-I sub/ltdl/m4], [ignore],
+       [--add-missing --copy], [], [], [all distcheck])
+
+AT_CHECK([test -f subproject-demo-]AT_PACKAGE_VERSION[.tar.gz])
+
+AT_CLEANUP
+
 ## ----------------------------------------------- ##
 ## libltdl is usable without Autoconf or Automake. ##
 ## ----------------------------------------------- ##
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook




reply via email to

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