Die GNU autotools

Die GNU autotools

Shlomi Fish shlomif at iglu.org.il
Thu Jan 13 14:26:01 IST 2011


On Tuesday 11 Jan 2011 16:35:08 Nadav Har'El wrote:
> On Tue, Jan 11, 2011, Shlomi Fish wrote about "Re: Die GNU autotools":
> > Actually, CMake is not "imake done right", but actually is a better
> > Autoconf. One can write build-time tests with it to test for features
> > and configure the build accordingly, just like you can with Autoconf,
> > only in a cleaner and
> 
> I stand corrected. I have to admit that whenever somebody pointed me to
> CMake and I looked at its documentation, I never saw any mention of the
> ability to do these tests. Now that I looked again (after your post), I
> did saw some test functions mentioned deep inside the documentation, but
> am still missing the big picture - what kind of tests can CMake do - is it
> just a few common tests, or a huge variety of tests plus a general
> scripting capability to test anything, like autoconf can do? 

Yes, CMake has a wide variety of built-in tests (test for the presence of 
libraries, of functions, of executables, pkg-config tests, various versions 
tests, etc.), and one can write newer tests for whatever you want using its 
scripting language, which is also used to call to the existing tests and which 
is Turing-complete, can invoke and trap the output of external executables, 
etc. (Like sh, only portable) 

> Second,
> *when* does cmake do these tests - every time? Just once? (in autoconf,
> "configure" and "make" are two separate steps).

CMake does these tests once (assuming they succeed and that you don't change 
the CMakeLists.txt), and then generates makefiles (or different build files, 
such as those for Microsoft Developer Studio), which can be used to build the 
project times again. Running "cmake" is equivalent to doing "./configure" and 
the "make" stage afterwards does the rest (Like in Autoconf.).

> 
> > Autoconf, aclocal, acinclude, autoscan, autoheader, libtool, intltool,
> 
> > automake, and lots of other technologies in a complex dependency graph:
> In my view, as I explained in my previous message, "autoconf" is the only
> one of those who are really vital. All the rest are fluff... (well, maybe
> libtool is also important, but I don't like it - I can't even explain why).
> 

OK.

> > > m4/aclocal - I use it as part of the autoconf generation, but have
> > > never bothered to learn it properly.
> > 
> > m4 is very vile.
> 
> I agree that m4 was a really odd choice to use in autoconf - it's not like
> it ever was a popular language outside the circle of Vax assembly-language
> coders in Bell Labs...
> 
> Personally I would have loved to see an autoconf alternative with a saner
> input language, which still generates a shell script (unlike cmake).
> 
> If I would write it myself, the language I would choose is Tcl - because
> of its "{ ... }" quoting making it easy to include verbatim shell blurbs.
>

Well, I'm not too fond of Tcl either (due to the fact it is using strings for 
quoting.). During my time, I've heard of several alternatives to m4:

* http://www.complang.tuwien.ac.at/schani/chpp/

* http://search.cpan.org/dist/Template-Toolkit/

* http://www.cabaret.demon.co.uk/filepp/ - similar to the C preprocessor, only 
more powerful and without line numbers.

* http://thewml.org/ - Website Meta Language - a collection of preprocessors 
specialised for generating HTML (which includes mp4h, which was derived from 
GNU m4).
 
> > Furthermore, while you already know Autotools, remember that you need to
> > keep this knowledge resident in your memory, and that other people who
> > wish to contribute to your projects will have to learn GNU Autotools up
> > to the same level that your configuration files were written in (and to
> > be able to handle other problems that crop).
> 
> You don't need to have the knowledge resident in your memory - to continue
> your virtual-memory metaphore, only the working set (i.e., the script you
> already wrote) needs to be resident, and all the rest can be demand-paged
> from storage (i.e., the autoconf documentation) ;-)

Well, like I said, that's not the only or most major advantage of CMake over 
Autotools, and you people should not treat it as a 
http://en.wikipedia.org/wiki/Straw_man argument.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
What does "Zionism" mean? - http://shlom.in/def-zionism

Chuck Norris can make the statement "This statement is false" a true one.

Please reply to list if it's a mailing list post - http://shlom.in/reply .



More information about the Linux-il mailing list