automake-patches
[Top][All Lists]
Advanced

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

Re: am_init_automake-vs-ac_init.patch


From: Alexandre Duret-Lutz
Subject: Re: am_init_automake-vs-ac_init.patch
Date: 08 Jan 2002 22:59:29 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:

[...]

 adl> - if there are three arguments, the third argument means that 
 adl> PACKAGE and VERSION should not be defined, as in the past.
 adl> - if there is one argument, this argument is taken to be a 
 adl> space-separated list of Automake options: some of them
 adl> (`no-define') are meaningful to AM_INIT_AUTOMAKE, the others
 adl> are ignored by AM_INIT_AUTOMAKE but interpreted as global
 adl> options by Automake.
 adl> - AM_AUTOMAKE_OPTIONS support can be removed.

Here we go.  Is the doc clear enough?

Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1717
diff -u -r1.1717 ChangeLog
--- ChangeLog   2002/01/08 21:14:47     1.1717
+++ ChangeLog   2002/01/08 21:51:50
@@ -1,3 +1,26 @@
+2002-01-08  Alexandre Duret-Lutz  <address@hidden>
+
+       * automake.texi (Complete, Macros, Options): Document the new style
+       AM_INIT_AUTOMAKE.  Remove AM_AUTOMAKE_OPTIONS documentaion.
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Get PACKAGE and VERSION from
+       AC_INIT if they are available there.  Support a new call form
+       where the only argument is an optional space-separated list of
+       Automake options.
+       * m4/options.m4 (AM_AUTOMAKE_OPTIONS): Remove.
+       (_AM_MANGLE_OPTION, _AM_SET_OPTION, _AM_SET_OPTIONS,
+       _AM_IF_OPTION): New functions.
+       * automake.in (AC_INIT_PATTERN): New variable.
+       (global_options_line): Remove, use $seen_init_automake instead.
+       (scan_one_autoconf_file, scan_autoconf_traces): Set $package_version
+       from AC_INIT if available.  Support the new style AM_INIT_AUTOMAKE.
+       Remove the AM_AUTOMAKE_OPTIONS handling.
+       * configure.in: Modernize.
+       * tests/defs (configure.in): Modernize.  One third of the tests
+       still overwrite the default configure.in and use an old
+       AM_INIT_AUTOMAKE call,  so that makes testing for both.
+       * tests/nodefine.test, tests/nodefine2.test: New files.
+       * tests/Makefile.am (TESTS): Add them.
+
 2002-01-08  Raja R Harinath  <address@hidden>
 
        * automake.in (define_configure_variable): Propagate line numbers.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.165
diff -u -r1.165 NEWS
--- NEWS        2002/01/01 22:01:07     1.165
+++ NEWS        2002/01/08 21:51:55
@@ -1,4 +1,4 @@
-New in 1.5b:
+New in 1.5c:
 * Autoconf 2.52 is required.
 * `dist' generates all the archive flavors, as did `dist-all'.
 * `dist-gzip' generates the Gzip tar file only.
@@ -19,8 +19,11 @@
 * Fixed handling of nobase_ targets.
 * Fixed support of implicit rules leading to .lo objects.
 * Fixed late inclusion of --add-missing files (e.g. depcomp) in DIST_COMMON
-* Added new AM_AUTOMAKE_OPTIONS macro
 * Added uninstall-hook target
+* `AC_INIT AM_INIT_AUTOMAKE(package,version)' is an obsolete construct.
+  You can now use `AC_INIT(package,version) AM_INIT_AUTOMAKE' instead.
+  It is also possible to pass a list of global Automake options as
+  first argument to this new form of AM_INIT_AUTOMAKE.
 
 New in 1.5:
 * Support for `configure.ac'.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1260
diff -u -r1.1260 automake.in
--- automake.in 2002/01/08 21:14:46     1.1260
+++ automake.in 2002/01/08 21:52:21
@@ -161,6 +161,7 @@
 # makes indentation work better in Emacs.
 my $AC_CONFIG_AUX_DIR_PATTERN = 'AC_CONFIG_AUX_DIR\(([^)]+)\)';
 my $AM_INIT_AUTOMAKE_PATTERN = 'AM_INIT_AUTOMAKE\([^,]*,([^,)]+)[,)]';
+my $AC_INIT_PATTERN = 'AC_INIT\([^,]*,([^,)]+)[,)]';
 my $AM_PACKAGE_VERSION_PATTERN = '^\s*\[?([^]\s]+)\]?\s*$';
 
 # This handles substitution references like ${foo:.a=.b}.
@@ -393,7 +394,7 @@
 # TRUE if we've seen AM_PROG_CC_C_O
 my $seen_cc_c_o = 0;
 
-# TRUE if we've seen AM_INIT_AUTOMAKE.
+# Where AM_INIT_AUTOMAKE is called;
 my $seen_init_automake = 0;
 
 # TRUE if we've seen AM_AUTOMAKE_VERSION.
@@ -457,10 +458,8 @@
 # should distribute depcomp -- has been generated.)
 my $automake_needs_to_reprocess_all_files = 0;
 
-# Options set via AM_AUTOMAKE_OPTIONS.
+# Options set via AM_INIT_AUTOMAKE.
 my $global_options = '';
-# Line number for AM_AUTOMAKE_OPTIONS.
-my $global_options_line;
 
 
 
@@ -1444,7 +1443,7 @@
               || $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
               || $_ eq 'readme-alpha' || $_ eq 'check-news'
               || $_ eq 'subdir-objects' || $_ eq 'nostdinc'
-              || $_ eq 'no-exeext')
+              || $_ eq 'no-exeext' || $_ eq 'no-define')
        {
            # Explicitly recognize these.
        }
