autoconf
[Top][All Lists]
Advanced

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

Re: Can't repeat build.


From: Ralf Wildenhues
Subject: Re: Can't repeat build.
Date: Thu, 22 Jan 2009 21:36:58 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Dan,

* Dan Smithers wrote on Thu, Jan 22, 2009 at 11:35:32AM CET:
> >> Sometime this works fine. On other occasions I get an error
> >>
> >> automake-1.10: no Automake input file found for
> >> `activation_analyser/src/Makefile.in'
> >> automake-1.10: no input file among supplied arguments.
> > 
> > Can you post the command that caused this error, including the 'make'
> > sequence leading up to it, please?
> 
> cd ~/v1700/components/build/gcc/debug/
> make
> make  all-recursive
> make[1]: Entering directory `/homesint/dwhs1/v1700/components/build/gcc/debug'
[...]
> Making all in src
> make[3]: Entering directory 
> `/homesint/dwhs1/v1700/components/build/gcc/debug/astranet/src'
>  cd ../../../../../astranet && /bin/bash 
> /homesint/dwhs1/v1700/components/astranet/config/missing --run automake-1.10 
> --foreign  astranet/src/Makefile
> automake-1.10: no Automake input file found for `astranet/src/Makefile'
> automake-1.10: no input file found among supplied arguments
> make[3]: *** [../../../../../astranet/src/Makefile.in] Error 1
> make[3]: Leaving directory 
> `/homesint/dwhs1/v1700/components/build/gcc/debug/astranet/src'

Thanks.

The problem is that components/astranet/src/Makefile is registered as
config file in two different configure.ac files: in
components/configure.ac and also in components/astranet/configure.ac.

I suggest that the toplevel configure.ac only list those Makefiles as
config files for which there are no entries in sub configure.ac files.
IOW: each Makefile should be listed in one configure.ac only, and it
makes sense to let each configure.ac cover only those Makefiles which
live in the same directory as that configure.ac or in subdirectories,
while excluding subdirectory trees that themselves contain configure.ac
files.

Similarly, each subdirectory containing a Makefile.am file should only
be listed once in at most one other Makefile.am files' SUBDIRS variable.
Otherwise 'make distclean' is bound to fail when entering the directory
for a second time.

> >> Also, I am a bit confused about when to use $(srcdir) and $(top_builddir).
> > 
> > Well, imagine instead of
> >   cd build
> >   ../configure
> > 
> > I would do
> > 
> >   mkdir /dev/shm/build
> >   cd /dev/shm/build
> >   /path/to/configure <options>
> 
> I think that this is pretty much what I do - except that I have build in
> the top source directory.

Yes, but if you change that habit (just for testing) then you will see
when you need to use $(srcdir) and when you need to use $(top_builddir).

> >> bin_PROGRAM=exec
> >> exec_SOURCES=exec.c
> >> exec_LDADD=$(top_builddir)/../libname/src/.libs -lname
> > 
> > Please replace this line with
> >   exec_LDADD=$(top_builddir)/../libname/src/libname.la
> > 
> > but I do wonder: $(top_builddir)/.. points outside of the build tree.
> > Is that an error or on purpose?
> 
> It points to a neighbouring tree set up by autotools.

Ah, ok.  So you require that users of your packages also need this
same setup.

> # Checks for typedefs, structures, and compiler characteristics.
> AC_HEADER_STDBOOL
> AC_C_CONST

I don't think anybody uses a compiler that needs AC_C_CONST any more.
You can safely drop this.  Likewise for AC_C_VOLATILE.

> AC_C_VOLATILE

> BOOSTDIR=[/vol/build/boost_1_37_0]

For eventual other users of your package, this should not be hard-coded
but made configurable.

> components/Makefile.am
> ======================
> 
> AUX_DIST = $(ac_aux_dir)/config.guess \
>       $(ac_aux_dir)/config.sub \
>       $(ac_aux_dir)/install-sh \
>       $(ac_aux_dir)/ltconfig \
>       $(ac_aux_dir)/ltmain.sh \
>       $(ac_aux_dir)/mdate-sh \
>       $(ac_aux_dir)/missing \
>       $(ac_aux_dir)/mkinstalldirs

FWIW, I don't think $(ac_aux_dir) is defined automatically by
Autoconf/Automake.

> SUBDIRS= libag astranet
> 
> EXTRA_DIST= bootstrap.sh
> 
> MAINTAINERCLEANFILES=Makefile.in configure $(AUX_DIST)


> # set default path prefix
> AC_PREFIX_DEFAULT([/opt/astraguard/])

Please omit the trailing slash here.

> BOOSTDIR=[/vol/build/boost_1_37_0]
> AC_SUBST([BOOSTDIR])


> components/astranet/src/Makefile.am
> ===================================
> 
> AM_CPPFLAGS=-I$(BOOSTDIR)/include -I$(srcdir)/../../libag/include
> AM_CFLAGS=-Wall -Werror
> AM_CXXFLAGS=$(AM_CFLAGS)
> 
> bin_PROGRAMS=alms
> alms_SOURCES=neighbours.cpp alms.cpp
> 
> alms_LDADD= -L$(BOOSTDIR)/lib -lboost_regex
> -L$(top_builddir)/../libag/src -lagthread -lagmessage -laglogger -lagcomms

If some of those are uninstalled libtool libraries, they should be
specified as relative/path/to/libagmessage.la here

> AM_CFLAGS=-Wall -Werror
> AM_CXXFLAGS=$(AM_CFLAGS)

Those aren't portable to non-GCC, but I guess you knew that; and they
are overridable by CFLAGS and CXXFLAGS.

Cheers,
Ralf




reply via email to

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