autoconf driving me mad

Stepan Kasal skasal at redhat.com
Mon Jan 7 19:01:54 UTC 2008


Hello,

On Mon, Jan 07, 2008 at 02:07:59PM +0100, Christoph Höger wrote:
> GLOB_INCLUDE="-I${srcdir} -I${srcdir}/include"
> AC_SUBST(GLOB_INCLUDE)

variables like srcdir, top_srcdir, top_builddir, and such are
not available for the shell code in the configure.ac.  The manual
does not mention them.  (Yes, there is something about having the
available in AC_CONFIG_* macros, but that's not the case here.)

These variables are available in the file _created_ by configure,
specifically in the makefiles.

So, formally speaking, the observed problem with backward
compatibility of 2.61 is caused by relying on undocumented features
in the autoconfigury of openccs.

Let me outline the way to fix this.
src/make.rules should use $(top_srcdir) and such like this:

GLOB_INCLUDE = \
  -I$(top_srcdir) \
  -I$(top_srcdir)/include
TOOLS_INCLUDE = \
  -I$(top_srcdir)/shared/rte \
  -I$(top_builddir)/shared/comm \
  -I$(top_srcdir)/shared/comm \
  -I$(top_srcdir)/shared/filterIdent \
  -I$(top_srcdir)/shared/tools

AM_CPPFLAGS = $(GLOB_DEFINES) $(GLOB_INCLUDE) $(TOOLS_INCLUDE)

Note:
- the two lines quoted in the top of this mail should go away from
  configure.in, GLOB_INCLUDE in defined directly in make.rules
- likewise, TOOLS_INCLUDE shall not be AC_SUBSTed
- some Makefile.am contain
	INCLUDE = @GLOB_INCLUDE@
  and such; these are redundant and should go away
- $(GLOB_DEFINES) works even though it is not spelled as @...@; thats
  because all AC_SUBSTed variables are inherited in makefiles

Hope this explanation will drag you back to the sane world.  ;-)

Have a nice day,
	Stepan Kasal




More information about the fedora-devel-list mailing list