Tag
Hash :
a598e3dc
Author :
Date :
2002-04-24T07:36:00
Fix PR automake/315: * automake.in (subobjname): Rewrite to generate variable name unique for each content. (%substnums): Remove. (%subobjvar): New hash. (initialize_per_input): Clear %subobjvar. (define_objects_from_sources): Return the name of the variable defined, in addition to the linker. Call subobjname only once the content of the variable to define is known. (handle_source_transform): Adjust call to define_objects_from_sources. * tests/specflags8.test: Mention PR 315. * tests/subobjname.test: New file. * tests/Makefile.am (XFAIL_TESTS): Remove specflags8.test. (TESTS): Add subobjname.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
#! /bin/sh
# Like the ctags/etags example from the manual,
# with one extra indirection in the sources.
# PR 315.
. $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_CFLAGS = -DCTAGS
etags_SOURCES = $(ETAGSSOURCE)
etags_CFLAGS = -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