autoconf
[Top][All Lists]
Advanced

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

Re: [Adam Heath <address@hidden>] Bug#98991: AC_COPYRIGHT when used in a


From: Akim Demaille
Subject: Re: [Adam Heath <address@hidden>] Bug#98991: AC_COPYRIGHT when used in aclocal.m4 generates incorrect shell code
Date: 06 Jun 2001 10:50:02 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (GTK)

Hi People,

First of all, using macros before AC_INIT is not supported.  But

/tmp % echo 'AC_COPYRIGHT(FOO)AC_INIT' > configure.ac            nostromo Err 1
/tmp % ace                                                       nostromo 10:48
/tmp % ./configure                                               nostromo 10:48
/tmp % ./configure --version                                     nostromo 10:48

Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.

FOO



I'm applying this.

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        Invoking AC_COPYRIGHT before AC_INIT fails.

        * Makefile.am (.m4.m4f): Pass --fatal-warnings to m4.
        * acgeneral.m4 (_m4_divert(VERSION_FSF))
        (_m4_divert(VERSION_USER)): New.
        (AC_COPYRIGHT): $2 is the diversion to use.
        (_AC_INIT_COPYRIGHT): Use the FSF diversion.
        (AC_INIT): Remove dead comments as now it's commutative.

Index: Makefile.am
===================================================================
RCS file: /cvs/autoconf/Makefile.am,v
retrieving revision 1.51
diff -u -u -r1.51 Makefile.am
--- Makefile.am 2001/06/02 16:00:08 1.51
+++ Makefile.am 2001/06/06 08:45:00
@@ -178,7 +178,8 @@
 # It may happen that the output does not end with a end of line, hence
 # force an end of line when reporting errors.
 .m4.m4f:
-       $(M4) -I $(srcdir) -D divert $(srcdir)/$*.m4 | \
+       $(M4) --include $(srcdir) --fatal-warning --define divert \
+             $(srcdir)/$*.m4 | \
          sed 's/#.*//;/^$$/d' >process.log
        if grep . process.log >/dev/null 2>&1; then \
          echo "Processing $(srcdir)/$*.m4 produced output:" >&2; \
@@ -188,7 +189,8 @@
        else \
          rm -f process.log; \
        fi
-       $(M4) -I $(srcdir) --freeze-state=$*.m4f $(srcdir)/$*.m4 >freeze.log
+       $(M4) --include $(srcdir) --fatal-warning --freeze-state=$*.m4f \
+             $(srcdir)/$*.m4 >freeze.log
        if grep . freeze.log >/dev/null 2>&1; then \
          echo "Freezing $(srcdir)/$*.m4 produced output:" >&2; \
          sed "s,^,$(srcdir)/$*.m4: ," < freeze.log >&2; \
Index: Makefile.in
===================================================================
RCS file: /cvs/autoconf/Makefile.in,v
retrieving revision 1.133
diff -u -u -r1.133 Makefile.in
--- Makefile.in 2001/06/02 16:00:08 1.133
+++ Makefile.in 2001/06/06 08:45:00
@@ -481,7 +481,8 @@
 # It may happen that the output does not end with a end of line, hence
 # force an end of line when reporting errors.
 .m4.m4f:
-       $(M4) -I $(srcdir) -D divert $(srcdir)/$*.m4 | \
+       $(M4) --include $(srcdir) --fatal-warning --define divert \
+             $(srcdir)/$*.m4 | \
          sed 's/#.*//;/^$$/d' >process.log
        if grep . process.log >/dev/null 2>&1; then \
          echo "Processing $(srcdir)/$*.m4 produced output:" >&2; \
@@ -491,7 +492,8 @@
        else \
          rm -f process.log; \
        fi
-       $(M4) -I $(srcdir) --freeze-state=$*.m4f $(srcdir)/$*.m4 >freeze.log
+       $(M4) --include $(srcdir) --fatal-warning --freeze-state=$*.m4f \
+             $(srcdir)/$*.m4 >freeze.log
        if grep . freeze.log >/dev/null 2>&1; then \
          echo "Freezing $(srcdir)/$*.m4 produced output:" >&2; \
          sed "s,^,$(srcdir)/$*.m4: ," < freeze.log >&2; \
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.728
diff -u -u -r1.728 acgeneral.m4
--- acgeneral.m4 2001/06/05 12:44:13 1.728
+++ acgeneral.m4 2001/06/06 08:45:04
@@ -91,7 +91,11 @@
 #   Tail of the handling of --help.
 #
 # - VERSION_BEGIN
-#   Copyright notice for --version.
+#   Head of the handling of --version.
+# - VERSION_FSF
+#   FSF copyright notice for --version.
+# - VERSION_USER
+#   User copyright notice for --version.
 # - VERSION_END
 #   Tail of the handling of --version.
 #
@@ -124,7 +128,9 @@
 m4_define([_m4_divert(HELP_END)],       16)
 
 m4_define([_m4_divert(VERSION_BEGIN)],  20)
-m4_define([_m4_divert(VERSION_END)],    21)
+m4_define([_m4_divert(VERSION_FSF)],    21)
+m4_define([_m4_divert(VERSION_USER)],   22)
+m4_define([_m4_divert(VERSION_END)],    23)
 
 m4_define([_m4_divert(INIT_PREPARE)],   30)
 
@@ -449,8 +455,8 @@
 ])
 
 
-# AC_COPYRIGHT(TEXT)
-# ------------------
+# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER])
+# ------------------------------------------------------
 # Append Copyright information in the top of `configure'.  TEXT is
 # evaluated once, hence TEXT can use macros.  Note that we do not
 # prepend `# ' but address@hidden:@ ', since m4 does not evaluate the comments.
@@ -463,7 +469,7 @@
 [m4_divert_text([NOTICE],
 [m4_patsubst([
 $1], [^], address@hidden:@ ])])dnl
-m4_divert_text([VERSION_BEGIN],
+m4_divert_text(m4_default([$2], [VERSION_USER]),
 [
 $1])dnl
 ])# AC_COPYRIGHT
@@ -542,12 +548,15 @@
 
 # _AC_INIT_COPYRIGHT
 # ------------------
+# We dump to VERSION_FSF to make sure we are inserted *before* the
+# user copyrights.
 m4_define([_AC_INIT_COPYRIGHT],
 [AC_COPYRIGHT(
 [Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.])dnl
+gives unlimited permission to copy, distribute and modify it.],
+              [VERSION_FSF])dnl
 ])
 
 
@@ -1410,8 +1419,6 @@
 _AC_INIT_VERSION
 _AC_INIT_CONFIG_LOG
 _AC_INIT_PREPARE
-dnl _AC_INIT_COPYRIGHT must be called after _AC_INIT_VERSION, since
-dnl it dumps into a diversion prepared by _AC_INIT_VERSION.
 _AC_INIT_NOTICE
 _AC_INIT_COPYRIGHT
 m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl



reply via email to

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