+2010-06-21 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ New tests, exposing bugs in Automake Yacc/Lex support w.r.t.
+ $(AM_FLAGS) and $(FLAGS) precedence.
+ * tests/lflags.test: New test, check that user $(LFLAGS) takes
+ precedence over automake (AM_LFLAGS) and (foo_LFLAGS). Still
+ xfailing.
+ * tests/lflags2.test: Likewise.
+ * tests/yflags.test: New test, check that user $(YFLAGS) takes
+ precedence over automake (AM_YFLAGS) and (foo_YFLAGS). Still
+ xfailing.
+ * tests/yflags2.test: Likewise.
+ * tests/Makefile.am (TESTS, XFAIL_TESTS): Extended accordingly.
+
2010-06-20 Stefano Lattarini <stefano.lattarini@gmail.com>
Modernize, improve and extend tests `suffix*.test'.
auxdir2.test \
cond17.test \
gcj6.test \
-txinfo5.test
+txinfo5.test \
+lflags.test \
+lflags2.test \
+yflags.test \
+yflags2.test
include $(srcdir)/parallel-tests.am
lex3.test \
lex4.test \
lex5.test \
+lflags.test \
+lflags2.test \
libexec.test \
libobj2.test \
libobj3.test \
yacc8.test \
yaccpp.test \
yaccvpath.test \
+yflags.test \
+yflags2.test \
$(parallel_tests)
EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
auxdir2.test \
cond17.test \
gcj6.test \
-txinfo5.test
+txinfo5.test \
+lflags.test \
+lflags2.test \
+yflags.test \
+yflags2.test
parallel_tests = \
check-p.test \
lex3.test \
lex4.test \
lex5.test \
+lflags.test \
+lflags2.test \
libexec.test \
libobj2.test \
libobj3.test \
yacc8.test \
yaccpp.test \
yaccvpath.test \
+yflags.test \
+yflags2.test \
$(parallel_tests)
EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and
+# $(foo_LFLAGS).
+# Please keep this in sync with the sister tests lflags2.test, yflags.test
+# and yflags2.test
+
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-lex <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >lex.yy.c
+END
+chmod a+x fake-lex
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+# Simulate presence of Lex using our fake-lex script.
+AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex])
+AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
+AC_SUBST([LEXLIB], [''])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.c foo.l
+bar_SOURCES = main.c bar.l
+AM_LFLAGS = __am_flags__
+bar_LFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && Exit 1
+grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void){ return 0; }' > main.c
+: > foo.l
+: > bar.l
+
+$AUTOCONF
+./configure
+$MAKE LFLAGS=__user_flags__
+
+ls -l
+
+cat foo.c
+grep '__am_flags__.*__user_flags__' foo.c
+cat bar-bar.c
+grep '__bar_flags__.*__user_flags__' bar-bar.c
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and
+# $(foo_LFLAGS).
+# Please keep this in sync with the sister tests lflags.test, yflags.test
+# and yflags2.test
+
+required=g++ # FIXME: any working C++ compiler should be OK
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-lex <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >lex.yy.c
+END
+chmod a+x fake-lex
+
+cat >> configure.in <<'END'
+AC_PROG_CXX
+# Simulate presence of Lex using our fake-lex script.
+AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex])
+AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
+AC_SUBST([LEXLIB], [''])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.cc foo.ll
+bar_SOURCES = main.cc bar.l++
+AM_LFLAGS = __am_flags__
+bar_LFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && Exit 1
+grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void) { return 0; }' > main.cc
+: > foo.ll
+: > bar.l++
+
+$AUTOCONF
+./configure
+$MAKE LFLAGS=__user_flags__
+
+ls -l
+
+cat foo.cc
+grep '__am_flags__.*__user_flags__' foo.cc
+cat bar-bar.c++
+grep '__bar_flags__.*__user_flags__' bar-bar.c++
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and
+# $(foo_YFLAGS).
+# Please keep this in sync with the sister tests yflags2.test, lflags.test
+# and lflags2.test
+
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-yacc <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >y.tab.c
+END
+chmod a+x fake-yacc
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+# Simulate presence of Yacc using our fake-yacc script.
+AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.c foo.y
+bar_SOURCES = main.c bar.y
+AM_YFLAGS = __am_flags__
+bar_YFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && Exit 1
+grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void){ return 0; }' > main.c
+: > foo.y
+: > bar.y
+
+$AUTOCONF
+./configure
+$MAKE YFLAGS=__user_flags__
+
+ls -l
+
+cat foo.c
+grep '__am_flags__.*__user_flags__' foo.c
+cat bar-bar.c
+grep '__bar_flags__.*__user_flags__' bar-bar.c
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and
+# $(foo_YFLAGS).
+# Please keep this in sync with the sister tests yflags.test, lflags.test
+# and lflags2.test
+
+required=g++ # FIXME: any working C++ compiler should be OK
+. ./defs || Exit 1
+
+set -e
+
+cat >fake-yacc <<'END'
+#!/bin/sh
+echo '/*' "$*" '*/' >y.tab.c
+END
+chmod a+x fake-yacc
+
+cat >> configure.in <<'END'
+AC_PROG_CXX
+# Simulate presence of Yacc using our fake-yacc script.
+AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = main.cc foo.yy
+bar_SOURCES = main.cc bar.y++
+AM_YFLAGS = __am_flags__
+bar_YFLAGS = __bar_flags__
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && Exit 1
+grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && Exit 1
+
+echo 'int main(void) { return 0; }' > main.cc
+: > foo.yy
+: > bar.y++
+
+$AUTOCONF
+./configure
+$MAKE YFLAGS=__user_flags__
+
+ls -l
+
+cat foo.cc
+grep '__am_flags__.*__user_flags__' foo.cc
+cat bar-bar.c++
+grep '__bar_flags__.*__user_flags__' bar-bar.c++
+
+: