automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automake/492: Compilation of assembler files with subdir-objects


From: Ralf Wildenhues
Subject: Re: automake/492: Compilation of assembler files with subdir-objects
Date: Sat, 14 Oct 2006 08:42:21 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Thomas,

* Thomas Schwinge wrote on Tue, Oct 10, 2006 at 04:15:55PM CEST:
> [Cced to <address@hidden> and <address@hidden> for further
> discussion.  Which list is appropriate here?]

I killed them off and added automake-patches.  Just to have a copy of
the patch below there.

> We were talking about the issue why Automake doesn't emit proper rules
> for compiling (pre processed) Assembler files (the .S ones) when using
> `AM_INIT_AUTOMAKE([subdir-objects])'.
> 
> When using code file `libfoo_a_SOURCES = somewhere/a.S', Automake
> currently assembles `somewhere/a.S' and puts `a.o' into the current
> directory (as opposed to `somewhere/a.o'), but when creating `libfoo.a'
> it wants to add `somewhere/a.o', which will then obviously fail.

Yep.  The proposed patch by Andreas Schwab raised concerns by Alexandre:
http://sources.redhat.com/ml/bug-automake/2004/msg00715.html

But he also wrote:
| Does there exist some C compiler that supports assembly but not -c -o?
| If not, maybe it's simpler that we fix output_flag to `-o' for
| assembly.

And your observation seems another hint to that end.
I think this is what we should do.  OK to apply?
(The NEWS change should be merged with the related
Fortran one.)

Cheers,
Ralf

2006-10-14  Ralf Wildenhues  <address@hidden>

        For PR automake/492.
        * automake.in (output_flag): Set to `-o' for Assembler and
        preprocessed Assembler, assuming that all understand `-c -o'.
        * THANKS, NEWS: Update.
        * tests/subobj10.test: New test.
        * tests/Makefile.am: Update.
        Report by Thomas Schwinge.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.315
diff -u -r1.315 NEWS
--- NEWS        5 Sep 2006 18:58:16 -0000       1.315
+++ NEWS        14 Oct 2006 06:40:57 -0000
@@ -1,5 +1,10 @@
 New in 1.9c:
 
+* Languages changes:
+
+  - subdir-object mode works now with Assembler.  Assembler assumes
+    that the compiler understands `-c -o'.
+
 * Miscellaneous changes:
 
   - The script `install-sh' needs to have executable permissions for
Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.289
diff -u -r1.289 THANKS
--- THANKS      21 Aug 2006 04:25:35 -0000      1.289
+++ THANKS      14 Oct 2006 06:38:48 -0000
@@ -274,6 +274,7 @@
 Thomas Fitzsimmons     address@hidden
 Thomas Gagne           address@hidden
 Thomas Morgan          address@hidden
+Thomas Schwinge                address@hidden
 Thomas Tanner          address@hidden
 Tim Goodwin            address@hidden
 Tim Mooney             address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1632
diff -u -r1.1632 automake.in
--- automake.in 10 Oct 2006 21:34:11 -0000      1.1632
+++ automake.in 14 Oct 2006 06:38:51 -0000
@@ -838,6 +838,7 @@
                   'compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
                   'compiler' => 'CCASCOMPILE',
                   'compile_flag' => '-c',
+                  'output_flag' => '-o',
                   'extensions' => ['.s'],
 
                   # With assembly we still use the C linker.
@@ -856,6 +857,7 @@
                   'compile' => '$(CCAS) $(AM_CPPFLAGS) $(CPPFLAGS) 
$(AM_CCASFLAGS) $(CCASFLAGS)',
                   'compiler' => 'CPPASCOMPILE',
                   'compile_flag' => '-c',
+                  'output_flag' => '-o',
                   'extensions' => ['.S'],
 
                   # With assembly we still use the C linker.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.609
diff -u -r1.609 Makefile.am
--- tests/Makefile.am   30 Aug 2006 20:35:56 -0000      1.609
+++ tests/Makefile.am   14 Oct 2006 06:38:51 -0000
@@ -510,6 +510,7 @@
 subobj7.test \
 subobj8.test \
 subobj9.test \
+subobj10.test \
 subobjname.test \
 subpkg.test \
 subpkg2.test \
--- /dev/null   2006-10-09 01:10:44.864355000 +0200
+++ tests/subobj10.test 2006-10-14 08:38:31.000000000 +0200
@@ -0,0 +1,60 @@
+#! /bin/sh
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# PR 492: Test asm subdir-objects.
+
+required=gcc  # avoid compiler errors.
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT(x, 0, x)
+AM_INIT_AUTOMAKE([foreign subdir-objects])
+
+AM_PROG_AS
+AC_PROG_RANLIB
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libfoo.a libbar.a
+libfoo_a_SOURCES = src/a.s b.s
+libbar_a_SOURCES = src/c.s d.s
+libbar_a_CCASFLAGS =
+END
+
+mkdir src
+: >src/a.s
+: >b.s
+: >src/c.s
+: >d.s
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+$MAKE distcheck




reply via email to

[Prev in Thread] Current Thread [Next in Thread]