From 530ff19b839bd193b17c3f697d1dfe43384a48da Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 12 May 2001 12:36:02 +0000 Subject: [PATCH] * automake.in (&handle_single_transform_list): Simplify computation of $object and $this_obj_ext. * tests/lex3.test: Merge into... * tests/lex.test: here. * tests/pr19.test: Improve and rename as... * tests/lex3.test: this. --- ChangeLog | 9 +++++++ automake.in | 13 ++-------- tests/Makefile.am | 1 - tests/lex.test | 15 +++++++++--- tests/lex3.test | 62 ++++++++++++++++++++++++++++++++++++++--------- tests/pr19.test | 50 -------------------------------------- 6 files changed, 74 insertions(+), 76 deletions(-) delete mode 100755 tests/pr19.test diff --git a/ChangeLog b/ChangeLog index 5bd5ab61..1338ae4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-05-12 Akim Demaille + + * automake.in (&handle_single_transform_list): Simplify + computation of $object and $this_obj_ext. + * tests/lex3.test: Merge into... + * tests/lex.test: here. + * tests/pr19.test: Improve and rename as... + * tests/lex3.test: this. + 2001-05-09 Tom Tromey * automake.in (read_am_file): Correctly compute $saw_bk. diff --git a/automake.in b/automake.in index 50eb7a5d..e1707e80 100755 --- a/automake.in +++ b/automake.in @@ -1767,17 +1767,8 @@ sub handle_single_transform_list ($$$@) # Now extract linker and other info. $linker = $lang->linker; - my $this_obj_ext; - if ($lang->ansi) - { - $object = $base . $obj; - $this_obj_ext = $obj; - } - else - { - $object = $base . $nonansi_obj; - $this_obj_ext = $nonansi_obj; - } + my $this_obj_ext = $lang->ansi ? $obj : $nonansi_obj; + $object = $base . $this_obj_ext; if (defined $lang->flags && &variable_defined ($derived . '_' . $lang->flags)) diff --git a/tests/Makefile.am b/tests/Makefile.am index 2583ee4d..0a2a455d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -207,7 +207,6 @@ pluseq8.test \ ppf77.test \ pr2.test \ pr9.test \ -pr19.test \ pr72.test \ pr87.test \ prefix.test \ diff --git a/tests/lex.test b/tests/lex.test index 0c965214..6fdfd23f 100755 --- a/tests/lex.test +++ b/tests/lex.test @@ -1,10 +1,9 @@ #! /bin/sh -# Test to make sure that lex source generates correct target. - . $srcdir/defs || exit 1 cat >> configure.in << 'END' +AC_INIT AC_PROG_CC AM_PROG_LEX END @@ -20,4 +19,14 @@ END $ACLOCAL || exit 1 $AUTOMAKE || exit 1 -grep '\$(LEX)' Makefile.in + +# Test to make sure that lex source generates correct target. + +fgrep '$(LEX)' Makefile.in || exit 1 + +# Test to make sure that lex source generates correct clean rule. +# From Ralf Corsepius. + +fgrep joel Makefile.in && exit 1 + +exit 0 diff --git a/tests/lex3.test b/tests/lex3.test index c3c75153..98c37ca3 100755 --- a/tests/lex3.test +++ b/tests/lex3.test @@ -1,25 +1,65 @@ #! /bin/sh -# Test to make sure that lex source generates correct clean rule. -# From Ralf Corsepius. +# Test associated with PR 19. +# From Matthew D. Langston. . $srcdir/defs || exit 1 -cat >> configure.in << 'END' +# Fail gracefully if no autoconf. +$needs_autoconf + +# Likewise for gcc. +(gcc -v) > /dev/null 2>&1 || exit 77 + +# Likewise for gzip. +(gzip --version) > /dev/null 2>&1 || exit 77 + +cat > configure.in << 'END' +AC_INIT +dnl Prevent automake from looking in .. and ../.. +AC_CONFIG_AUX_DIR(.) +AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1) + +dnl Checks for programs. AC_PROG_CC AM_PROG_LEX +AC_PROG_YACC +AC_OUTPUT(Makefile) END cat > Makefile.am << 'END' -bin_PROGRAMS = zot -zot_SOURCES = joe.l -LDADD = @LEXLIB@ +AUTOMAKE_OPTIONS = foreign +LDADD = @LEXLIB@ + +noinst_PROGRAMS = foo +foo_SOURCES = foo.l +END + +cat > foo.l << 'END' +%% +"END" return EOF; +. +%% +int +main () +{ + while (yylex () != EOF) + ; + + return 0; +} END -: > joe.l +set -e -$ACLOCAL || exit 1 -$AUTOMAKE || exit 1 +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure +$MAKE +echo 'This is the END' | ./foo +$MAKE distcheck -fgrep joel Makefile.in && exit 1 -exit 0 +# foo.c must be shipped. +gunzip am_lex_bug-0.1.1.tar.gz +tar tf am_lex_bug-0.1.1.tar | fgrep foo.c diff --git a/tests/pr19.test b/tests/pr19.test deleted file mode 100755 index 00056e9f..00000000 --- a/tests/pr19.test +++ /dev/null @@ -1,50 +0,0 @@ -#! /bin/sh - -# Test associated with PR 19. -# From Matthew D. Langston. - -. $srcdir/defs || exit 1 - -cat > configure.in << 'END' -AC_INIT(foo.l) -dnl Prevent automake from looking in .. and ../.. -AC_CONFIG_AUX_DIR(.) -AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1) - -dnl Checks for programs. -AC_PROG_CC -AM_PROG_LEX -AC_PROG_YACC - -AC_OUTPUT(Makefile) -END - -cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = foreign -LDADD = @LEXLIB@ - -noinst_PROGRAMS = foo -foo_SOURCES = foo.l -END - -echo %% > foo.l - -# Fail gracefully if no autoconf. -$needs_autoconf - -# Likewise for gcc. -(gcc -v) > /dev/null 2>&1 || exit 77 - -# Likewise for gzip. -(gzip --version) > /dev/null 2>&1 || exit 77 - -$ACLOCAL || exit 1 -$AUTOCONF || exit 1 -$AUTOMAKE -a || exit 1 -CC=gcc ./configure || exit 1 -$MAKE || exit 1 -$MAKE distcheck || exit 1 - -gunzip am_lex_bug-0.1.1.tar.gz || exit 1 - -tar tf am_lex_bug-0.1.1.tar | fgrep foo.c -- 2.43.5