@@ -1464,12 +1463,12 @@
        {
            if ($config)
            {
-               file_error ($global_options_line,
+               file_error ($seen_init_automake,
                            "option `" . $_ . "\' not recognized");
            }
            else
            {
-               macro_error ('AUTOMAKE_OPTIONS',
+               macro_error ('AM_INIT_AUTOMAKE',
                             "option `" . $_ . "\' not recognized");
            }
            return 1;
@@ -4495,17 +4494,17 @@
                  AC_CANONICAL_SYSTEM
                  AC_CONFIG_AUX_DIR
                  AC_CONFIG_FILES
+                 AC_INIT
                  AC_LIBSOURCE
-                 AC_PROG_LIBTOOL AM_PROG_LIBTOOL
                  AC_PROG_LEX
+                 AC_PROG_LIBTOOL AM_PROG_LIBTOOL
                  AC_SUBST
+                 AM_AUTOMAKE_VERSION
                  AM_CONDITIONAL
                  AM_CONFIG_HEADER
                  AM_C_PROTOTYPES
                  AM_GNU_GETTEXT
                  AM_INIT_AUTOMAKE
-                 AM_AUTOMAKE_OPTIONS
-                 AM_AUTOMAKE_VERSION
                  AM_MAINTAINER_MODE
                  AM_PATH_LISPDIR
                  AM_PATH_PYTHON
@@ -4552,6 +4551,14 @@
          $ac_config_files_location = $here;
          &scan_autoconf_config_files ($args[1]);
        }
+      elsif ($macro eq 'AC_INIT')
+        {
+         if (defined $args[2])
+           {
+             $package_version = $args[2];
+             $package_version_location = $here;
+           }
+       }
       elsif ($macro eq 'AC_LIBSOURCE')
        {
          $libsources{$args[1]} = $here;
@@ -4571,6 +4578,17 @@
          $configure_vars{$args[1]} = $here
            if $args[1] =~ /^\w+$/;
        }
+      elsif ($macro eq 'AM_AUTOMAKE_VERSION')
+        {
+         file_error ($here,
+                     "version mismatch.  This is Automake $VERSION,\n" .
+                     "but the definition used by this AM_INIT_AUTOMAKE\n" .
+                     "comes from Automake $args[1].  You should recreate\n" .
+                     "aclocal.m4 with aclocal and run automake again.\n")
+             if ($VERSION ne $args[1]);
+
+         $seen_automake_version = 1;
+        }
       elsif ($macro eq 'AM_CONDITIONAL')
        {
          $configure_cond{$args[1]} = $here;
@@ -4591,26 +4609,17 @@
        }
       elsif ($macro eq 'AM_INIT_AUTOMAKE')
        {
-         $package_version = $args[2];
-         $package_version_location = $here;
-         $seen_init_automake = 1;
-       }
-      elsif ($macro eq 'AM_AUTOMAKE_OPTIONS')
-        {
-         $global_options = $args[1];
-         $global_options_line = $here;
+         $seen_init_automake = $here;
+         if (defined $args[2])
+           {
+             $package_version = $args[2];
+             $package_version_location = $here;
+           }
+         elsif (defined $args[1])
+           {
+             $global_options = $args[1];
+           }
        }
-      elsif ($macro eq 'AM_AUTOMAKE_VERSION')
-        {
-         file_error ($here,
-                     "version mismatch.  This is Automake $VERSION,\n" .
-                     "but the definition used by this AM_INIT_AUTOMAKE\n" .
-                     "comes from Automake $args[1].  You should recreate\n" .
-                     "aclocal.m4 with aclocal and run automake again.\n")
-             if ($VERSION ne $args[1]);
-
-         $seen_automake_version = 1;
-        }
       elsif ($macro eq 'AM_MAINTAINER_MODE')
        {
          $seen_maint_mode = $here;
@@ -4839,18 +4848,26 @@
              }
          }
 
-        # This macro handles several different things.
-        if (/$AM_INIT_AUTOMAKE_PATTERN/o)
+       # AM_INIT_AUTOMAKE with any number of argument
+       if (/AM_INIT_AUTOMAKE/)
        {
-           ($package_version = $1) =~ s/$AM_PACKAGE_VERSION_PATTERN/$1/o;
-           $package_version_location = $here;
            $seen_init_automake = $here;
+        }
+
+       # AC_INIT or AM_INIT_AUTOMAKE with two arguments
+        if (/$AC_INIT_PATTERN/o || /$AM_INIT_AUTOMAKE_PATTERN/o)
+       {
+            if ($1 =~ /$AM_PACKAGE_VERSION_PATTERN/o)
+            {
+               $package_version = $1;
+               $package_version_location = $here;
+           }
        }
 
-       if (/AM_AUTOMAKE_OPTIONS\(([^)]+)\)/)
+       # AM_INIT_AUTOMAKE with one argument.
+       if (/AM_INIT_AUTOMAKE\(([^),]+)\)/)
        {
             $global_options = &unquote_m4_arg ($1);
-            $global_options_line = $here;
        }
 
        if (/AM_AUTOMAKE_VERSION\(([^)]+)\)/)
