-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.m4
46 lines (36 loc) · 1.51 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
PHP_ARG_WITH(gobject, for gobject support,
[ --with-gobject Enable gobject support], yes)
if test "$PHP_GOBJECT" != "no"; then
PHP_SUBST(GOBJECT_SHARED_LIBADD)
AC_DEFINE(HAVE_GOBJECT, 1, [ ])
PHP_NEW_EXTENSION(gobject, \
gobject_ext.c gobject_girepository.c gobject_helpers.c gobject_paramspec_class.c gobject_type_class.c gobject_gobject_class.c gobject_closure.c gobject_signal_class.c \
, $ext_shared)
EXT_GOBJECT_HEADERS="php_gobject.h"
ifdef([PHP_INSTALL_HEADERS], [
PHP_INSTALL_HEADERS(ext/gobject, $EXT_GOBJECT_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 gobject)
if $PKG_CONFIG --exists gobject-2.0; then
gobject_version_full=`$PKG_CONFIG --modversion gobject-2.0 gobject-introspection-1.0`
AC_MSG_RESULT([found $gobject_version_full])
GOBJECT_LIBS="$LDFLAGS `$PKG_CONFIG --libs gobject-2.0 gobject-introspection-1.0`"
GOBJECT_INCS="$CFLAGS `$PKG_CONFIG --cflags-only-I gobject-2.0 gobject-introspection-1.0`"
PHP_EVAL_INCLINE($GOBJECT_INCS)
PHP_EVAL_LIBLINE($GOBJECT_LIBS, GOBJECT_SHARED_LIBADD)
AC_DEFINE(HAVE_GOBJECT, 1, [whther gobject exists in the system])
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Ooops ! no gobject detected in the system)
fi
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Ooops ! no pkg-config found .... )
fi
fi