This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
config.m4
92 lines (73 loc) · 2.78 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
dnl $Id$
dnl config.m4 for extension php-gtk
PHP_ARG_ENABLE(php-gtk,for PHP-GTK support,
[
PHP-GTK Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--enable-php-gtk Enable PHP-GTK support])
if test "$PHP_PHP_GTK" != "no"; then
AC_MSG_CHECKING(for PHP executable)
PHP_PREFIX=`$PHP_CONFIG --prefix 2>/dev/null`
PHP=`$PHP_CONFIG --php-binary 2>/dev/null`
if test -x "$PHP" -o -x "$PHP_PREFIX/bin/php"; then
PHP_VERSION=`$PHP_CONFIG --version 2>/dev/null`
AC_MSG_RESULT(found version $PHP_VERSION)
case $PHP_VERSION in
4*|5.0*|5.1.0)
AC_MSG_ERROR([
Could not locate PHP 5.1.1 or higher version executable.
Please use the --with-php-config option to specify
the location of php-config for the required version.])
;;
esac
if test ! -x "$PHP"; then
PHP=$PHP_PREFIX/bin/php
fi
else
AC_MSG_ERROR(Could not locate PHP executable)
fi
PHP_SAPI=`$PHP --version | head -1 | sed -n 's/.*(\(...\)).*/\1/p'`
if test "$PHP_SAPI" != "cli" ; then
AC_MSG_ERROR(PHP CLI version is required[,] $PHP_SAPI found)
fi
AC_PROG_AWK
PHP_SUBST(AWK)
PHP_SUBST(PHP)
BSD_MAKEFILE=no
case $host_alias in
*bsdi*)
BSD_MAKEFILE=yes;;
esac
AC_DEFINE(HAVE_PHP_GTK, 1, [If PHP-GTK support is enabled])
fi
PHP_GTK_ARG_ENABLE(debug, whether to include debugging symbols,
[ --enable-debug Compile with debugging symbols.], no)
if test "$PHP_GTK_DEBUG" = "yes"; then
echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g"
if test "$CFLAGS" = "-g -O2"; then
CFLAGS=-g
fi
test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
fi
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
CFLAGS_CLEAN=$CFLAGS
PHP_SUBST(CFLAGS_CLEAN)
dnl reading config stubs
esyscmd(./build2/config-stubs ext)
PHP_SUBST(PHP_GTK_EXTENSIONS)
PHP_SUBST(PHP_GTK_GEN_SOURCES)
PHP_NEW_EXTENSION(php_gtk2, main/php_gtk.c main/phpg_support.c main/phpg_gtype.c \
main/phpg_exceptions.c main/php_gtk_util.c main/phpg_gvalue.c \
main/phpg_closure.c main/phpg_gboxed.c main/phpg_gpointer.c \
main/phpg_atom.c main/phpg_paramspec.c main/phpg_gobject.c,
$ext_shared,, -I@ext_srcdir@/main)
PHP_MODULES="$PHP_MODULES $PHP_GTK_MODULES"
EXT_PHPGTK_HEADERS="main/php_gtk_api.h"
ifdef([PHP_INSTALL_HEADERS], [
PHP_INSTALL_HEADERS(ext/php_gtk2, $EXT_PHPGTK_HEADERS)
])
PHP_ADD_SOURCES_X(/main, php_gtk_ext.c,, shared_objects_php_gtk2)
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/main/Makefile.frag, $abs_srcdir/main, main)
PHP_HELP_SEPARATOR([Libtool options:])
echo "creating main/php_gtk_ext.c"
sh $srcdir/build2/genext.sh $srcdir/main/php_gtk_ext.c.in $srcdir "" $AWK $PHP_GTK_EXTENSIONS > $srcdir/main/php_gtk_ext.c