@@ -5012,14 +5029,14 @@
     {
        if (-f 'aclocal.m4')
        {
-           file_error ($package_version_location || $me,
+           file_error ($seen_init_automake || $me,
                        "your implementation of AM_INIT_AUTOMAKE comes from " .
                        "an\nold Automake version.  You should recreate " .
                        "aclocal.m4\nwith aclocal and run automake again.\n");
        }
        else
        {
-           file_error ($package_version_location || $me,
+           file_error ($seen_init_automake || $me,
                        "no proper implementation of AM_INIT_AUTOMAKE was " .
                        "found,\nprobably because aclocal.m4 is missing...\n" .
                        "You should run aclocal to create this file, then\n" .
Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.258
diff -u -r1.258 automake.texi
--- automake.texi       2002/01/06 20:23:30     1.258
+++ automake.texi       2002/01/08 21:52:39
@@ -617,7 +617,9 @@
 @code{AM_INIT_AUTOMAKE} call just after @code{AC_INIT}:
 
 @example
-AM_INIT_AUTOMAKE(zardoz, 1.0)
+AC_INIT(zardoz, 1.0)
+AM_INIT_AUTOMAKE
+...
 @end example
 
 Since your program doesn't have any complicating factors (e.g., it
@@ -686,6 +688,7 @@
 @cindex Hello, configure.in
 
 Here is the @file{configure.in} from GNU Hello:
address@hidden FIXME: This definitively requires an update.
 
 @example
 dnl Process this file with autoconf to produce a configure script.
@@ -1329,11 +1332,6 @@
 @c consider generating this node automatically from m4 files.
 
 @table @code
address@hidden AM_AUTOMAKE_OPTIONS
-This takes a single argument which is a list of options which should be
-applied to every @file{Makefile.am} in the tree.  The effect is as if
-each option were listed in @code{AUTOMAKE_OPTIONS}.
-
 @item AM_CONFIG_HEADER
 Automake will generate rules to automatically regenerate the config
 header.
@@ -1369,12 +1367,42 @@
 found in @file{<termios.h>}.
 @cvindex AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
 
address@hidden AM_INIT_AUTOMAKE
address@hidden AM_INIT_AUTOMAKE([OPTIONS])
address@hidden AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 Runs many macros that most @file{configure.in}'s need.  This macro has
-two required arguments, the package and the version number.  By default
-this macro @code{AC_DEFINE}'s @samp{PACKAGE} and @samp{VERSION}.  This
-can be avoided by passing in a non-empty third argument.
+two forms, the second of which has two required arguments: the package
+and the version number.  This latter form is obsolete because the
address@hidden and @var{version} are now arguments of the @samp{AC_INIT}
+Autoconf macro, and Automake can get this information from there.
+
+If your @file{configure.in} has:
address@hidden
+AC_INIT(src/foo.c)
+AM_INIT_AUTOMAKE(mumble, 1.5)
address@hidden example
+you can modernize it as follow:
address@hidden
+AC_INIT(mumble, 1.5)
+AC_CONFIG_SRCDIR(src/foo.c)
+AM_INIT_AUTOMAKE
address@hidden example
 
+If this macro is called with a single argument, it is interpreted as a
+space-separated list of Automake options which should be applied to
+every @file{Makefile.am} in the tree.  The effect is as if each option
+were listed in @code{AUTOMAKE_OPTIONS}.
+
+By default this macro @code{AC_DEFINE}'s @samp{PACKAGE} and
address@hidden  This can be avoided by passing the @samp{no-define}
+option, as in:
address@hidden
+AM_INIT_AUTOMAKE([gnits 1.5 no-define dist-bzip2])
address@hidden example
+or by passing a third non-empty argument to the obsolete form.
+
address@hidden PACKAGE, prevent definition
address@hidden VERSION, prevent definition
+
 @item AM_MAKE_INCLUDE
 This macro is used to discover how the user's @code{make} handles
 @code{include} statements.  This macro is automatically invoked when
@@ -3850,8 +3878,12 @@
 @chapter Changing Automake's Behavior
 
 Various features of Automake can be controlled by options in the
address@hidden  Such options are listed in a special variable named
address@hidden  Currently understood options are:
address@hidden  Such options are applied on a address@hidden
+basis when listed in a special @file{Makefile} variable named
address@hidden  They are applied globally to all processed
address@hidden when listed in the first argument of
address@hidden in @file{configure.in}.  Currently understood
+options are:
 @vindex AUTOMAKE_OPTIONS
 
 @table @asis
@@ -3912,6 +3944,12 @@
 the distribution.  @code{dist} will create it in addition to the other
 formats.
 @trindex dist-tarZ
+
address@hidden @code{no-define}
address@hidden Option, no-define
+This options is meaningful only when passed as an argument to
+AM_INIT_AUTOMAKE.  It will prevent the @code{PACKAGE} and @code{VERSION}
+variable to be @code{AC_DEFINE}d.
 
 @item @code{no-dependencies}
 @cindex Option, no-dependencies
Index: configure.in
===================================================================
RCS file: /cvs/automake/automake/configure.in,v
retrieving revision 1.97
diff -u -r1.97 configure.in
--- configure.in        2002/01/07 21:10:26     1.97
+++ configure.in        2002/01/08 21:52:45
@@ -24,8 +24,7 @@
 AC_CONFIG_SRCDIR(automake.in)
 AC_CONFIG_AUX_DIR(lib)
 
-AM_INIT_AUTOMAKE(automake, 1.5c)
-AM_AUTOMAKE_OPTIONS([1.5 dist-bzip2])
+AM_INIT_AUTOMAKE([1.5 dist-bzip2])
 
 # $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
 # hence `.' is really what we want for perllibdir and libdir.
Index: m4/init.m4
===================================================================
RCS file: /cvs/automake/automake/m4/init.m4,v
retrieving revision 1.36
diff -u -r1.36 init.m4
--- init.m4     2002/01/07 20:25:24     1.36
+++ init.m4     2002/01/08 21:52:48
@@ -21,7 +21,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
-# serial 7
+# serial 8
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -36,8 +36,17 @@
 # the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
 
-# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
-# ----------------------------------------------
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  AC_REQUIRE([AC_PROG_INSTALL])dnl
@@ -47,13 +56,20 @@
   AC_MSG_ERROR([source directory already configured; run "make distclean" 
there first])
 fi
 
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+  [m4_ifval([$3],, [_AM_SET_OPTION([no-define])])],
+  [_AM_SET_OPTIONS([$1])])dnl
+
 # Define the identity of the package.
-AC_SUBST([PACKAGE], [$1])dnl
-AC_SUBST([VERSION], [$2])dnl
-ifelse([$3],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+AC_SUBST([PACKAGE],
+[m4_ifset([AC_PACKAGE_TARNAME], [AC_PACKAGE_TARNAME], [$1])])dnl
+AC_SUBST([VERSION],
+[m4_ifset([AC_PACKAGE_VERSION], [AC_PACKAGE_VERSION], [$2])])dnl
 
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
Index: m4/options.m4
===================================================================
RCS file: /cvs/automake/automake/m4/options.m4,v
retrieving revision 1.1
diff -u -r1.1 options.m4
--- options.m4  2001/12/31 00:16:37     1.1
+++ options.m4  2002/01/08 21:52:48
@@ -1,6 +1,6 @@
-# Do all the work for Automake.                            -*- Autoconf -*-
+# Helper functions for option handling.                    -*- Autoconf -*-
 
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2002  Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,11 +17,27 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
-# serial 1
+# serial 2
 
-# AM_AUTOMAKE_OPTIONS([OPTIONS])
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
 # ------------------------------
-# Set some automake options globally.
-AC_DEFUN([AM_AUTOMAKE_OPTIONS],
-[dnl nothing
-])
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_if(_AM_MANGLE_OPTION([$1]), 1, [$2], [$3])])
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.367
diff -u -r1.367 Makefile.am
--- Makefile.am 2002/01/02 16:01:22     1.367
+++ Makefile.am 2002/01/08 21:52:48
@@ -216,6 +216,8 @@
 nobase.test \
 nodep.test \
 nodepcomp.test \
+nodefine.test \
+nodefine2.test \
 nodist.test \
 nodist2.test \
 noinst.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.475
diff -u -r1.475 Makefile.in
--- Makefile.in 2002/01/07 20:25:24     1.475
+++ Makefile.in 2002/01/08 21:52:48
@@ -288,6 +288,8 @@
 nobase.test \
 nodep.test \
 nodepcomp.test \
+nodefine.test \
+nodefine2.test \
 nodist.test \
 nodist2.test \
 noinst.test \
Index: tests/defs
===================================================================
RCS file: /cvs/automake/automake/tests/defs,v
retrieving revision 1.42
diff -u -r1.42 defs
--- defs        2002/01/07 20:25:24     1.42
+++ defs        2002/01/08 21:52:48
@@ -53,8 +53,8 @@
 # still produces a valid configure.ac.  But then, tests running
 # config.status really need to append AC_OUTPUT.
 cat > configure.in << END
-AC_INIT
-AM_INIT_AUTOMAKE($me, 1.0)
+AC_INIT($me, 1.0)
+AM_INIT_AUTOMAKE
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_CONFIG_FILES(Makefile)
Index: tests/nodefine.test
===================================================================
RCS file: nodefine.test
diff -N nodefine.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ nodefine.test       Tue Jan  8 13:52:48 2002
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Make sure that PACKAGE and VERSION are AC_DEFINEd when requested.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+# -------------------------------------------------------------------
+# Do not upgrade this file to use the modern AC_INIT/AM_INIT_AUTOMAKE
+# forms.  The day these obsolete AC_INIT and AM_INIT_AUTOMAKE forms
+# are dropped, just erase the file.
+# nodefine2.test contains the modern version of this test.
+# -------------------------------------------------------------------
+
+# First, check that PACKAGE and VERSION are output by default.
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN])
+AC_OUTPUT(output)
+END
+
+echo 'DEFS = @DEFS@' > output.in
+
+$ACLOCAL
+$AUTOCONF
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output
+
+# Then, check that PACKAGE and VERSION are not output if requested.
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN], [no])
+AC_OUTPUT(output)
+END
+
+$ACLOCAL
+$AUTOCONF
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output || exit 1
+:
Index: tests/nodefine2.test
===================================================================
RCS file: nodefine2.test
diff -N nodefine2.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ nodefine2.test      Tue Jan  8 13:52:48 2002
@@ -0,0 +1,40 @@
+#! /bin/sh
+# Make sure that PACKAGE and VERSION are AC_DEFINEd when requested.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+# First, check that PACKAGE and VERSION are output by default.
+
+cat > configure.in << 'END'
+AC_INIT([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN])
+AM_INIT_AUTOMAKE
+AC_OUTPUT(output)
+END
+
+echo 'DEFS = @DEFS@' > output.in
+
+$ACLOCAL
+$AUTOCONF
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output
+
+# Then, check that PACKAGE and VERSION are not output if requested.
+
+cat > configure.in << 'END'
+AC_INIT([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN])
+AM_INIT_AUTOMAKE([no-define])
+AC_OUTPUT(output Makefile)
+END
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE   # Dummy call to make sure Automake grok `no-define' silently.
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output || exit 1
+:

-- 
Alexandre Duret-Lutz



reply via email to

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