bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] Generalize GNUmakefile, ...


From: Eric Blake
Subject: Re: [PATCH] Generalize GNUmakefile, ...
Date: Fri, 21 Mar 2008 22:33:43 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 3/13/2008 6:15 PM:
| gnulib-tool can already put a file at the top directory of a package -
you just
| have to put the original into the top directory of gnulib.
|
| But since a GNUmakefile in the top directory of gnulib would hide the
Makefile
| of gnulib, I propose to move it from build-aux/GNUmakefile to
top/GNUmakefile,
| and enhance gnulib-tool with a filename rewriting rule that transforms
|   $GNULIBDIR/top/GNUmakefile   -->   $PACKAGEDIR/GNUmakefile

How about like this?  To test it, I split maintainer-makefile into two
modules (for now, I'm ready for a shared GNUmakefile but not gnulib's
maint.mk in M4), then used 'gnulib-tool --import GNUmakefile' in M4.  OK
to apply?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfkjCcACgkQ84KuGfSFAYC9awCdEI0wvWJgVU+7FnqnxEeuvYqk
gpwAnjJ58suPMyKaB4E6Ac0hKU58108L
=r9v6
-----END PGP SIGNATURE-----
>From c1de993fed29331d1cbe36c2a9f0d1818626b800 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Fri, 21 Mar 2008 22:29:37 -0600
Subject: [PATCH] Support installing files into the top directory.

* gnulib-tool (func_get_automake_snippet): Distribute files placed
in the top directory.
(func_emit_lib_Makefile_am): Manage files in the top directory.
(func_emit_tests_Makefile_am): Likewise.
(func_import): Likewise.
(func_create_testdir): Likewise.
* modules/maintainer-makefile: Split, and add dependency...
* modules/GNUmakefile: to this new module.
* build-aux/GNUmakefile: Move...
* top/GNUmakefile: ...here.
* build-aux/maint.mk: Move...
* top/maint.mk: ...here.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                      |   14 ++++++++++++++
 gnulib-tool                    |   26 +++++++++++++++++++++-----
 modules/GNUmakefile            |   32 ++++++++++++++++++++++++++++++++
 modules/maintainer-makefile    |    6 ++++--
 {build-aux => top}/GNUmakefile |    0 
 {build-aux => top}/maint.mk    |    0 
 6 files changed, 71 insertions(+), 7 deletions(-)
 create mode 100644 modules/GNUmakefile
 rename {build-aux => top}/GNUmakefile (100%)
 rename {build-aux => top}/maint.mk (100%)

diff --git a/ChangeLog b/ChangeLog
index c34d25d..589d969 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2008-03-21  Eric Blake  <address@hidden>
 
+       Support installing files into the top directory.
+       * gnulib-tool (func_get_automake_snippet): Distribute files placed
+       in the top directory.
+       (func_emit_lib_Makefile_am): Manage files in the top directory.
+       (func_emit_tests_Makefile_am): Likewise.
+       (func_import): Likewise.
+       (func_create_testdir): Likewise.
+       * modules/maintainer-makefile: Split, and add dependency...
+       * modules/GNUmakefile: to this new module.
+       * build-aux/GNUmakefile: Move...
+       * top/GNUmakefile: ...here.
+       * build-aux/maint.mk: Move...
+       * top/maint.mk: ...here.
+
        More --version tweaks.
        * gnulib-tool (func_version): Obey GNU Coding Standards.  Output
        date of last ChangeLog entry.
diff --git a/gnulib-tool b/gnulib-tool
index be206e7..702697b 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -1342,6 +1342,17 @@ func_get_automake_snippet ()
         echo "EXTRA_DIST += "`echo "$buildaux_files" | sed -e 
"$sed_prepend_auxdir"`
         echo
       fi
+      # Synthesize an EXTRA_DIST augmentation also for the files from top/.
+      top_files=`for f in $all_files; do \
+                        case $f in \
+                          top/*) echo $f ;; \
+                        esac; \
+                      done | sed -e 's,^top/,,'`
+      if test -n "$top_files"; then
+        sed_prepend_topdir='s,^,$(top_srcdir)/,'
+        echo "EXTRA_DIST += "`echo "$top_files" | sed -e "$sed_prepend_topdir"`
+        echo
+      fi
       ;;
   esac
 }
