changeset 6180:a0904de304e5

Separate the generates files into cvs-committable files and frequently changing files.
author Bruno Haible <bruno@clisp.org>
date Wed, 31 Aug 2005 20:53:42 +0000
parents 76e367ba26d3
children 95b89dc3f638
files ChangeLog gnulib-tool
diffstat 2 files changed, 67 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-28  Bruno Haible  <bruno@clisp.org>
+
+	* gnulib-tool (func_import): Generate two files gnulib-cache.m4 and
+	gnulib-comp.m4 instead of a single gnulib.m4, to make it easy for
+	projects that don't keep autogenerated files in CVS. Put into
+	actioncmd only the specified modules, not the transitive closure.
+
 2005-08-28  Bruno Haible  <bruno@clisp.org>
 
 	* gnulib-tool (func_import): Require AC_GNU_SOURCE etc. instead of
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2005-08-31 20:52:14 $'
+cvsdatestamp='$Date: 2005-08-31 20:53:42 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 
@@ -758,6 +758,7 @@
 {
   modules="$1"
   modules=`for m in $modules; do echo $m; done | sort | uniq`
+  specified_modules="$modules"
 
   # Determine final module list.
   func_modules_transitive_closure
@@ -817,7 +818,7 @@
   if test -n "$lgpl"; then
     opt_lgpl="--lgpl"
   fi
-  actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base --aux-dir=$auxdir $opt_libtool $opt_lgpl `echo $modules`"
+  actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base --aux-dir=$auxdir $opt_libtool $opt_lgpl `echo $specified_modules`"
 
   # Create lib/Makefile.am.
   echo "Creating $destdir/$sourcebase/Makefile.am..."
@@ -829,13 +830,13 @@
   func_mv_if_changed "$destdir"/$sourcebase/Makefile.am.new \
                      "$destdir"/$sourcebase/Makefile.am
 
-  # Create gnulib.m4.
-  echo "Creating $destdir/$m4base/gnulib.m4..."
+  # Create m4/gnulib-cache.m4.
+  echo "Creating $destdir/$m4base/gnulib-cache.m4..."
   (
     if test -z "$dry_run"; then
-      exec > "$destdir"/$m4base/gnulib.m4.new
+      exec > "$destdir"/$m4base/gnulib-cache.m4.new
     else
-      echo "# $destdir/$m4base/gnulib.m4"
+      echo "# $destdir/$m4base/gnulib-cache.m4"
     fi
     echo "# Copyright (C) 2004 Free Software Foundation, Inc."
     echo "# This file is free software, distributed under the terms of the GNU"
@@ -846,8 +847,51 @@
     echo "#"
     echo "# Generated by gnulib-tool."
     echo "#"
-    echo "# Invoked as: $cmd"
-    echo "# Reproduce by: $actioncmd"
+    echo "# This file represents the specification of how gnulib-tool is used."
+    echo "# It acts as a cache: It is written and read by gnulib-tool."
+    echo "# In projects using CVS, this file is meant to be stored in CVS,"
+    echo "# like the configure.ac and various Makefile.am files."
+    echo
+    echo
+    echo "# Specification in the form of a command-line invocation:"
+    echo "#   $actioncmd"
+    echo
+    echo "# Specification in the form of a few gnulib-tool.m4 macro invocations:"
+    echo "gl_MODULES([$specified_modules])"
+    echo "gl_AVOID([$avoidlist])"
+    echo "gl_SOURCE_BASE([$sourcebase])"
+    echo "gl_M4_BASE([$m4base])"
+    echo "gl_LIB([$libname])"
+    test -z "$lgpl" || echo "gl_LGPL"
+    test -z "$libtool" || echo "gl_LIBTOOL"
+    echo "gl_MACRO_PREFIX([$macro_prefix])"
+    echo
+    echo "# gnulib-cache.m4 ends here"
+  )
+  func_mv_if_changed "$destdir"/$m4base/gnulib-cache.m4.new "$destdir"/$m4base/gnulib-cache.m4
+
+  # Create m4/gnulib-comp.m4.
+  echo "Creating $destdir/$m4base/gnulib-comp.m4..."
+  (
+    if test -z "$dry_run"; then
+      exec > "$destdir"/$m4base/gnulib-comp.m4.new
+    else
+      echo "# $destdir/$m4base/gnulib-comp.m4"
+    fi
+    echo "# Copyright (C) 2004 Free Software Foundation, Inc."
+    echo "# This file is free software, distributed under the terms of the GNU"
+    echo "# General Public License.  As a special exception to the GNU General"
+    echo "# Public License, this file may be distributed as part of a program"
+    echo "# that contains a configuration script generated by Autoconf, under"
+    echo "# the same distribution terms as the rest of that program."
+    echo "#"
+    echo "# Generated by gnulib-tool."
+    echo "#"
+    echo "# This file represents the compiled summary of the specification in"
+    echo "# gnulib-cache.m4. It lists the computed macro invocations that need"
+    echo "# to be invoked from configure.ac."
+    echo "# In projects using CVS, this file can be treated like other built files."
+    echo
     echo
     echo "# This macro should be invoked from $configure_ac, in the section"
     echo "# \"Checks for programs\", right after AC_PROG_CC, and certainly before"
@@ -880,9 +924,15 @@
     done
     echo "])"
     echo
-    echo "# gnulib.m4 ends here"
+    echo "# This macro records the list of files which have been installed by"
+    echo "# gnulib-tool and may be removed by future gnulib-tool invocations."
+    echo "AC_DEFUN([${macro_prefix}_FILE_LIST], ["
+    echo "$files" | sed -e 's,^,  ,'
+    echo "])"
+    echo
+    echo "# gnulib-comp.m4 ends here"
   )
-  func_mv_if_changed "$destdir"/$m4base/gnulib.m4.new "$destdir"/$m4base/gnulib.m4
+  func_mv_if_changed "$destdir"/$m4base/gnulib-comp.m4.new "$destdir"/$m4base/gnulib-comp.m4
   echo "Finished."
   echo
   echo "You may need to add #include directives for the following .h files."