GNU bug report logs - #12142
automake tries to compile a program when 'foo' and 'foo.cxx' exist (though the former is header)

Previous Next

Package: automake;

Reported by: Michał Górny <mgorny <at> gentoo.org>

Date: Sun, 5 Aug 2012 18:31:02 UTC

Severity: normal

Tags: notabug

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Michał Górny <mgorny <at> gentoo.org>
Subject: bug#12142: closed (Re: bug#12142: automake tries to compile a
 program when 'foo' and 'foo.cxx' exist (though the former is header))
Date: Mon, 31 Aug 2020 21:15:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#12142: automake tries to compile a program when 'foo' and 'foo.cxx' exist (though the former is header)

which was filed against the automake package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 12142 <at> debbugs.gnu.org.

-- 
12142: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12142
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Karl Berry <karl <at> freefriends.org>
To: 12142 <at> debbugs.gnu.org
Subject: Re: bug#12142: automake tries to compile a program when 'foo' and
 'foo.cxx' exist (though the former is header)
Date: Mon, 31 Aug 2020 15:14:31 -0600
It seems there is nothing left unresolved here, so closing ...

[Message part 3 (message/rfc822, inline)]
From: Michał Górny <mgorny <at> gentoo.org>
To: bug-automake <at> gnu.org
Subject: automake tries to compile a program when 'foo' and 'foo.cxx' exist
	(though the former is header)
Date: Sun, 5 Aug 2012 11:45:51 +0200
[Message part 4 (text/plain, inline)]
autoconf: 2.69
automake: 1.12.2
libtool: 2.4.2

Hello,

I was writing a C++ library and I think I hit a pretty ugly bug within
automake. My library was structured like the following:

- src/foo (the header file),
- src/foo.cxx (the code).

These files assemble a library, let's call it libfoo.la.

The problem is that every time I modify src/foo.cxx and call 'make',
automake first (correctly) compiles the library, and then mistakenly
tries to compile and link it into a program src/foo, either effectively
overwriting or removing my header file, or failing early due to
missing dependency file.

What's interesting, 'make' calls not following src/foo.cxx changes work
correctly; just the one after modifying src/foo.cxx fails.

Here are the minimal configure.ac & Makefile.am files with which I can
reproduce the issue:


configure.ac:

AC_PREREQ([2.60])
AC_INIT([foo], [0])
AM_INIT_AUTOMAKE([1.6 foreign])

AC_PROG_CXX
LT_INIT

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT


Makefile.am:

include_HEADERS = src/foo
lib_LTLIBRARIES = libfoo.la

libfoo_la_SOURCES = src/foo.cxx


I've also prepared a git repository with the simple test case:

git clone https://bitbucket.org/mgorny/automake-cxx-bug.git
cd automake-cxx-bug
autoreconf -vi
./configure --disable-static
make # compiles fine
touch src/foo.cxx
make # fails


Related Gentoo bug report:
https://bugs.gentoo.org/show_bug.cgi?id=429972

-- 
Best regards,
Michał Górny
[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 4 years and 348 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.