Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Given how much I've had to fight with Automake and Libtool to get really simple things done, they're hardly the things you want to hold up as shining beacons.

1. Do you want to compile certain source files with different build flags? Hah, no! Automake only supports it through obscene hacks, and those break if you're using Libtool.

2. Do you want to make a plugin? Best way is to ditch Libtool completely, make an executable target in Automake, and add the linker flags yourself. It makes you feel like you're banging two rocks together and it's not portable but at least it gets the job done.

3. Do you have any linker flags? Hah, no! Libtool will mess with them and they won't work.

The other bit is that Libtool is basically all magic, and Automake is basically all macros. The amount of magic that Libtool does to fool you into thinking you're not writing dynamically linked code is enough to make you puke and makes a mess when it breaks, and Automake's macro system is terrible.

Just imagine, if you will, that you want to compile one file in your library with the flags -msse3, to produce a dynamic library that has to run on systems both with and without SSE3. You can use cpuid to call functions in that file or not at runtime.

All of my searching has lead me to the conclusion that this is impossible if you want to use Automake and Libtool, and easy if you ditch both of them.



Basically, these days I recommend cmake as the sane build system that runs everywhere. I don't know about PCs running MacOS, but it works just fine under Linux or Windows and you can do whatever magic you want; it makes simple things easy and complex ones possible.


I wouldn't recommend CMake without qualifications.

It is vastly inferior from the perspective of the end user. Any autotools package can be handled with "./configure && make && sudo make install", and you can change it up by "./configure --without-gtk --enable-network --prefix=/opt/crazy CFLAGS='-O0'" and then make a package with "make install DESTDIR=/tmp/package". Try doing that in CMake, you'll see what I mean.

The syntax is also really terrible, in particular, If/Else. The documentation is not so good, in particular, it's available online as one big block of text and they want to sell you a book.

Finally, CMake doesn't solve the one problem I was complaining the most about, which was the ability to set per-file compilation flags. This is not an optional feature in my eyes -- it's necessary for avoiding cross-contamination of -D_GNU_SOURCE turds picked up by pkg-config, and it's necessary for writing libraries that use processor features that might not be available at runtime, like SSE3.

I think CMake, like Autotools, has a niche in which it does best. "Simple things easy and complex things possible" is a nice motto, but the truth is really boring -- CMake and Autotools make different things easy and different things possible. CMake's niche is medium-large projects with medium amounts of complexity. Projects that are complex, like Firefox or FFMpeg, tend use Autoconf with custom build systems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: