Posts

Showing posts with the label autotools

Autotools is nice

I was recently asked why autotools was so good. I thought I might as well post what I answered. Small differences There are always some small differences between OSs. For example if uint64_t exists or if it's called u_int64_t . Instead of doing an #ifdef __linux__ with lots of garbage and another block of #ifdef __OpenBSD__ you can solve the problem right. Otherwise you'll end up with duplicated sections of defines and other things like: 1 2 3 4 5 6 7 8 9 10 11 12 #if __FreeBSD__ # define foo bar # define OStype joonix #elif defined __OpenBSD__ # define foo bar # define OStype joonix #elif defined __linux__ # define foo BAZ # define OStype joonix #else # error "Unknown OS, please add your OS here and define the things that the other OSs do above" #endif Supported interfaces Even if an OS doesn't support some API (such as sendfile() or openpty() ) today, it may do so in a year. It would be a shame if your p...