bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool: new option --makefile-name


From: Paul Eggert
Subject: Re: gnulib-tool: new option --makefile-name
Date: Mon, 28 Aug 2006 12:41:53 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> This patch adds an option --makefile-name that does this.

Thanks for doing that.  I plan to change coreutils to use it.  But
first, I found a problem when gnulib-tool is invoked without
--makefile-name, as the makefile name defaulted to the empty string
when bootstrapping coreutils because makefile_name was initialized to
''.  Also, there are a few places that say "Makefile.am" even though
the file might have a different name now.  I installed this fix:

2006-08-28  Paul Eggert  <address@hidden>

        * gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
        into output, since the output might be called Makefile.am even
        if $makefile_name is something different.
        (func_import): Use $makefile_am rather than
        ${makefile_name-Makefile.am}, to fix a bug where makefile_name was
        empty.

--- gnulib-tool 28 Aug 2006 15:22:55 -0000      1.149
+++ gnulib-tool 28 Aug 2006 19:38:58 -0000
@@ -102,7 +102,7 @@ Operation modes:
       --extract-filelist           extract the list of files
       --extract-dependencies       extract the dependencies
       --extract-autoconf-snippet   extract the snippet for configure.ac
-      --extract-automake-snippet   extract the snippet for lib/Makefile.am
+      --extract-automake-snippet   extract the snippet for library makefile
       --extract-include-directive  extract the #include directive
       --extract-license            report the license terms of the source files
                                    under lib/
@@ -1026,7 +1026,7 @@ func_modules_to_filelist ()
 }
 
 # func_emit_lib_Makefile_am
-# emits the contents of lib/Makefile.am to standard output.
+# emits the contents of library makefile to standard output.
 # Input:
 # - local_gnulib_dir  from --local-dir
 # - modules         list of modules, including dependencies
@@ -1114,13 +1114,11 @@ func_emit_lib_Makefile_am ()
   echo "             echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
   echo "           fi; \\"
   echo "         done"
-  echo
-  echo "# ${makefile_name-Makefile.am} ends here"
   rm -f allsnippets.tmp
 }
 
 # func_emit_tests_Makefile_am
-# emits the contents of tests/Makefile.am to standard output.
+# emits the contents of tests makefile to standard output.
 # Input:
 # - local_gnulib_dir  from --local-dir
 # - modules         list of modules, including dependencies
@@ -1203,8 +1201,6 @@ func_emit_tests_Makefile_am ()
   echo "             echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
   echo "           fi; \\"
   echo "         done"
-  echo
-  echo "# ${makefile_name-Makefile.am} ends here"
   rm -f allsnippets.tmp
 }
 
@@ -1663,8 +1659,14 @@ func_import ()
   actioncmd="$actioncmd --macro-prefix=$macro_prefix"
   actioncmd="$actioncmd `echo $specified_modules`"
 
-  # Create lib/Makefile.am.
-  makefile_am=${makefile_name-Makefile.am}
+  # Default the makefile name to Makefile.am.
+  if test -n "$makefile_name"; then
+    makefile_am=$makefile_name
+  else
+    makefile_am=Makefile.am
+  fi
+
+  # Create library makefile.
   func_dest_tmpfilename $sourcebase/$makefile_am
   func_emit_lib_Makefile_am > "$tmpfile"
   if test -f "$destdir"/$sourcebase/$makefile_am; then
@@ -1865,8 +1867,7 @@ func_import ()
   fi
 
   if test -n "$inctests"; then
-    # Create tests/Makefile.am.
-    makefile_am=${makefile_name-Makefile.am}
+    # Create tests makefile.
     func_dest_tmpfilename $testsbase/$makefile_am
     func_emit_tests_Makefile_am > "$tmpfile"
     if test -f "$destdir"/$testsbase/$makefile_am; then
@@ -1922,25 +1923,25 @@ func_import ()
   ) | sed -e '/^$/d;' -e 's/^/  /'
   echo
   echo "Don't forget to"
-  if test "${makefile_name-Makefile.am}" = Makefile.am; then
+  if test "$makefile_am" = Makefile.am; then
     echo "  - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in 
$configure_ac,"
   else
     echo "  - \"include $makefile_name\" from within 
\"$sourcebase/Makefile.am\","
   fi
   if test -n "$inctests"; then
-    if test "${makefile_name-Makefile.am}" = Makefile.am; then
+    if test "$makefile_am" = Makefile.am; then
       echo "  - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in 
$configure_ac,"
     else
       echo "  - \"include $makefile_name\" from within 
\"$testsbase/Makefile.am\","
     fi
   fi
-  if test "${makefile_name-Makefile.am}" = Makefile.am; then
+  if test "$makefile_am" = Makefile.am; then
     sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'`
     sourcebase_base=`basename "$sourcebase"`
     echo "  - mention \"${sourcebase_base}\" in SUBDIRS in 
${sourcebase_dir}Makefile.am,"
   fi
   if test -n "$inctests"; then
-    if test "${makefile_name-Makefile.am}" = Makefile.am; then
+    if test "$makefile_am" = Makefile.am; then
       testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'`
       testsbase_base=`basename "$testsbase"`
       echo "  - mention \"${testsbase_base}\" in SUBDIRS in 
${testsbase_dir}Makefile.am,"




reply via email to

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