Author :
Pavel Roskin
Date :
2001-02-22 18:49:50
Hash :bc0292f1 Message :* tests/target-cflags.test: Don't use subshell to configure in
subdirectory. Typo fix - run `./foo', not `/foo'.
tests/target-cflags.test
#! /bin/sh
# Test to make sure target specific CFLAGS work
# Assar Westerlund <assar@sics.se>
. $srcdir/defs || exit 1
cat > configure.in << 'END'
AC_INIT(foo.c)
AM_INIT_AUTOMAKE(target-cflags,0.0)
AC_PROG_CC
AC_OUTPUT(Makefile)
END
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = foreign no-dependencies
bin_PROGRAMS = foo bar
foo_CFLAGS = -DFOO
END
cat > foo.c << 'END'
#include <stdio.h>
#ifdef FOO
int main(void) {
return 0;
}
#endif
END
cat > bar.c << 'END'
#ifndef FOO
int main(void)
{
return 0;
}
#endif
END
# Fail gracefully if no autoconf.
$needs_autoconf
# Likewise for gcc.
(gcc -v) > /dev/null 2>&1 || exit 77
# Likewise for GNU make.
($MAKE --version) > /dev/null 2>&1 || exit 77
set -e
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
mkdir obj
cd obj
../configure
$MAKE
./foo
./bar
cd ..
./configure
$MAKE
./foo
./bar