PDA

View Full Version : UNIX programming tools


dima
01-09-2006, 05:25 PM
Hello, everyone.
I'm a newbie and would like to start programming C. Could anyone point me to a resource about UNIX programming tools (automake,autoconf ...) so I could make programms which one could install with configure && make && make install. Thanks.

i3839
01-09-2006, 06:04 PM
It's much easier to just use a simple Makefile than to configure autotools I think. See the make documentation for detailed info about Makefiles.

Most of the time you don't have to know the finer details of the buildsystem used, as projects have it setup already. Maybe using autotools is easiest in the long term, but figuring out things like that is a seperate thing from learning C. Especially if you've just began with coding you probably won't start a big and complicated project for a while. In the beginning you'll probably have a lot of single file programs which you can compile directly with gcc -o prog prog.c -W -Wall, or something similar. Or just type "make prog" and make will compile the file prog.c in the same dir, though then it's convenient to export your favourite CFLAGS environment variable.

Personally I'm not sure yet if autotools are worth using or not. They generate a big mess with questionable added value compared to a Makefile. That said, making correct and good Makefiles can be tricky when trying to do more complicated things.

RobSeace
01-09-2006, 08:33 PM
I've never used the auto* stuff, either... And, what I've seen of it frightens me...
It's rather spiffy for stuff that needs to be ported widely to any Unix-like system on
the planet, but unless you have such a need, I don't think there's a lot of value in
it... Even if I were going to release some open source app/lib that I intended to be
ported widely, I think I might just try to create my own custom "configure" script
that does just the few tests I need, without having to deal with all the auto* stuff...

duncang
01-10-2006, 06:07 AM
I'm inclined to agree. Several times I've tried to read the how-to's on
auto* & never reached the bottom of the page ...

10-15 yrs ago I worked for a software house & ported 100k+ lines of
C code across 25+ Unix platforms with no more than a few #ifdef's
scattered around the code.

The GNU tools would be useful if you didn't have access to a potential
target platform, but there are so few (relatively) these days & you could
always use the Sourceforge compile farm. Or maybe if you have a lot
of options that you may or may not want to compile in, e.g. external
libraries, GUIs, databases, etc.

Just Google for "autoconf how to" if you do want to learn about
this topic. There are plenty out there.

dima
01-10-2006, 10:33 AM
Thank you for your replies. It's just that I was involved in system administration of FreeBSD/Linux systems for a while. It seemed that autotools were a STANDART on those, since even software of a very small size (I've seen a 1 .c file, 2 .h,1 man page programm) is installed with configure && make && make install. Thanks again for your posts.

i3839
01-10-2006, 09:54 PM
"Configure" can also be a small shellscript which does some needed setup for the system the software is going to be compiled on, it isn't always autoconf stuff. Also there are alternatives for autotools which try to achieve the same, but in different ways.

IMHO software should have near zero compile time configuration options. Compile flags is alright, perhaps the default config file place too, but everything else is almost always just laziness because they don't bother to write flexible code (e.g. way not enough dlopen/dlsym usage, but instead linked at compile time, no matter how important the feature provided by those libs).