summaryrefslogtreecommitdiff
path: root/m4/ecore_check_c_extension.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
commit7d6010b12c47a20e492da808e3192c3f87dab619 (patch)
tree26c6fd189e046a76560c0bc740b85f4d767ae399 /m4/ecore_check_c_extension.m4
parent53fc441d5475155965d92da89502fe4634a561b2 (diff)
merge: add escape ecore, fix several bugs
SVN revision: 79995
Diffstat (limited to 'm4/ecore_check_c_extension.m4')
-rw-r--r--m4/ecore_check_c_extension.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/m4/ecore_check_c_extension.m4 b/m4/ecore_check_c_extension.m4
new file mode 100644
index 0000000000..1ef3bd2f91
--- /dev/null
+++ b/m4/ecore_check_c_extension.m4
@@ -0,0 +1,42 @@
1dnl use: ECORE_CHECK_X_EXTENSION(Foo, header, lib, func, want)
2AC_DEFUN([ECORE_CHECK_X_EXTENSION],
3[
4pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
5pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
6
7UP[]_CFLAGS=""
8UP[]_LIBS=""
9use_[]DOWN="no"
10
11if test "x$5" != "xno"; then
12 SAVE_CFLAGS=$CFLAGS
13 CFLAGS="$x_cflags $x_includes"
14 AC_CHECK_HEADER(X11/extensions/$2,
15 [
16 AC_CHECK_LIB($3, $4,
17 [
18 AC_DEFINE(ECORE_[]UP, 1, [Build support for $1])
19 UP[]_LIBS="-l$3"
20 use_[]DOWN="yes"
21 ],
22 [use_[]DOWN="no"],
23 [$x_libs]
24 )
25 ],
26 [ use_[]DOWN="no" ],
27 [ #include <X11/Xlib.h> ]
28 )
29 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
37AC_SUBST(UP[]_CFLAGS)
38AC_SUBST(UP[]_LIBS)
39
40popdef([UP])
41popdef([DOWN])
42])