Author :
Tom Tromey
Date :
2000-02-02 04:29:02
Hash :5a096ac0 Message :2000-02-02 Assar Westerlund <assar@sics.se>
* automake.in (handle_single_transform_list): do not use $< which
is not handled by all non-GNU makes. Instead do explicit sh code
testing for the file in this directory and srcdir. Based on a
suggestion by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
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.
(autoconf --version) > /dev/null 2>&1 || exit 0
# Likewise for gcc.
(gcc -v) > /dev/null 2>&1 || exit 0
$ACLOCAL \
&& autoconf \
&& $AUTOMAKE -a \
&& mkdir obj \
&& (cd obj && ../configure && $MAKE && ./foo && ./bar) \
&& ./configure && $MAKE && ./foo && ./bar