File: acx_dlopen.m4

package info (click to toggle)
softhsm 1.3.7-2%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 2,688 kB
  • ctags: 1,498
  • sloc: sh: 11,139; cpp: 8,504; ansic: 1,614; makefile: 110
file content (43 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (7)
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
32
33
34
35
36
37
38
39
40
41
42
43
AC_DEFUN([ACX_DLOPEN],[
	tmp_SUCCESS="no"

	# Unix
	AC_CHECK_FUNC(
		[dlopen],
		[
			AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have dlopen])
			tmp_SUCCESS="yes"
		],
		[
			AC_CHECK_LIB(
				[dl],
				[dlopen],
				[
					AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have dlopen])
					LIBS="$LIBS -ldl"
					tmp_SUCCESS="yes"
				]
			)
		]
	)

	# Windows
	if test "$tmp_SUCCESS" = "no"
	then
		AC_MSG_CHECKING([for LoadLibrary])
		AC_TRY_LINK(
			[#include <windows.h>],
			[LoadLibrary(NULL);],
			[
				AC_DEFINE(HAVE_LOADLIBRARY, 1, [Define if you have LoadLibrary])
				tmp_SUCCESS="yes"
			]
		)
		AC_MSG_RESULT([$tmp_SUCCESS])
	fi

	if test "$tmp_SUCCESS" = "no"
	then
		AC_MSG_ERROR([No dynamic library loading support])
	fi
])