edenhill / mklove

mklove - not autoconf
BSD 2-Clause "Simplified" License
53 stars 8 forks source link

Is it possible to skip a specific library check? #30

Open vishalbiswas opened 3 years ago

vishalbiswas commented 3 years ago

I'm trying to compile librdkafka for Android. The pthreads library is built into Android's libc (bionic). Hence, when you specify -lpthread to the linker, it fails.

I need to know whether a mechanism to skip or override the result of a specific library check is available.

edenhill commented 3 years ago

You could do two checks, first a mkl_compile_check and if that fails do a mkl_lib_check, e.g., something like:

if ! mkl_compile_check pthreads_builtin WITH_PTHREADS disable "" \
 "#include <pthreads.h> .. 
void foo (void) {
   pthread_self();
}"; then
    mkl_lib_compile_check pthreads WITH_PTHREADS fail "-lpthread" \
 "#include <pthreads.h> .. 
void foo (void) {
   pthread_self();
}"
fi