autoconf and epel-5

Stepan Kasal skasal at
Fri Feb 27 11:26:27 UTC 2009


[obviously, I wasn't able to _read_ the thread, but a quick grep
seems to indicate my point has not been mentioned yet, at least the
first solution I'm going to recommend]

on Tue, Feb 24, 2009 at 09:01:10PM +0100, Simon Wesp wrote:
> in stands: 
> CXXFLAGS="-Wall -O2"

As you surely know, this is a bug, please report it to hosts3d

CXXFLAGS can be overrided at any time, so you can let configure to
hose the default and then override at make time:
	make CXXFLAGS='%{rpmoptflags}'
and, to be sure, again in %install
	make CXXFLAGS='%{rpmoptflags}' install

In theory, the checks performed by configure might be affected by the
incorrect value of CXXFLAGS, but I do not think this is a problem in

That presents the easiest way to fix the issue.

[Yes, stop reading here, unless you are really curious.]

[Congratulations and kind regards to the wise ones who leave us at
the moment.  Stepan]

> fedora. in epel-5 it will abort:

The error message says that the version of autoconf that has been
used when aclocal.m4 was created is not compatible with the version
you are currently using.  Actually, this is only one of the complex
interconnections between Autoconf and Automake.  You always have to
call aclocal, autoconf, and automake in the spec file.

A simple way to refresh both of these is:

BuildRequire: autoconf automake
autoreconf -f -i

That presents the second easiest solution.

[Last chance to leave; good bye to the wise ones.  Stepan]

A side note:
it is often mentioned that running autotools in spec file can trigger
subtle bugs.  That is true, but most of these bugs are caused by
problematic code in (or's), so the fix is to
clean up these and submit the resulting patches upstream, which is
generally a good thing.

Back to our problem.

Then come the solutions which patch generated files:

3) Third solution, with a bit of hacking:

Since the change to is minimal and you know the expected
effect on configure, you can do the thing manually.
In both cases, fix the date of  Make would try
to run aclocal, autoconf, and automake otherwise, resulting in subtle
differences between builds depending on presence of autoconf and
automake in the tree.

You can either create a patch that deletes the line from configure:

# patches both and configure
%patch77 -p1 -b.cxxflags
touch -r

or use sed

touch -r configure.mystamp
sed -i /^CXXFLAGS=/d configure
touch -r configure.mystamp
rm configure.mystamp

4) Fourth solution would be to create a patch that contains all the
results of autoreconf run.

Though it might seem that the Fedora Packaging Guidelines encourage
this type of solution, it the most tricky one.

You have to take care of all the following things:

- you have to have automake installed on the machine and include also
  the patches to aclocal.m4 and all the's
- OTOH, you should omit the contents of autom4te.cache subdirectory
  from the new tree
- you have to get the timestamps right, e.g. by reorganizing the diffs
  for individial files in the patch; has to be the
  oldest, then aclocal.m4, then all others (configure and's)

Happy hacking,

More information about the epel-devel-list mailing list