[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Autoconf's main purpose is config.h generation that *just* has #defi
From: |
Ronald Landheer-Cieslak |
Subject: |
Re: Autoconf's main purpose is config.h generation that *just* has #define's right?... |
Date: |
Thu, 17 Apr 2003 09:59:44 +0200 (CEST) |
The *result* of the autoconf-generated configure script is "just a bunch
of defines".
The configure.{ac|in} file is used to generate a shell-script that will be
used to scan the system for its abilities - at least, the ones you ask to
have checked. (That's where the "arbitrary shell code" is run). You could
effectively put shell code in the configure.{ac|in} file and thus have it
run at configure time.
Anyways, the configure script uses a Makefile.in file (which might also
contain shell code to be run at compile-time) to generate a Makefile, and
may generate a config.h file if you ask it to do so. It will also make
sure that the results of what it found are available in the form of
defines at compile-time, so you can do the
#if HAVE_PRINTF
printf("Hello, world!\n");
#endif
thing.
HTH
rlc
On Wed, 16 Apr 2003 address@hidden wrote:
> I've spent a lot of time reading Autotools docs
> and just wanted to verify something before I get
> lost in the info overload.....
>
> In general,
> the way to write portable and _flexible_ C code is to have
> preprocessor directives like:
>
> #ifdef STDIO_H_IS_AVAILABLE
> printf("Hello world.n");
> #endif
>
> .... and the way those variables
> get defined is to include config.h which is built by configure
> script which is built by Autoconf right?
>
> In a nutshell, one should not be intimidated by Autoconf
> because it does not do anything more profound or deep
> than just make a bunch of #define's right???
>
> ...
>
> (The reason this was not obvious is because I read that
> one can run arbitrary shell code with Autoconf/configure
> system. This implies Autoconf can do more than I thought
> and so I got confused.)
>
> **What else would you use
> Autoconf for other than making a list of #defines*?
>
> Thanks,
>
> Chris
>
>
>
>