autoconf
[Top][All Lists]
Advanced

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

Re: General automake/autoconf questions


From: Ralf Wildenhues
Subject: Re: General automake/autoconf questions
Date: Sat, 19 Mar 2005 22:13:42 +0100
User-agent: Mutt/1.5.6+20040907i

Hi Frederico,

* Frederico Faria wrote on Fri, Mar 18, 2005 at 11:23:47PM CET:
>  
>   I am novice for gnu automake/autoconf tools then I
> have had some general questions about the subject; 
> Mainly I could like to know a bit more
> about best practices.

One way would be to look at how other packages do things.
(Always taken with a grain of salt, however.)

>   1-)  Which are the  advantages to use a
> "configure.in" for each subdirectory ? Today I am
> using only one configure.in in the root directory.

Use only one in the root directory.  Name it configure.ac.

Using more than one should only used when necessary (for some
complicated situations), or convenient (for example when you
have a source tree comprised of several once-independent packages
which each provided their own configure.ac).

>   2-) At Makefile.am file  I use some macros defined
> at configure.in file using the AC_SUBST.
>       Of course, I could define these macros at
> Makefile.am. Which is the better design ?

Don't know.  What you do enables you do set them based on decisions
at configure time: user-provided options to `configure', knowledge
gathered by `configure'.

If you don't need that, I don't know.

>   3-) Could I turn off the use of COPYING, NEWS and
> other required automake files ?

Yes, by Automake option `foreign'.  Put it in
  AM_INIT_AUTOMAKE([options ..])
in configure.ac, for example.  Read
  info Automake Options

>   4-) How could I get a more clean output when I run
> the make command. Because It appears references for
> PACKAGE, .deps, and others.  is It possible hide or
> disable that information at command output ?

The defines can be put in a config header (usually named config.h
and created by config.status from config.h.in; config.h.in is
created by autoheader).  For this, add
  AC_CONFIG_HEADERS([config.h])
to configure.ac and adjust your code so that config.h is included
exactly once everywhere necessary.
Read
  info Autoconf 'Configuration Headers'
for more info.

> if c++ -DPACKAGE_NAME=\"main\"
> -DPACKAGE_TARNAME=\"main\" -DPACKAGE_VERSION=\"1.0\"
> -DPACKAGE_STRING=\"main\ 1.0\"
> -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"main\"
> -DVERSION=\"1.0\" -I. -I. -I../inc  -I../idl
> `test -f '../idl/Factory.cpp' || echo
> './'`../idl/Factory.cpp; \
> then mv -deps/Factory.Tpo" ".deps/Factory.Po"; else rm
> -f ".deps/Fact...

The dependency stuff (from Automake) can be turned off by Automake
option `no-dependencies' (you already know where to read more about
it :-), but I would not do it as it reduces functionality useful for
development.

If you bother about lots of noise in the output of `make' runs,
there are good editors and other filters out there that will point
you to the interesting stuff (the compiler warnings) only; (x)emacs
and vim, for example, can do that.

Regards,
Ralf




reply via email to

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