@@ -1711,7 +1722,8 @@ func_emit_lib_Makefile_am ()
     echo
   fi
   cat allsnippets.tmp \
-    | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g'
+    | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g' \
+          -e 's|\$(top_srcdir)/top/|$(top_srcdir)/|g'
   echo
   echo "mostlyclean-local: mostlyclean-generic"
   echo "       @for dir in '' \$(MOSTLYCLEANDIRS); do \\"
@@ -1959,7 +1971,8 @@ func_emit_tests_Makefile_am ()
     echo
   fi
   cat allsnippets.tmp \
-    | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g'
+    | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g' \
+          -e 's|\$(top_srcdir)/top/|$(top_srcdir)/|g'
   echo "# Clean up after Solaris cc."
   echo "clean-local:"
   echo "       rm -rf SunWS_cache"
@@ -2477,14 +2490,16 @@ func_import ()
     s,^lib/,$cached_sourcebase/,
     s,^m4/,$cached_m4base/,
     s,^tests/,$cached_testsbase/,
-    s,^tests=lib/,$cached_testsbase/,"
+    s,^tests=lib/,$cached_testsbase/,
+    s,^top/,$destdir/,"
   sed_rewrite_new_files="\
     s,^build-aux/,$auxdir/,
     s,^doc/,$docbase/,
     s,^lib/,$sourcebase/,
     s,^m4/,$m4base/,
     s,^tests/,$testsbase/,
-    s,^tests=lib/,$testsbase/,"
+    s,^tests=lib/,$testsbase/,
+    s,^top/,$destdir/,"
 
   # Create directories.
   { echo "$sourcebase"
@@ -3416,7 +3431,8 @@ func_create_testdir ()
     s,^doc/,$docbase/,
     s,^lib/,$sourcebase/,
     s,^m4/,$m4base/,
-    s,^tests/,$testsbase/,"
+    s,^tests/,$testsbase/,
+    s,^top/,$destdir/,"
 
   # Create directories.
   for f in $files; do echo $f; done \
diff --git a/modules/GNUmakefile b/modules/GNUmakefile
new file mode 100644
index 0000000..a32c4d1
--- /dev/null
+++ b/modules/GNUmakefile
@@ -0,0 +1,32 @@
+Description:
+Add GNU-make specific rules for maintainer use.
+
+Files:
+top/GNUmakefile
+
+Depends-on:
+
+configure.ac:
+# Autoconf 2.61a.99 and earlier don't support linking a file only
+# in VPATH builds.  But since GNUmakefile is for maintainer use
+# only, it does not matter if we skip the link with older autoconf.
+# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+# builds, so use a shell variable to bypass this.
+GNUmakefile=GNUmakefile
+m4_if(m4_version_compare([2.61a.100],
+       m4_defn([m4_PACKAGE_VERSION])), [1], [],
+      [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
+       [GNUmakefile=$GNUmakefile])])
+
+Makefile.am:
+distclean-local: clean-GNUmakefile
+clean-GNUmakefile:
+       if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
+
+Include:
+
+License:
+GPLed build tool
+
+Maintainer:
+coreutils
diff --git a/modules/maintainer-makefile b/modules/maintainer-makefile
index f35cd23..c701cc6 100644
--- a/modules/maintainer-makefile
+++ b/modules/maintainer-makefile
@@ -2,8 +2,10 @@ Description:
 Helper GNUmakefile with syntax checks, build improvements, etc.
 
 Files:
-build-aux/GNUmakefile
-build-aux/maint.mk
+top/maint.mk
+
+Depends-on:
+GNUmakefile
 
 License:
 GPLed build tool
diff --git a/build-aux/GNUmakefile b/top/GNUmakefile
similarity index 100%
rename from build-aux/GNUmakefile
rename to top/GNUmakefile
diff --git a/build-aux/maint.mk b/top/maint.mk
similarity index 100%
rename from build-aux/maint.mk
rename to top/maint.mk
-- 
1.5.4


reply via email to

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