Line 0
Link Here
|
|
|
1 |
dnl ===================================================================== |
2 |
dnl DV_REQUIRE_CFUNC( function [$1], crypt |
3 |
dnl libraries [$2]) [ crypt crypto ] |
4 |
dnl ===================================================================== |
5 |
dnl This macro verifies that the C function $1 is available, if necesssary |
6 |
dnl after linking with one of the libraries in $2 (without lib prefix). |
7 |
dnl The library for which linking succeeds is added to $LIBS. |
8 |
dnl ===================================================================== |
9 |
AC_DEFUN([DV_REQUIRE_CFUNC], |
10 |
[ |
11 |
AC_LANG_PUSH(C) |
12 |
AC_CHECK_FUNC($1,, [ AC_SEARCH_LIBS($1,"$2",,AC_MSG_ERROR([need $1 function])) ]) |
13 |
AC_LANG_POP(C) |
14 |
]) |
15 |
|
16 |
dnl ===================================================================== |
17 |
dnl DV_CHECK_CFUNC( function [$1], crypt |
18 |
dnl libraries [$2]) [ crypt crypto ] |
19 |
dnl ===================================================================== |
20 |
dnl This macro checks whether the C function $1 is available, if necesssary |
21 |
dnl after linking with one of the libraries in $2 (without lib prefix). |
22 |
dnl The library for which linking succeeds is added to $LIBS. |
23 |
dnl ===================================================================== |
24 |
AC_DEFUN([DV_CHECK_CFUNC], |
25 |
[ |
26 |
AC_LANG_PUSH(C) |
27 |
AC_CHECK_FUNC($1,[ AC_DEFINE(HAVE_$1, [1], [C function $1]) ], |
28 |
[ AC_SEARCH_LIBS($1,"$2", AC_DEFINE(HAVE_$1, [1], [C function $1 in $2])) ]) |
29 |
AC_LANG_POP(C) |
30 |
]) |
31 |
dnl ===================================================================== |
32 |
dnl DV_REQUIRE_PROG( |
33 |
dnl pathvar[$1], [ GZIP ] |
34 |
dnl program-name[$2], [ gzip ] |
35 |
dnl bin-dirs[$3], [ [/usr/bin /usr/local/bin] ] |
36 |
dnl ===================================================================== |
37 |
dnl Find out where program-name is, checking directories in bin-dirs. |
38 |
dnl Set pathvar if found and abort if not found |
39 |
dnl ===================================================================== |
40 |
AC_DEFUN([DV_REQUIRE_PROG], |
41 |
[ |
42 |
$1="" |
43 |
AM_PATH_PROG_WITH_TEST($1,$2,true, ,[$3]) |
44 |
if test -z "$$1"; then |
45 |
AC_MSG_ERROR([program $2 not found]) |
46 |
fi |
47 |
]) |
48 |
|
49 |
AC_DEFUN([DV_APPEND_UNIQ], |
50 |
[ |
51 |
{ echo "${$2}" | grep -- "$1 " >/dev/null || $2="${$2} $1"; }dnl |
52 |
]) |
53 |
|
54 |
AC_DEFUN([DV_SET_LIBTOOL], |
55 |
[ |
56 |
AC_ARG_WITH(libtool, |
57 |
[ --with-libtool=path path of libtool program], |
58 |
dv_lt=$withval,dv_lt="libtool") |
59 |
]) |
60 |
|