-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.m4
78 lines (63 loc) · 2.45 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
PHP_ARG_WITH(gintrospection, Gobject Introspection Support,
[ --with-gintrospection Enable gintrospection support], yes)
if test "$PHP_GINTROSPECTION" != "no"; then
export OLD_CPPFLAGS="$CPPFLAGS"
export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_GINTROSPECTION"
AC_MSG_CHECKING(PHP version)
AC_TRY_COMPILE([#include <php_version.h>], [
#if PHP_VERSION_ID < 50400
#error this extension requires at least PHP version 5.4.0
#endif
],
[AC_MSG_RESULT(ok)],
[AC_MSG_ERROR([need at least PHP 5.4.0])])
export CPPFLAGS="$OLD_CPPFLAGS"
PHP_SUBST(GINTROSPECTION_SHARED_LIBADD)
AC_DEFINE(HAVE_GINTROSPECTION, 1, [ ])
PHP_NEW_EXTENSION(gintrospection, php_gintrospection.c repository.c typelib.c enum.c info.c, $ext_shared)
EXT_GINTROSPECTION_HEADERS="php_gintrospection_public.h"
ifdef([PHP_INSTALL_HEADERS], [
PHP_INSTALL_HEADERS(ext/gintrospection, $EXT_GINTROSPECTION_HEADERS)
])
PHP_ADD_EXTENSION_DEP(gintrospection, gobject)
PHP_ADD_EXTENSION_DEP(gintrospection, glib)
AC_MSG_CHECKING(for glib gtkforphp extension)
if test -f "$phpincludedir/ext/glib/php_glib_public.h"; then
PHP_ADD_INCLUDE($phpincludedir/ext/glib)
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for gobject gtkforphp extension)
if test -f "$phpincludedir/ext/gobject/php_gobject_public.h"; then
PHP_ADD_INCLUDE($phpincludedir/ext/glib)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(gobject gtkforphp extension not found.)
fi
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(glib gtkforphp extension not found.)
fi
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 gintrospection)
if $PKG_CONFIG --exists gobject-introspection-1.0; then
gir_version_full=`$PKG_CONFIG --modversion gobject-introspection-1.0`
AC_MSG_RESULT([found $gir_version_full])
GINTROSPECTION_LIBS="$LDFLAGS `$PKG_CONFIG --libs gobject-introspection-1.0`"
GINTROSPECTION_INCS="$CFLAGS `$PKG_CONFIG --cflags-only-I gobject-introspection-1.0`"
PHP_EVAL_INCLINE($GINTROSPECTION_INCS)
PHP_EVAL_LIBLINE($GINTROSPECTION_LIBS, GINTROSPECTION_SHARED_LIBADD)
AC_DEFINE(HAVE_GINTROSEPCTION, 1, [whether gintrospection library exists in the system])
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Ooops ! no gobject introspection library - libgintrospection - detected in the system)
fi
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Ooops ! no pkg-config found .... )
fi
fi