On Fri, Jul 01, 2016 at 11:56:55PM +0200, Jason A. Donenfeld wrote:
> I wonder if a better way would be match the particular libc out of
> uname -o. In this case, GNU libc needs -ldl. Do other libcs also need
> libdl? Seems like this might be slightly cleaner.

In theory one could detect glibc by grepping for specific macros,

cc -E -dM -include dlfcn.h -xc /dev/null

but in practice other libcs pretend being glibc:

https://git.uclibc.org/uClibc/tree/include/features.h

/*  There is an unwholesomely huge amount of code out there that depends on the
 *  presence of GNU libc header files.  We have GNU libc header files.  So here
 *  we commit a horrible sin.  At this point, we _lie_ and claim to be GNU libc

Peter
_______________________________________________
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit

Reply via email to