forked from wwccss/phpsciter_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
85 lines (71 loc) · 3.1 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
dnl $Id$
dnl config.m4 for extension phpsciter
dnl If your extension references something external, use with:
dnl PHP_ARG_WITH(phpsciter, for phpsciter support,
dnl Make sure that the comment is aligned:
dnl [ --with-phpsciter Include phpsciter support]) dnl指定了PHP扩展模块的工作方式
dnl Otherwise use enable:
PHP_ARG_ENABLE(phpsciter, whether to enable phpsciter support,
Make sure that the comment is aligned:
[ --enable-phpsciter Enable phpsciter support]) dnl指定了PHP扩展模块的工作方式
if test "$PHP_PHPsciter" != "no"; then
dnl Write more examples of tests here...
dnl # --with-phpsciter -> add include path
dnl PHP_ADD_INCLUDE($PHPsciter_DIR/include)
dnl # --with-phpsciter -> check for lib and symbol presence
dnl LIBNAME=phpsciter # you may want to change this
dnl LIBSYMBOL=phpsciter # you most likely want to change this
dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
dnl [
dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PHPsciter_DIR/$PHP_LIBDIR, PHPsciter_SHARED_LIBADD)
dnl AC_DEFINE(HAVE_PHPsciterLIB,1,[ ])
dnl ],[
dnl AC_MSG_ERROR([wrong phpsciter lib version or lib not found])
dnl ],[
dnl -L$PHPsciter_DIR/$PHP_LIBDIR -lm
dnl ])
dnl
dnl PHP_SUBST(PHPsciter_SHARED_LIBADD)
PHP_REQUIRE_CXX()
PHP_SUBST(PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(stdc++, 1, PHPSCITER_SHARED_LIBADD)
# PHP_SUBST(PHP_FRAMEWORKS)
# PHPSCITER_CFLAGS=-DKAFFE
case $host in
*darwin*)
THIS_DIR=`dirname $0`
MAKE_LIB_JSONNET=`cd ${THIS_DIR}/lib && make php-window.o`
PHP_ADD_LIBRARY(objc, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(sciter-osx-64, ./lib, PHPSCITER_SHARED_LIBADD)
PHP_ADD_FRAMEWORK_WITH_PATH(Cocoa, /System/Library/Frameworks)
CXXFLAGS="$CXXFLAGS -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11"
window_file="lib/php-window.mm"
;;
*linux*)
gtkconfig=`pkg-config --cflags --libs gtk+-3.0`
CXXFLAGS="$CXXFLAGS $gtkconfig -w -std=c++11 -fno-stack-protector"
PHP_ADD_LIBRARY(gtk-3, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(gdk-3, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(atk-1.0, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(gio-2.0, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(pangocairo-1.0, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(gdk_pixbuf-2.0, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(cairo-gobject, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(pango-1.0, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(cairo, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY(gobject-2.0, 1, PHPSCITER_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(sciter-gtk-64, ./lib, PHPSCITER_SHARED_LIBADD)
window_file="lib/php-window-linux.cpp"
;;
esac
source_file="$window_file \
src/callback.cpp \
src/tool.cpp \
src/value.cpp \
phpsciter.cpp"
PHP_ADD_INCLUDE(./include)
PHP_ADD_BUILD_DIR($ext_builddir/lib)
PHP_ADD_BUILD_DIR($ext_builddir/src)
PHP_NEW_EXTENSION(phpsciter, $source_file, $ext_shared)
PHP_ADD_MAKEFILE_FRAGMENT
fi