summaryrefslogtreecommitdiff
path: root/m4/ecore_check_c_extension.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/ecore_check_c_extension.m4')
-rw-r--r--m4/ecore_check_c_extension.m431
1 files changed, 6 insertions, 25 deletions
diff --git a/m4/ecore_check_c_extension.m4 b/m4/ecore_check_c_extension.m4
index 1ef3bd2f91..9918a4b9a2 100644
--- a/m4/ecore_check_c_extension.m4
+++ b/m4/ecore_check_c_extension.m4
@@ -1,42 +1,23 @@
1dnl use: ECORE_CHECK_X_EXTENSION(Foo, header, lib, func, want) 1dnl use: ECORE_CHECK_X_EXTENSION(Foo, header, lib, func)
2AC_DEFUN([ECORE_CHECK_X_EXTENSION], 2AC_DEFUN([ECORE_CHECK_X_EXTENSION],
3[ 3[
4pushdef([UP], translit([$1], [a-z], [A-Z]))dnl 4pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
5pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
6 5
7UP[]_CFLAGS=""
8UP[]_LIBS=""
9use_[]DOWN="no"
10
11if test "x$5" != "xno"; then
12 SAVE_CFLAGS=$CFLAGS 6 SAVE_CFLAGS=$CFLAGS
13 CFLAGS="$x_cflags $x_includes" 7 CFLAGS="$x_cflags $x_includes"
14 AC_CHECK_HEADER(X11/extensions/$2, 8 AC_CHECK_HEADER(X11/extensions/$2,
15 [ 9 [
16 AC_CHECK_LIB($3, $4, 10 AC_CHECK_LIB($3, $4,
17 [ 11 [AC_DEFINE(ECORE_[]UP, 1, [Build support for $1])],
18 AC_DEFINE(ECORE_[]UP, 1, [Build support for $1]) 12 [AC_MSG_ERROR([Missing support for X extension: $1])],
19 UP[]_LIBS="-l$3" 13 [$x_libs])
20 use_[]DOWN="yes"
21 ],
22 [use_[]DOWN="no"],
23 [$x_libs]
24 )
25 ], 14 ],
26 [ use_[]DOWN="no" ], 15 [AC_MSG_ERROR([Missing X11/extensions/$2])],
27 [ #include <X11/Xlib.h> ] 16 [ #include <X11/Xlib.h> ]
28 ) 17 )
29 CFLAGS=$SAVE_CFLAGS 18 CFLAGS=$SAVE_CFLAGS
30else
31 use_[]DOWN="no"
32 AC_MSG_NOTICE([$1 support disabled])
33fi
34
35ECORE_X_LIBS="${ECORE_X_LIBS} ${UP[]_LIBS}"
36 19
37AC_SUBST(UP[]_CFLAGS) 20ECORE_X_LIBS="${ECORE_X_LIBS} -l$3"
38AC_SUBST(UP[]_LIBS)
39 21
40popdef([UP]) 22popdef([UP])
41popdef([DOWN])
42]) 23])