-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.m4
56 lines (45 loc) · 1.36 KB
/
config.m4
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
44
45
46
47
48
49
50
51
52
53
54
55
dnl
dnl Glib wrapper
dnl
PHP_ARG_WITH(glib, for glib support,
[ --with-glib Enable glib support], yes)
if test "$PHP_GLIB" != "no"; then
PHP_SUBST(GLIB_SHARED_LIBADD)
AC_DEFINE(HAVE_GLIB, 1, [ ])
PHP_NEW_EXTENSION(glib, \
src/glib.c \
src/functions.c \
src/main_context.c \
src/main_loop.c \
src/source.c \
src/source_timeout.c \
src/timer.c \
, $ext_shared)
EXT_GLIB_HEADERS="php_glib_api.h"
ifdef([PHP_INSTALL_HEADERS], [
PHP_INSTALL_HEADERS(ext/glib, $EXT_GLIB_HEADERS)
])
AC_MSG_CHECKING(for pkg-config)
if test ! -f "$PKG_CONFIG"; then
PKG_CONFIG=`which pkg-config`
fi
if test -f "$PKG_CONFIG"; then
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for glib)
if $PKG_CONFIG --exists glib-2.0; then
glib_version_full=`$PKG_CONFIG --modversion glib-2.0`
AC_MSG_RESULT([found $glib_version_full])
GLIB_LIBS="$LDFLAGS `$PKG_CONFIG --libs glib-2.0`"
GLIB_INCS="$CFLAGS `$PKG_CONFIG --cflags-only-I glib-2.0`"
PHP_EVAL_INCLINE($GLIB_INCS)
PHP_EVAL_LIBLINE($GLIB_LIBS, GLIB_SHARED_LIBADD)
AC_DEFINE(HAVE_GLIB, 1, [whther glib exists in the system])
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Ooops ! no glib detected in the system)
fi
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Ooops ! no pkg-config found .... )
fi
fi