2001-05-08 Tom Tromey <tromey@redhat.com>
+ Fix for PR automake/36:
+ * tests/Makefile.am (TESTS): Added asm.test.
+ * tests/asm.test: New file.
+ * automake.in (asm): Use ASFLAGS and AS.
+ (lang_asm_finish): New sub.
+
* automake.in (read_am_file): Removed debugging code.
For PR automake/149:
# Assembler.
register_language ('name' => 'asm',
'Name' => 'Assembler',
- 'flags' => 'CFLAGS',
- # FIXME: asmflags?
- 'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
- # FIXME: a different compiler?
- 'compiler' => 'COMPILE',
+ 'flags' => 'ASFLAGS',
+ # Users can set AM_ASFLAGS to includes DEFS, INCLUDES,
+ # or anything else required. They can also set AS.
+ 'compile' => '$(AS) $(AM_ASFLAGS) $(ASFLAGS)',
+ 'compiler' => 'ASCOMPILE',
'compile_flag' => '-c',
'extensions' => ['s', 'S'],
- # We need the C code for assembly.
- '_finish' => \&lang_c_finish);
+ '_finish' => \&lang_asm_finish);
# Fortran 77
register_language ('name' => 'f77',
}
}
+sub lang_asm_finish
+{
+ if (! defined $configure_vars{'AS'})
+ {
+ &am_error ("assembly source seen but `AS' not defined");
+ }
+
+ if (! defined $configure_vars{'ASFLAGS'})
+ {
+ &am_error ("assembly source seen but `ASFLAGS' not defined in `$configure_ac'");
+ }
+
+ # Also use the C code, since with assembly we still use the C linker.
+ &lang_c_finish;
+}
+
# This is a helper for both lex and yacc.
sub yacc_lex_finish_helper
{
--- /dev/null
+#! /bin/sh
+
+# Test of basic assembly functionality
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_ARG_PROGRAM
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_SUBST(ASFLAGS)
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+noinst_PROGRAMS = maude
+maude_SOURCES = maude.s
+END
+
+: > maude.s
+
+# Should fail because we need cc and as.
+echo 1
+$AUTOMAKE && exit 1
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_ARG_PROGRAM
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_CC
+AC_SUBST(ASFLAGS)
+AC_OUTPUT(Makefile)
+END
+
+# We still need as.
+echo 2
+$AUTOMAKE && exit 1
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_ARG_PROGRAM
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AS='$(CC)'
+AC_SUBST(AS)
+AC_PROG_CC
+AC_OUTPUT(Makefile)
+END
+
+# We need ASFLAGS.
+echo 3
+$AUTOMAKE && exit 1
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_ARG_PROGRAM
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AS='$(CC)'
+AC_SUBST(AS)
+AC_PROG_CC
+AC_SUBST(ASFLAGS)
+AC_OUTPUT(Makefile)
+END
+
+echo 4
+$AUTOMAKE