Debian Codegraph @

acinclude.m4

raw
1 dnl AIDE_PKG_CHECK_MODULES(OPTION, PREFIX, LIBRARY, VERSION)
2 AC_DEFUN([AIDE_PKG_CHECK_MODULES],
3 [
4 if test "$aide_static_choice" = "yes"; then
5 PKG_CHECK_MODULES_STATIC($2, [$3 $4], [], [AC_MSG_ERROR([$3 $4 not found by pkg-config - Try --without-$1 or add directory containing $3.pc to PKG_CONFIG_PATH environment variable])])
6 else
7 PKG_CHECK_MODULES($2, [$3 $4], [], [AC_MSG_ERROR([$3 $4 not found by pkg-config - Try --without-$1 or add directory containing $3.pc to PKG_CONFIG_PATH environment variable])])
8 fi
9 AC_DEFINE(WITH_$2,1,[Define to 1 if $3 is available])
10 ])
11
12 dnl AIDE_PKG_CHECK_MODULES_OPTIONAL(OPTION, PREFIX, LIBRARY, VERSION)
13 AC_DEFUN([AIDE_PKG_CHECK_MODULES_OPTIONAL],
14 [
15 AS_IF([test x"$with_$1" != xno], [
16 if test "$aide_static_choice" = "yes"; then
17 PKG_CHECK_MODULES_STATIC($2, [$3 $4], [
18 with_$1=yes
19 ], [
20 AS_IF([test x"$with_$1" = xyes], [
21 AC_MSG_ERROR([$3 $4 not found by pkg-config - Try to add directory containing $3.pc to PKG_CONFIG_PATH environment variable])
22 ])
23 with_$1=no
24 ])
25 else
26 PKG_CHECK_MODULES($2, [$3 $4], [
27 with_$1=yes
28 ], [
29 AS_IF([test x"$with_$1" = xyes], [
30 AC_MSG_ERROR([$3 $4 not found by pkg-config - Try to add directory containing $3.pc to PKG_CONFIG_PATH environment variable])
31 ])
32 with_$1=no
33 ])
34 fi
35 AS_IF([test x"$with_$1" = xyes], [
36 AC_DEFINE(WITH_$2,1,[Define to 1 if $3 is available])
37 ])
38 ])
39 ])
40
41 dnl AIDE_PKG_CHECK(OPTION, DESCRIPTION, DEFAULT, PREFIX, LIBRARY, EXTRA_GROUP, VERSION)
42 AC_DEFUN([AIDE_PKG_CHECK],
43 [
44 AC_MSG_CHECKING(for $2)
45 AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1], [use $2 (default: $3)]), [with_$5=$withval], [with_$5=$3])
46
47 AS_IF([test x"$with_$5" = xyes], [
48 AC_MSG_RESULT(yes)
49 AIDE_PKG_CHECK_MODULES($1, $4, $5, $7)
50 if test -n $6; then
51 aideextragroups="${aideextragroups}+$6"
52 fi
53 ],[
54 AC_MSG_RESULT(no)
55 ])
56 compoptionstring="${compoptionstring}use $2: $with_$5\\n"
57 AM_CONDITIONAL(HAVE_$4, [test "x$$4_LIBS" != "x"])
58 ])
59
60 dnl AIDE_PKG_CHECK_MANDATORY(DESCRIPTION, PREFIX, LIBRARY)
61 AC_DEFUN([AIDE_PKG_CHECK_MANDATORY],
62 [
63 if test "$aide_static_choice" = "yes"; then
64 PKG_CHECK_MODULES_STATIC($2, [$3], [], [AC_MSG_ERROR([$3 not found by pkg-config - Try to add directory containing $3.pc to PKG_CONFIG_PATH environment variable])])
65 else
66 PKG_CHECK_MODULES($2, [$3], [], [AC_MSG_ERROR([$3 not found by pkg-config - Try to add directory containing $3.pc to PKG_CONFIG_PATH environment variable])])
67 fi
68 compoptionstring="${compoptionstring}use $1: mandatory\\n"
69 ])
70
71 dnl AIDE_PKG_CHECK_HEADERS(OPTION, DESCRIPTION, DEFAULT, PREFIX, HEADERS)
72 AC_DEFUN([AIDE_PKG_CHECK_HEADERS],
73 [
74 AC_MSG_CHECKING(for $1)
75 AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1], [$2 (default: $3)]), [with_$1=$withval], [with_$1=$3])
76 AC_MSG_RESULT([$with_$1])
77 AS_IF([test x"$with_$1" != xno], [
78 AC_CHECK_HEADERS($5, [
79 AS_IF([test x"$3" != xno], [
80 AC_DEFINE(WITH_$4,1,[Define to 1 if $1 is available])
81 with_$1="yes"
82 ])
83 ], [
84 AS_IF([test x"$3" = xyes], [
85 AC_MSG_ERROR([headers $5 for $1 not found])
86 ])
87 ])
88 ])
89 compoptionstring="${compoptionstring}use $2: $with_$1\\n"
90 AM_CONDITIONAL(HAVE_$4, [test "x$with_$1" = "xyes"])
91 ])
92
93 dnl AIDE_COMPILE_TIME_OPTION(OPTION, WITH_HELP_STRING, DESCRIPTION, DEFAULT)
94 AC_DEFUN([AIDE_COMPILE_TIME_OPTION],
95 [
96 AC_MSG_CHECKING(for $3)
97 AC_ARG_WITH([$1], AS_HELP_STRING([--with-$2], [$3 (default: $4)]), [with_$1=$withval], [with_$1=$4])
98 AC_MSG_RESULT([$with_$1])
99 compoptionstring="${compoptionstring}$3: $with_$1\\n"
100 ])