-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
65 lines (50 loc) · 2.75 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
PHP_ARG_WITH(wxwidgets,for wxWidgets support,
[ --with-wxwidgets[=DIR] enable wxWidgets extension (requires wxWidgets >= 2.9.3).])
PHP_ARG_ENABLE(wxwidgets-debug, whether to enable debugging support in wxPHP,
[ --enable-wxwidgets-debug
Enable debugging messages support in wxPHP], no, no)
if test "$PHP_WXWIDGETS" != "no"; then
dnl Instruct the PHP build system to use a C++ compiler
PHP_REQUIRE_CXX()
dnl Default wx-config command
WXCONFIG_PATH=wx-config
dnl Check for the installation path of wx-config
AC_MSG_CHECKING([for wx-config existance and wxWidgets version >= 2.9.x])
for directory in "$PHP_WXWIDGETS" "$PHP_WXWIDGETS/bin" /usr /usr/bin /usr/local /usr/local/bin; do
if test -e "$directory/wx-config"; then
wxwidgets_version=`$directory/wx-config --version`
version_check=`echo $wxwidgets_version | grep "2.9" && echo $wxwidgets_version | grep "3.[0-9]"`
if test -n "$version_check"; then
WXCONFIG_PATH="$directory/wx-config"
AC_MSG_RESULT([version $wxwidgets_version found])
break
fi
fi
done
dnl Show error if wxWidgets was not found
if test ! -e $WXCONFIG_PATH; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([A matching wxWidgets installation was not found])
fi
dnl Check whether to enable debugging messages
if test "$PHP_WXWIDGETS_DEBUG" != "no"; then
dnl Yes, so set the C macro
AC_DEFINE(USE_WXPHP_DEBUG,1,[Include debugging support in wxPHP])
fi
dnl Retreive and store wxWidgets compiler flags
PHP_WXWIDGETS_CFLAGS=`$WXCONFIG_PATH --cxxflags`
dnl Retreive and store wxWidgets library flags
PHP_WXWIDGETS_LIBS=`$WXCONFIG_PATH --libs`
dnl Append wxWidgets flags to the compiler flags and suppress warning flags
CXXFLAGS="$CXXFLAGS $PHP_WXWIDGETS_CFLAGS"
dnl Add header search paths to the PHP build system
PHP_EVAL_INCLINE($PHP_WXWIDGETS_CFLAGS)
dnl Add libraries and or library search paths to the PHP build system
PHP_EVAL_LIBLINE($PHP_WXWIDGETS_LIBS, WXWIDGETS_SHARED_LIBADD)
dnl Adds variable with value into Makefile for example CC = gcc
PHP_SUBST(WXWIDGETS_SHARED_LIBADD)
dnl Link the C++ standard library
PHP_ADD_LIBRARY(stdc++, 1 , WXWIDGETS_SHARED_LIBADD)
dnl PHP_NEW_EXTENSION(extname, sources [, shared [, sapi_class [, extra-cflags [, cxx [, zend_ext]]]]])
PHP_NEW_EXTENSION(wxwidgets, app.cpp references.cpp appmanagement.cpp cfg.cpp bookctrl.cpp dnd.cpp cmndlg.cpp containers.cpp ctrl.cpp data.cpp dc.cpp docview.cpp events.cpp file.cpp gdi.cpp grid.cpp html.cpp help.cpp logging.cpp managedwnd.cpp menus.cpp misc.cpp miscwnd.cpp media.cpp pickers.cpp printing.cpp ribbon.cpp richtext.cpp rtti.cpp stc.cpp streams.cpp threading.cpp validator.cpp vfs.cpp aui.cpp winlayout.cpp xml.cpp xrc.cpp dvc.cpp others.cpp functions.cpp wxwidgets.cpp, $ext_shared,,,1)
fi