Well, seems I can't help from adding my 2 cents either...
18 jul 2008 kl. 18.59 skrev Peter O'Gorman:
Terry Lambert wrote:
Even finding an operational linkage symbol in a library is a far cry
from knowing that it behaves a particular way; for example,
a POSIX compliant system doesn't take parameters, while on a legacy
BSD-derived system, it takes two parameters. Your linkage test is
going to tell you that.
No, but a proper compile test will.
Except on Linux, even compile tests are enough. Since the C library is
a separate project from the kernel, the syscall mapping is not
perfect. A syscall might exist in glibc, but not in the kernel, or
vice versa. This bit me back when epoll was new, because systems had
it in glibc but not the kernel. The only way to test that in autoconf
is to actually running the code and check for ENOSYS, which is bad,
since it breaks cross compiling.
But even then there's bugs to be considered, a kqueue implementation
might be depending on support in the underlying drivers, and even if
it works on a socket, it might not on a device node, etc. (A very real
issue for me right now.) These cases are almost impossible to test for
automatically, yet they have to be worked around if you want your app
running on systems that have them.
That being said, I think it's very limiting to constrain oneself to
what's only in POSIX. kqueue/epoll is an example of such a feature.
It's very useful, but not standard. It can be appropriate to check for
which of these features are available before starting the compile, as
long as manual override is possible. Or does anyone have a good way to
check if either kqueue or epoll is available during compiling?
autoconf has other problems too. It gives a guise of being easy to
use, but in reality it's quite complex. But that's really a separate
In conclusion, while ./configure && make can be nice to get a program
that (hopefully) works for the same machine as the compiling is done
on, in almost every other situation I've found manual configuration to
be better. Runtime configuration if possible, but compile time if not.
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: