Tag
Hash :
902d3423
Author :
Date :
2002-07-11T20:10:39
Fix for PR automake/337: * automake.in: Redefine the `flags' attribute of each language as a list. List CPPFLAGS in `flags' when it is used. (register_language): Set the default value of 'flags'. (handle_single_transform_list): Adjust to treat `flags' as a list. (handle_languages): Likewise. Don't bother defining the configure variable for `c', this is always done since we trace configure.ac. * automake.texi (etags): Use per-executable _CPPFLAGS. (Program and Library Variables): Mention maude_CPPFLAGS. (Program variables): Likewise. * tests/specflags8.test: Use _CPPFLAGS instead of _CFLAGS. * tests/specflags9.test: New file. * tests/Makefile.am (TESTS): Add specflag9.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
#! /bin/sh
# Like the ctags/etags example from the manual,
# with one extra indirection in the sources (PR/315), and
# use of _CPPFLAGS (PR/337).
required=gcc
. $srcdir/defs || exit 1
set -e
cat >> configure.in << 'END'
AC_PROG_CC
AC_OUTPUT
END
# Using a separate variable to hold all the sources for a program is
# common when building many flavors of this program, each with
# different flags.
cat > Makefile.am << 'END'
ETAGSSOURCE = etags.c
bin_PROGRAMS = etags ctags
ctags_SOURCES = $(ETAGSSOURCE)
ctags_CPPFLAGS = -DCTAGS
etags_SOURCES = $(ETAGSSOURCE)
etags_CPPFLAGS = -DETAGS
END
cat > etags.c << 'END'
#include <stdio.h>
int
main (int argc, char *argv[])
{
#ifdef CTAGS
puts ("ctags");
#else
puts ("etags");
#endif
return 0;
}
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
$MAKE
./ctags | grep ctags
./etags | grep etags