| 1 | #! /bin/sh
|
|---|
| 2 | # Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
|---|
| 3 | #
|
|---|
| 4 | # This file is part of GNU Automake.
|
|---|
| 5 | #
|
|---|
| 6 | # GNU Automake is free software; you can redistribute it and/or modify
|
|---|
| 7 | # it under the terms of the GNU General Public License as published by
|
|---|
| 8 | # the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | # any later version.
|
|---|
| 10 | #
|
|---|
| 11 | # GNU Automake is distributed in the hope that it will be useful,
|
|---|
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | # GNU General Public License for more details.
|
|---|
| 15 | #
|
|---|
| 16 | # You should have received a copy of the GNU General Public License
|
|---|
| 17 | # along with autoconf; see the file COPYING. If not, write to
|
|---|
| 18 | # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|---|
| 19 | # Boston, MA 02111-1307, USA.
|
|---|
| 20 |
|
|---|
| 21 | # Regression test for bug when sources listed in conditional.
|
|---|
| 22 | # Report from Richard Boulton. PR/326.
|
|---|
| 23 |
|
|---|
| 24 | . ./defs || exit 1
|
|---|
| 25 |
|
|---|
| 26 | set -e
|
|---|
| 27 |
|
|---|
| 28 | cat >> configure.in << 'END'
|
|---|
| 29 | AC_PROG_CC
|
|---|
| 30 | AM_CONDITIONAL(ONE, true)
|
|---|
| 31 | AM_CONDITIONAL(TWO, false)
|
|---|
| 32 | AM_CONDITIONAL(THREE, false)
|
|---|
| 33 | AC_OUTPUT
|
|---|
| 34 | END
|
|---|
| 35 |
|
|---|
| 36 | cat > Makefile.am << 'END'
|
|---|
| 37 | bin_PROGRAMS = targ
|
|---|
| 38 |
|
|---|
| 39 | if ONE
|
|---|
| 40 | SONE = one.c
|
|---|
| 41 | endif
|
|---|
| 42 |
|
|---|
| 43 | if TWO
|
|---|
| 44 | STWO =
|
|---|
| 45 | else
|
|---|
| 46 | STWO = two.c
|
|---|
| 47 | endif
|
|---|
| 48 |
|
|---|
| 49 | if THREE
|
|---|
| 50 | STHREE =
|
|---|
| 51 | else
|
|---|
| 52 | STHREE = three.c
|
|---|
| 53 | endif
|
|---|
| 54 |
|
|---|
| 55 | if THREE
|
|---|
| 56 | STHREE2 =
|
|---|
| 57 | else
|
|---|
| 58 | STHREE2 = three2.c
|
|---|
| 59 | endif
|
|---|
| 60 |
|
|---|
| 61 | targ_SOURCES = $(SONE) $(STWO) $(STHREE) $(STHREE2)
|
|---|
| 62 |
|
|---|
| 63 | echo:
|
|---|
| 64 | echo BEG: $(targ_OBJECTS) :END;
|
|---|
| 65 | END
|
|---|
| 66 |
|
|---|
| 67 | $ACLOCAL
|
|---|
| 68 | $AUTOCONF
|
|---|
| 69 | $AUTOMAKE
|
|---|
| 70 | ./configure
|
|---|
| 71 | OBJEXT=oo $MAKE -e echo > output
|
|---|
| 72 | cat output
|
|---|
| 73 | $FGREP 'BEG: one.oo two.oo three.oo three2.oo :END' output
|
|---|