File: dlfcn.m4

package info (click to toggle)
talloc 2.0.7%2Bgit20120207-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,212 kB
  • sloc: python: 19,292; ansic: 10,476; sh: 3,271; xml: 801; makefile: 136; perl: 118; awk: 57
file content (31 lines) | stat: -rw-r--r-- 756 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
dnl dummies provided by dlfcn.c if not available
save_LIBS="$LIBS"
LIBS=""

libreplace_cv_dlfcn=no
AC_SEARCH_LIBS(dlopen, dl)

AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_FUNCS([dlopen dlsym dlerror dlclose],[],[libreplace_cv_dlfcn=yes])

libreplace_cv_shl=no
AC_SEARCH_LIBS(shl_load, sl)
AC_CHECK_HEADERS(dl.h)
AC_CHECK_FUNCS([shl_load shl_unload shl_findsym],[],[libreplace_cv_shl=yes])

AC_VERIFY_C_PROTOTYPE([void *dlopen(const char* filename, unsigned int flags)],
	[
	return 0;
	],[
	AC_DEFINE(DLOPEN_TAKES_UNSIGNED_FLAGS, 1, [Whether dlopen takes unsigned int flags])
	],[],[
	#include <dlfcn.h>
	])

if test x"${libreplace_cv_dlfcn}" = x"yes";then
	LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/dlfcn.o"
fi

LIBDL="$LIBS"
AC_SUBST(LIBDL)
LIBS="$save_LIBS"