News for hackers. Stuff that matters.
Re:21st Century C (new book) by pja on Friday November 16, 2012 @11:14AM (#4794398)
Is there an alternative that actually works?
Re:21st Century C (new book) by antirez on Friday November 16, 2012 @11:29AM (#4794466)
Redis uses many advanced POSIX features and some OS-dependent API (see ae.c) without autoconf, but just some minor ifdeffing business.
Re:21st Century C (new book) by meaty on Friday November 16, 2012 @11:46AM (#4794565)
+1. When I read your code, I know there is hope yet :)
Re:21st Century C (new book) by antirez on Friday November 16, 2012 @04:39PM (#4795996)
You are too kind! Thanks.
Re:21st Century C (new book) by meaty on Friday November 16, 2012 @11:17AM (#4794410)
Yeah: make and knowing what you are doing.

I've built some seriously complicated stuff which builds on Linux, Solaris and FreeBSD in the past with no autoconf magic required.

Autoconf is just a massive Rube Goldberg machine in disguise.

Re:21st Century C (new book) by mhd on Friday November 16, 2012 @11:27AM (#4794456)
It arose out of a different time. Linux/Solaris/BSD are trivial, compared to all the differences of the commercial unices of ages past, with their idiosyncratic libraries, BSD vs. SysV vs. POSIX, never mind all the different compilers. People would've sacrificed their firstborn to get something running on both HP/UX and SunOS, compared to that autotools was a blessing.

I think there are more papers on build systems than on sort algorithms.

Re:21st Century C (new book) by meaty on Friday November 16, 2012 @11:37AM (#4794509)
I've been through that as well. I have in the past just provided a different Makefile for each platform and run as follows:

    make -f Makefile.osf1
    make -f Makefile.sunos4
    make -f Makefile.sunos5
There is usually little difference between them - mainly compiler names/flags and the occasional def for code. Occasionally make is broken at which point you have to frig something.

Keep It Simple is the #1 rule. Rule #2 is every bad thing you do will do two things bad back to you in the future.

Re:21st Century C (new book) by apaprocki on Friday November 16, 2012 @12:08PM (#4794679)
We decided to use gyp instead of autoconf and with some tweaking shipped a massive library that builds on Linux, Solaris, FreeBSD, OSX, AIX, HP-UX, Windows w/ it in both 32/64-bit. Definitely not for the feint of heart, but it is possible.
Re:21st Century C (new book) by jff on Friday November 16, 2012 @12:42PM (#4794862)
Check out http://swtch.com/plan9port/, it's a huge project that runs on (to quote the site) Linux (x86, x86-64, PowerPC, and ARM), FreeBSD (x86, x86-64), Mac OS X (x86 and Power PC), NetBSD (x86 and PowerPC), OpenBSD (x86 and PowerPC), SunOS (Sparc).

It uses a shell script to do a little bit of config, then bootstraps mk (a Bell Labs successor to make) and builds everything from some very human-readable mkfiles. When you want to build, you just untar the source and run ./INSTALL

Re:21st Century C (new book) by pja on Friday November 16, 2012 @05:45PM (#4796265)
Ta, will take a look.
Re:21st Century C (new book) by wrl on Friday November 16, 2012 @11:20AM (#4794424)
Agree with meaty: make and knowing what you're doing is good.

Occasionally, though, my needs will be more complicated than what make can handle on its own (lots of compile-time options, for example, or lots of dependency checking), and in those cases I'll use waf. Waf is lovely and hasn't let me down, and it's easy to use for people who are used to the ./configure && make && sudo make install sequence.

Re:21st Century C (new book) by deweerdt on Friday November 16, 2012 @11:36AM (#4794506)
It depends on what you mean by works. CMake actually works for me.
Re:21st Century C (new book) by pja on Friday November 16, 2012 @05:47PM (#4796273)
I've never liked CMake, but equally I've never really been able to articulate why that is.