2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+ tests: drop useless requirements of gcc (plus testsuite tweakings)
+ * tests/libobj14.test ($required): Remove 'gcc', as we never run
+ the C compiler.
+ * tests/targetclash.test: Likewise.
+ * tests/ansi6.test ($required): Remove 'gcc', as any working
+ C compiler should be enough.
+ * tests/ansi7.test: Likewise.
+ * tests/ansi9.test: Likewise.
+ * tests/ansi10.test: Likewise.
+ * tests/lex5.test: Likewise.
+ * tests/lexvpath.test: Likewise.
+ * tests/mmodely.test: Likewise.
+ * tests/pr204.test: Likewise.
+ * tests/pr300-lib.test: Likewise.
+ * tests/pr300-prog.test: Likewise.
+ * tests/primary3.test: Likewise.
+ * tests/specflg7.test: Likewise.
+ * tests/specflg8.test: Likewise.
+ * tests/subdir5.test: Likewise.
+ * tests/subdir8.test: Likewise.
+ * tests/subobj6.test: Likewise.
+ * tests/subst3.test: Likewise.
+ * tests/substre2.test: Likewise.
+ * tests/yacc6.test: Likewise.
+ * tests/yacc8.test: Likewise.
+ * tests/depcomp2.test: Likewise. Also, avoid clobbering user-set
+ CFLAGS.
+ * tests/lex3.test: Likewise.
+ * tests/ansi3.test: Likewise. Also, avoid 'CC=gcc' in configure.
+ * tests/ansi3b.test: Likewise.
+ * tests/ansi5.test: Likewise.
+ * tests/autohdr4.test ($required): Remove 'gcc', as any working
+ C compiler should be enough.
+ Also, do not reject slow dependency extractors (which we might
+ be forced to use now that $CC is not necessarily gcc anymore).
+ * tests/cond16.test ($required): Remove 'gcc', as any working
+ C compiler should be enough.
+ Since we are at it, throw in few minor tweakings (mostly cosmetic,
+ stylistic, or consistency-related).
+ * tests/cond18.test: Likewise.
+ * tests/cond35.test: Likewise.
+ * tests/gnits2.test: Likewise.
+ * tests/libtool3.test: Likewise.
+ * tests/libtool7.test: Likewise.
+ * tests/libtool9.test: Likewise.
+ * tests/ltcond.test: Likewise.
+ * tests/ltcond2.test: Likewise.
+ * tests/ltconv.test: Likewise.
+ * tests/ltlibsrc.test: Likewise.
+ * tests/nobase.test: Likewise.
+ * tests/nobase-libtool.test: Likewise.
+ * tests/pr220.test: Likewise.
+ * tests/pr224.test: Likewise.
+ * tests/pr300-ltlib.test: Likewise.
+ * tests/pr401.test: Likewise.
+ * tests/pr401b.test: Likewise.
+ * tests/pr401c.test: Likewise.
+ * tests/subpkg.test: Likewise.
+ * tests/target-cflags.test: Likewise.
+ * tests/transform.test: Likewise.
+ * tests/yacc4.test: Likewise.
+ * tests/cond19.test: Likewise. Also, avoid clobbering user-set
+ CFLAGS.
+ * tests/cond4.test: Likewise.
+ * tests/depend2.test: Likewise.
+ * tests/pr87.test: Likewise.
+ * tests/subobj3.test: Likewise.
+ * tests/substref.test: Likewise.
+
+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
test defs: increase coverage w.r.t. GNU make
* tests/defs (GNUmake): Instead of just skipping the tests
requiring GNU make if $MAKE is not GNU make, try to look for
# Make sure ansi2knr works with $(LIBOBJS).
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Actual test of ansi2knr functionality. Relies on existence
-# of working gcc.
+# Actual test of ansi2knr functionality.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
}
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'Makefile.am:1:.*ansi2knr\.c' stderr
-CC='gcc' ./configure
+./configure
ANSI2KNR=./ansi2knr U=_ $MAKE -e
./hello
# of working gcc. Same as ansi3.test, but with AUTOMAKE_OPTIONS
# defined in configure.in.
-required=gcc
. ./defs || Exit 1
cat > configure.in << 'END'
}
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'configure.in:2:.*ansi2knr\.1' stderr
-CC='gcc' ./configure
+./configure
ANSI2KNR=./ansi2knr U=_ $MAKE -e
./hello
# Test for ansi2knr in another directory.
-required=gcc
. ./defs || Exit 1
cat > configure.in << 'END'
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-CC=gcc ./configure
+./configure
# This is ugly! If we set U at make time then the "wrong" file gets
# included.
# Check ansi2knr on a source file in subdirectory.
# From Kevin Ryde.
-required=gcc
. ./defs || Exit 1
cat > configure.in << 'END'
# ansi6.test is the same test without subdir-objects.
# From Kevin Ryde.
-required=gcc
. ./defs || Exit 1
cat > configure.in << 'END'
# can still be deansified.
# Report from Paul D. Smith.
-required=gcc
. ./defs || Exit 1
cat >>configure.in <<EOF
# Check rebuild rules for AC_CONFIG_HEADERS.
# (This should also work without GNU Make.)
-required=gcc
. ./defs || Exit 1
cat >>configure.in <<'EOF'
#include <config.h>
#include <stdio.h>
-int
-main ()
+int main (void)
{
puts (NAME); /* from config.h */
puts (PACKAGE); /* from defs.h */
$AUTOHEADER
$AUTOMAKE
-./configure
+# Do not reject slow dependency extractors: we need dependency tracking.
+./configure --enable-dependency-tracking
$MAKE
sub3/run | grep grepme1
sub3/run | grep grepme2
$MAKE distcheck
+
+:
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test for bug in conditionals in SOURCES with variable substitution references.
+# Test for bug in conditionals in SOURCES with variable substitution
+# references.
# Report from Richard Boulton
-required=gcc
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(hello.c)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([COND1], [true])
+AC_OUTPUT
END
-cat > hello.c << 'END'
-END
+: > hello.c
cat > Makefile.am << 'END'
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
val=`$MAKE -s echorule`;
-echo $val
test "x$val" = "xfoo.c foo.o"
+
+:
# Regression test for substitution references to conditional variables.
# Report from Richard Boulton
-required='GNUmake gcc'
+required=GNUmake
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
bin_PROGRAMS = helldl
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
val=`$MAKE --no-print-directory echorule`;
-echo $val
test "x$val" = "xdlmain.c foo.c dlmain.o foo.o"
+
+:
# Regression test for substitution references to conditional variables.
# Report from Richard Boulton
-required='GNUmake gcc'
+required=GNUmake
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(COND1, test "x$CONDITION1" = "xtrue")
-AM_CONDITIONAL(COND2, test "x$CONDITION2" = "xtrue")
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([COND1], [test "x$CONDITION1" = "xtrue"])
+AM_CONDITIONAL([COND2], [test "x$CONDITION2" = "xtrue"])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
bin_PROGRAMS = helldl
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
CONDITION1=false CONDITION2=false ./configure
vald=`$MAKE --no-print-directory echorule`;
-echo $vala
-echo $valb
-echo $valc
-echo $vald
-test "x$vala" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o" || Exit 1
-test "x$valb" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o" || Exit 1
-test "x$valc" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o" || Exit 1
-test "x$vald" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o" || Exit 1
+test "x$vala" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o"
+test "x$valb" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o"
+test "x$valc" = "xdlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o"
+test "x$vald" = "xdlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o"
+
+:
# Check rules output for parser defined conditionally.
# Report from Roman Fietze.
-required='flex yacc gcc'
+required='flex yacc'
. ./defs || Exit 1
cat >>configure.in <<'EOF'
-AM_CONDITIONAL([CASE_A], test -z "$case_B")
+AM_CONDITIONAL([CASE_A], [test -z "$case_B"])
AC_PROG_CC
AM_PROG_LEX
AC_PROG_YACC
foobar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
END
-cat >ta.c <<'END'
-int main()
+cat > ta.c << 'END'
+int main (void)
{
return 0;
}
./configure case_B=yes
$MAKE
$MAKE test-tb
+
+:
# Another sources-in-conditional test. Report from Tim Goodwin.
-required='GNUmake gcc'
+required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
$AUTOCONF
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
CONDITION1=true CONDITION2=true ./configure
msgtt=`$MAKE --no-print-directory echo-objects`
CONDITION1=true CONDITION2=false ./configure
# Test to make sure that depcomp is not used when it's not installed
# From Pavel Roskin.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
: > subdir/foo.c
-# Ignore user CFLAGS.
-unset CFLAGS || :
-
$ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
# --disable-dependency-tracking.
# Report from Robert Boehne
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
cat > hello.c << 'END'
#include "hello.h"
-int
-main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
printf ("yeah, yeah\n");
return 0;
$AUTOCONF
$AUTOMAKE -a
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
./configure --disable-dependency-tracking
-
$MAKE
+
+:
# Test to ensure std-options checking is correct.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
grep-stderr:
grep 'pfubar$(EXEEXT) does not support' stderr
grep 'pfubar3$(EXEEXT) does not support' stderr
- grep 'pscriptnok.sh does not support' stderr
+ grep 'pscriptnok\.sh does not support' stderr
## Only three failures please.
test `grep 'does not support --help' stderr | wc -l` = 3
test `grep 'does not support --version' stderr | wc -l` = 3
test ! -f ../inst-dir/bin/fine$(EXEEXT)
END
-echo 'int main () { return 0; }' > fubar.c
+cat > fubar.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
cat > fine.c << 'END'
#include <stdio.h>
-int
-main ()
+int main (void)
{
puts ("Which version? Which usage?");
return 0;
# Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
grep-stderr:
grep 'sub/pnok$(EXEEXT) does not support' stderr
- grep 'sub/pnok.sh does not support' stderr
+ grep 'sub/pnok\.sh does not support' stderr
## Only two failures please.
test `grep 'does not support --help' stderr | wc -l` = 2
test `grep 'does not support --version' stderr | wc -l` = 2
END
-echo 'int main () { return 0; }' > nok.c
+cat > nok.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
mkdir sub
# Test associated with PR 19.
# From Matthew D. Langston.
-required='gcc flex GNUmake'
+required='flex GNUmake'
. ./defs || Exit 1
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_LEX
# Test for subdir lexers.
-required='gcc GNUmake flex'
+required='GNUmake flex'
. ./defs || Exit 1
cat >> configure.in << 'END'
# Please keep this in sync with sister test `yaccvapth.test'.
-required='gcc flex'
+required=flex
. ./defs || Exit 1
cat > lexoutroot.in << 'END'
# that uses it.
# Report from Bill Davidson
-required=gcc
. ./defs || Exit 1
cat >>configure.in <<'EOF'
# Try to build and package a program linked to a Libtool library.
# Also make sure we do not bloat the Makefile with unneeded rules.
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >> configure.in << 'END'
int zero ();
int
-main ()
+main (void)
{
return zero ();
}
$MAKE
$MAKE distcheck
+
+:
# Make sure we allow Libtool's -dlopen/-dlpreopen
# Also check basic support for AM_LIBTOOLFLAGS/LIBTOOLFLAGS
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >> configure.in << 'END'
prg_SOURCES = prg.c
prg_LDADD = -dlopen libmod1.la -dlpreopen mod2.la
+.PHONY: print
print:
@echo 1BEG: $(prg_DEPENDENCIES) :END1
@echo 2BEG: $(libmod1_la_DEPENDENCIES) :END2
mkdir sub liba
cat > sub/mod1.c << 'END'
-int
-mod1 ()
+int mod1 (void)
{
return 1;
}
END
cat > mod2.c << 'END'
-int
-mod2 ()
+int mod2 (void)
{
return 2;
}
END
cat > prg.c << 'END'
-int
-main ()
+int main (void)
{
return 0;
}
env LIBTOOLFLAGS=--silent $MAKE uninstall >output 2>&1
cat output
grep 'silent.*silent.*libmod1' output
+
+:
# Make sure xxx_LINK is defined for each target that requires specific
# flags.
-# Quite similar to libtool7.test, using AM_LDFLAGS in addition to xxx_LDFLAGS.
+# Quite similar to libtool7.test, using AM_LDFLAGS in addition to
+# xxx_LDFLAGS.
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >> configure.in << 'END'
mkdir liba
cat > mod1.c << 'END'
-int
-mod1 ()
+int mod1 (void)
{
return 1;
}
END
cat > mod2.c << 'END'
-int
-mod2 ()
+int mod2 (void)
{
return 2;
}
END
cat > prg.c << 'END'
-int
-main ()
+int main (void)
{
return 0;
}
grep '6BEG:.* prg2_cflags cflags .*am_ldflags ldflags.* :END6' output
grep '6BEG: .*am_cflags.* :END6' output && Exit 1
$MAKE
+
+:
# Test for conditional libtool libraries.
# This combines two examples from the manual.
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >>configure.in <<'END'
test ! -f lib1bar.la
test ! -f lib2foo.la
test ! -f lib3foo.la
+
+:
# Test for bug in conditionals.
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
AC_SUBST([HELLO_SYSTEM], [hello-generic.lo])
-AM_CONDITIONAL([LINUX], true)
+AM_CONDITIONAL([LINUX], [true])
AC_OUTPUT
END
: > check-ok
END
-echo 'char* str() { return "hello-linux"; }' >hello-linux.c
-echo 'char* str() { return "hello-generic"; }' >hello-generic.c
-cat >hello-common.c <<'END'
+cat > hello-linux.c <<'END'
+const char* str (void)
+{
+ return "hello-linux";
+}
+END
+
+cat > hello-generic.c <<'END'
+const char* str (void)
+{
+ return "hello-generic";
+}
+END
+
+cat > hello-common.c <<'END'
#include <stdio.h>
-char* str();
-void print()
+const char* str (void);
+void print (void)
{
puts (str ());
}
END
-echo 'int main() { print(); return 0; }' >main.c
+
+cat > main.c <<'END'
+int main (void)
+{
+ print();
+ return 0;
+}
+END
libtoolize
$ACLOCAL
./configure
$MAKE check
test -f check-ok
+
+:
# Test for libtool convenience libraries.
# This example is taken from the manual.
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >>configure.in <<'END'
AC_PROG_CC
AC_PROG_LIBTOOL
-AC_CONFIG_FILES(sub1/Makefile
- sub2/Makefile
- sub2/sub21/Makefile
- sub2/sub22/Makefile)
+AC_CONFIG_FILES([sub1/Makefile
+ sub2/Makefile
+ sub2/sub21/Makefile
+ sub2/sub22/Makefile])
AC_OUTPUT
END
echo 'int sub22 () { return 22; }' > sub2/sub22/sub22.c
-cat >test.c <<EOF
+cat >test.c <<'EOF'
#include <stdio.h>
int main ()
{
test 0 = `wc -l < lib.lst`
find bin -type f -print > bin.lst
test 0 = `wc -l < bin.lst`
+
+:
# Test to make sure a sensible default source for libraries is used.
-required='libtool gcc'
+required=libtool
. ./defs || Exit 1
cat >> configure.in << 'END'
END
cat > foo.c << 'END'
-int foo (void) { return 0; }
+int foo (void)
+{
+ return 0;
+}
END
cp foo.c zoo.d/bar.c
$ACLOCAL
$AUTOCONF
AUTOMAKE_fails -a
-grep 'Makefile.am:2:.*old_la.c' stderr
-grep 'Makefile.am:2:.*old.c' stderr
-grep 'Makefile.am:3:.*zoo_d_old2_la.c' stderr
-grep 'Makefile.am:3:.*zoo\.d/old2.c' stderr
+grep '^Makefile\.am:2:.*old_la\.c' stderr
+grep '^Makefile\.am:2:.*old\.c' stderr
+grep '^Makefile\.am:3:.*zoo_d_old2_la\.c' stderr
+grep '^Makefile\.am:3:.*zoo\.d/old2\.c' stderr
$AUTOMAKE -Wno-obsolete
test -f zoo.d/old2.la
$MAKE distcheck
+
+:
# sources in maintainer mode.
# From Derek R. Price.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
# This is just the libtool equivalent of nobase.test, split
# up for greater exposure of nobase.test.
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >> configure.in <<'EOF'
test -f inst/foo/sub/libnobase.la
test ! -f inst/foo/libnobase.la
test -f inst/foo/libbase.la
+
+.PHONY: test-install-exec test-install-data
EOF
mkdir sub
$MAKE test-install-exec
$MAKE uninstall
test `find inst/foo -type f -print | wc -l` = 0
+
+:
# Make sure nobase_* works.
-required='gcc'
. ./defs || Exit 1
cat >> configure.in <<'EOF'
test -f inst/foo/sub/libnobase.a
test ! -f inst/foo/libnobase.a
test -f inst/foo/libbase.a
+
+.PHONY: test-install-exec test-install-data
EOF
mkdir sub
$MAKE test-install-exec
$MAKE uninstall
test `find inst/foo -type f -print | wc -l` = 0
+
+:
# For PR 204.
# Sources derived from nodist_ sources should not be distributed.
-required='yacc gcc'
+required=yacc
. ./defs || Exit 1
cat >> configure.in <<'EOF'
# to debug the problem.
# Note that this should be also in the documentation.
-required=gcc
. ./defs || Exit 1
-cat > main.c <<'EOF'
-int main() { return 0; }
+cat > main.c << 'EOF'
+int main (void)
+{
+ return 0;
+}
EOF
cat > Makefile.am << 'EOF'
cat >> configure.in << 'EOF'
AC_PROG_CC
-AC_ARG_ENABLE(foo,
+AC_ARG_ENABLE([foo],
[ --enable-foo Enable foo],
[ if test "foo" = "bar" ; then
- AM_CONDITIONAL(NEVER_TRUE, true)
+ AM_CONDITIONAL([NEVER_TRUE], [true])
else
- AM_CONDITIONAL(NEVER_TRUE, false)
+ AM_CONDITIONAL([NEVER_TRUE], [false])
fi
])
AC_OUTPUT
# `$(top_srcdir)/build', the location of the `.deps' directory
# should be `$(top_builddir)/bar/.deps'.
-required=gcc
. ./defs || Exit 1
mkdir foo
cat >foo/main.c <<'EOF'
-int main() { return 0; }
+int main (void)
+{
+ return 0;
+}
EOF
cat >Makefile.am <<'EOF'
# Make sure that installing subdirectory libraries works.
# PR/300
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
# Make sure that installing subdirectory libtool libraries works.
# PR/300
-required='libtoolize gcc'
+required=libtoolize
. ./defs || Exit 1
cat >> configure.in << 'END'
int i = 3;
END
-## A rule in the Makefile should create subdir
-# mkdir subdir
-
libtoolize
$ACLOCAL
$AUTOCONF
./configure --prefix "`pwd`/inst"
-$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+# A rule in the Makefile should create subdir.
+test ! -d subdir
+$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
+test -d subdir
grep 'liba.la .*-rpath .*lib' stdout
grep 'liba.la .*-rpath .*lib/subdir' stdout && Exit 1
# Make sure that installing subdirectory programs works.
# PR/300
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
# Check support for AC_CONFIG_LIBOBJ_DIR vs LIBOBJS.
# (pr401b.test and pr401c.test do the same for LTLIBOBJS and ALLOCA)
-required=gcc
. ./defs || Exit 1
mkdir lib src
cat >lib/feep.c <<'EOF'
-char *
-feep ()
+const char *feep (void)
{
return "feep";
}
cat >src/main.c <<'EOF'
#include <stdio.h>
-extern char *feep ();
+extern const char *feep (void);
-int
-main (int argc, char **argv)
+int main (void)
{
puts (feep ());
return 0;
# Check support for AC_CONFIG_LIBOBJ_DIR vs LTLIBOBJS.
# (pr401.test and pr401c.test do the same for LIBOBJS and ALLOCA)
-required='gcc libtoolize'
+required=libtoolize
. ./defs || Exit 1
mkdir lib src
cat >lib/feep.c <<'EOF'
-char *
-feep ()
+const char *feep (void)
{
return "feep";
}
cat >src/main.c <<'EOF'
#include <stdio.h>
-extern char *feep ();
+extern const char *feep (void);
-int
-main (int argc, char **argv)
+int main (void)
{
puts (feep ());
return 0;
./configure
$MAKE distcheck
-
-## ------------------------------------------ ##
-## Traditional LIBOBJS with LIBOBJDIR set. ##
-## ------------------------------------------ ##
+## ----------------------------------------- ##
+## Traditional LTLIBOBJS with LIBOBJDIR set. ##
+## ----------------------------------------- ##
# Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
# unrelated to Automake or Makefile.am layout.
# Check support for AC_CONFIG_LIBOBJ_DIR vs ALLOCA.
# (pr401.test and pr401b.test do the same for LIBOBJS and LTLIBOBJS)
-required=gcc
. ./defs || Exit 1
mkdir lib src
export ac_cv_func_alloca_works
cat >lib/alloca.c <<'EOF'
-char *
-feep ()
+const char *feep (void)
{
return "feep";
}
cat >src/main.c <<'EOF'
#include <stdio.h>
-extern char *feep ();
+extern const char *feep (void);
-int
-main (int argc, char **argv)
+int main (void)
{
puts (feep ());
return 0;
$MAKE distcheck
-## ------------------------------------------ ##
-## Traditional LIBOBJS with LIBOBJDIR set. ##
-## ------------------------------------------ ##
+## --------------------------------------- ##
+## Traditional ALLOCA with LIBOBJDIR set. ##
+## --------------------------------------- ##
# Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
# unrelated to Automake or Makefile.am layout.
# Test for PR automake/87.
# "make distcheck" fails when two source dirs exist.
-required=gcc
. ./defs || Exit 1
subdirs="foo bar"
for i in $subdirs; do
mkdir $i
- cat >$i/$i.c <<EOF
-int main() { return 0; }
+ unindent >$i/$i.c <<EOF
+ int main (void)
+ {
+ return 0;
+ }
EOF
- cat >$i/Makefile.am <<EOF
-bin_PROGRAMS = $i
-${i}_SOURCES = $i.c
+ unindent >$i/Makefile.am <<EOF
+ bin_PROGRAMS = $i
+ ${i}_SOURCES = $i.c
EOF
done
AC_OUTPUT(Makefile `echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`)
EOF
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
mkdir build
$ACLOCAL
if test -z "$next"; then
Exit 1
else
- : # for shells with broken 'set -e'
+ : # For shells with broken 'set -e'.
fi
break
fi
# Make sure we can build programs ending in `.la'
-required=gcc
. ./defs || Exit 1
cat >>configure.in <<EOF
# The true/false example from the manual, plus a check for _SHORTNAME.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
./false | grep false
test -f ./t-false.o
test -f ./f-false.o
+
+:
# with one extra indirection in the sources (PR/315), and
# use of _CPPFLAGS (PR/337).
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
$MAKE
./true | grep true
./false | grep false
+
+:
# This test assumes that the `make' utility is able to start
# over and reload Makefiles which have been remade (a non-POSIX feature).
# See also the related test subdir8.test.
-required='GNUmake gcc'
+required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
# This test assumes that the `make' utility is able to start
# over and reload Makefiles which have been remade (a non-POSIX feature).
# See also the related test subdir5.test.
-required='GNUmake gcc'
+required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test of subdir objects with C++.
+# Test of subdir objects with ansi2knr.
-required=gcc
. ./defs || Exit 1
cat > configure.in << END
}
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
# Test of subdir make distclean rules.
# From Robert Collins
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
# Check subpackage handling.
-required='gcc yacc'
+required=yacc
. ./defs || Exit 1
mkdir m4
EOF
cat >LDADD.c <<'EOF'
-int lib ();
+int lib (void);
-int
-main ()
+int main (void)
{
return lib ();
}
cat >lib/src/x.c <<'EOF'
#include <config.h>
-int lib ()
+int lib (void)
{
return 0;
}
$MAKE distcheck
test ! -d subpack-1 # make sure distcheck cleans up after itself
test -f subpack-1.tar.gz
+
+:
# Test installation with substitutions. This test is based on nobase.test.
-required='gcc'
. ./defs || Exit 1
cat >> configure.in <<'EOF'
$MAKE
$MAKE test-install-nothing-data
$MAKE test-install-nothing-exec
+
+:
# Test for bug in variable substitution references, where
# undefined variables break later substitutions.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
# pattern is null.
# Report from Richard Boulton
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
END
cat > Makefile.am << 'END'
-
var1 = dlmain
-
var2 = $(var1:=.)
-
helldl_SOURCES = $(var2:=c)
-
bin_PROGRAMS = helldl
-
got:
@echo $(helldl_SOURCES) $(helldl_OBJECTS) >got
-
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
# Test to make sure target specific CFLAGS work
# Assar Westerlund <assar@sics.se>
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
cat > foo.c << 'END'
#include <stdio.h>
#ifdef FOO
-int main(void) {
+int main(void)
+{
return 0;
}
#endif
# Check that target clashes are diagnosed.
-required=gcc
. ./defs || Exit 1
cat >> configure.in << 'END'
# Make sure that --program-transform works.
-required=gcc
. ./defs || Exit 1
cat >>configure.in <<'END'
bin_SCRIPTS = h.sh
man_MANS = h.1
+.PHONY: test-install
test-install: install
test -f inst/bin/gnu-h$(EXEEXT)
test -f inst/bin/gnu-h.sh
EOF
cat >h.c <<'EOF'
-int
-main ()
+int main (void)
{
return 0;
}
$MAKE installdirs
test -d inst/bin
test -d inst/man/man1
+
+:
# Some simple tests of ylwrap functionality.
-required='yacc gcc'
+required=yacc
. ./defs || Exit 1
cat >> configure.in << 'END'
# Second parser.
cat > bar.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%%
END
cat > foo.c << 'END'
-int main () { return 0; }
+int main (void)
+{
+ return 0;
+}
END
$ACLOCAL
# Test for subdir parsers.
-required="gcc yacc"
+required=yacc
. ./defs || Exit 1