Merge branch 'master' of git://git.samba.org/samba
[Samba/ita.git] / lib / replace / dlfcn.m4
blob722e0246b792f7891d8b2bfa2cd4068be54d3f72
1 dnl dummies provided by dlfcn.c if not available
2 save_LIBS="$LIBS"
3 LIBS=""
5 libreplace_cv_dlfcn=no
6 AC_SEARCH_LIBS(dlopen, dl)
8 AC_CHECK_HEADERS(dlfcn.h)
9 AC_CHECK_FUNCS([dlopen dlsym dlerror dlclose],[],[libreplace_cv_dlfcn=yes])
11 libreplace_cv_shl=no
12 AC_SEARCH_LIBS(shl_load, sl)
13 AC_CHECK_HEADERS(dl.h)
14 AC_CHECK_FUNCS([shl_load shl_unload shl_findsym],[],[libreplace_cv_shl=yes])
16 AC_VERIFY_C_PROTOTYPE([void *dlopen(const char* filename, unsigned int flags)],
17         [
18         return 0;
19         ],[
20         AC_DEFINE(DLOPEN_TAKES_UNSIGNED_FLAGS, 1, [Whether dlopen takes unsigned int flags])
21         ],[],[
22         #include <dlfcn.h>
23         ])
25 if test x"${libreplace_cv_dlfcn}" = x"yes";then
26         LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/dlfcn.o"
29 LIBDL="$LIBS"
30 AC_SUBST(LIBDL)
31 LIBS="$save_LIBS"