]> sourceware.org Git - automake.git/commitdiff
* automake.texi (Conditional Programs): Show a sample Makefile.am.
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 19 Jan 2003 15:19:26 +0000 (15:19 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 19 Jan 2003 15:19:26 +0000 (15:19 +0000)
Remind $(EXEEXT) must be appended to configure substitutions.
Show how Automake conditionals can be used instead.
* tests/exeext.test (check_PROGRAMS): Make sure EXEEXT is also
appended to conditionally defined programs.

ChangeLog
automake.texi
stamp-vti
tests/exeext.test
version.texi

index fb07b35eff985f01f306488faa3a30549c90b3c2..ce469c48a2726780762138455de1c4b54d40280f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-19  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.texi (Conditional Programs): Show a sample Makefile.am.
+       Remind $(EXEEXT) must be appended to configure substitutions.
+       Show how Automake conditionals can be used instead.
+       * tests/exeext.test (check_PROGRAMS): Make sure EXEEXT is also
+       appended to conditionally defined programs.
+
 2003-01-16  Jim Meyering  <jim@meyering.net>
 
        Accept --help and --version, and lots of syntactic clean-up.
index e01d300d0d7ba4b6b5b6201c1f4cd14243a58880..49505d5b371e651d140eec3a715cbe50e1ac0b56 100644 (file)
@@ -2252,12 +2252,16 @@ endif
 
 @node Conditional Programs,  , Conditional Sources, A Program
 @subsection Conditional compilation of programs
+@cindex Conditional programs
+@cindex Programs, conditional
 
-Sometimes it is useful to determine the programs that are to be built at
-configure time.  For instance, GNU @code{cpio} only builds @code{mt} and
-@code{rmt} under special circumstances.
+Sometimes it is useful to determine the programs that are to be built
+at configure time.  For instance, GNU @code{cpio} only builds
+@code{mt} and @code{rmt} under special circumstances.  The means to
+achieve conditional compilation of programs are the same you can use
+to compile source files conditionally: substitutions or conditionals.
 
-@cindex EXTRA_PROGRAMS, defined
+@subsubsection Conditional programs using @code{configure} substitutions
 
 In this case, you must notify Automake of all the programs that can
 possibly be built, but at the same time cause the generated
@@ -2266,9 +2270,37 @@ This is done by having @code{configure} substitute values into each
 @samp{_PROGRAMS} definition, while listing all optionally built programs
 in @code{EXTRA_PROGRAMS}.
 @vindex EXTRA_PROGRAMS
+@cindex EXTRA_PROGRAMS, defined
+
+@example
+bin_PROGRAMS = cpio pax $(MT)
+libexec_PROGRAMS = $(RMT)
+EXTRA_PROGRAMS = mt rmt
+@end example
 
-Of course you can use Automake conditionals to determine the programs to
-be built.
+As explained in @ref{EXEEXT}, Automake will rewrite
+@code{bin_PROGRAMS}, @code{libexec_PROGRAMS}, and
+@code{EXTRA_PROGRAMS}, appending @code{$(EXEEXT)} to each binary.
+Obviously it cannot rewrite values obtained at run-time through
+@code{configure} substitutions, therefore you should take care of
+appending @code{$(EXEEXT)} yourself, as in @code{AC_SUBST([MT],
+['mt$@{EXEEXT@}'])}.
+
+@subsubsection Conditional programs using Automake conditionals
+
+You can also use Automake conditionals (@pxref{Conditionals}) to
+select programs to be built.  In this case you don't have to worry
+about @code{$(EXEEXT)} or @code{EXTRA_PROGRAMS}.
+
+@example
+bin_PROGRAMS = cpio pax
+if WANT_MT
+  bin_PROGRAMS += mt
+endif
+if WANT_RMT
+  libexec_PROGRAMS = rmt
+endif
+@end example
 
 
 @node A Library, A Shared Library, A Program, Programs
index d406b529b4f94819d31fc0a69ed4b2bab39c07a3..4aceec33a3d311309fa519c6a1d8b118cd8249fa 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 9 January 2003
+@set UPDATED 19 January 2003
 @set UPDATED-MONTH January 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
index df4b74ec478b10728f8cea6eb1afc5f69b08377b..f3b3ccd9e50a132fb18c4ae69a974b252cbb5e73 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
 
 # Test to make sure `.' in an exe name doesn't fool us.
 # Report from Robert Collins.
+# Also make sure we rewrite conditionals variables.
 
 . ./defs || exit 1
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AC_EXEEXT
+AM_CONDITIONAL([WANT_MT], [:])
+AM_CONDITIONAL([WANT_RMT], [:])
 END
 
 cat > Makefile.am << 'END'
 ## Use a different dir for each to make grep easy.
-bin_PROGRAMS = maude 
+bin_PROGRAMS = maude
 sbin_PROGRAMS = maude.static
 ## We don't define this one for now.  Probably it is an error.
 ## noinst_PROGRAMS = maude2.exe
 check_PROGRAMS = maude3$(EXEEXT)
+
+if WANT_MT
+  bin_PROGRAMS += mt
+endif
+if WANT_RMT
+  libexec_PROGRAMS = rmt
+endif
 END
 
 set -e
@@ -50,3 +59,9 @@ grep 'sbin_PROGRAMS =.*maude\.static$(EXEEXT)' Makefile.in
 
 grep '^maude3$(EXEEXT):' Makefile.in
 grep 'check_PROGRAMS =.*maude3$(EXEEXT)' Makefile.in
+
+grep '^mt$(EXEEXT):' Makefile.in
+grep '@WANT_MT_TRUE@bin_PROGRAMS =.* mt$(EXEEXT)' Makefile.in
+
+grep '^rmt$(EXEEXT):' Makefile.in
+grep '@WANT_RMT_TRUE@libexec_PROGRAMS =.*rmt$(EXEEXT)' Makefile.in
index d406b529b4f94819d31fc0a69ed4b2bab39c07a3..4aceec33a3d311309fa519c6a1d8b118cd8249fa 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 9 January 2003
+@set UPDATED 19 January 2003
 @set UPDATED-MONTH January 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
This page took 0.044582 seconds and 5 git commands to generate.