My favorites | Sign in
Project Logo
phc
                
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
AC_DEFUN([AC_CHECK_LIB_CRUN], [
AC_MSG_CHECKING([for /usr/lib/libCrun.so.1])
check_libcrun_save_LIBS=$LIBS
LIBS="/usr/lib/libCrun.so.1 $LIBS"
AC_LINK_IFELSE(
[AC_LANG_CALL([], [main])],
[AS_VAR_SET(use_libCrun, yes)
AC_MSG_RESULT(yes)
],
[AS_VAR_SET(use_libCrun, no)
AC_MSG_RESULT(no)
])
LIBS=$check_libcrun_save_LIBS
AS_IF(
[test AS_VAR_GET(use_libCrun) = yes],
[LIBS="/usr/lib/libCrun.so.1 $LIBS"])
])

AC_DEFUN([AC_CHECK_COVARIANCE], [
AC_MSG_CHECKING([whether compiler supports covariant returns])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[
class A { public: virtual A* x() { return new A(); } };
class B { public: virtual B* y() { return new B(); } };
class C : public A, B {
public: C* x() { return new C(); }
C* y() { return new C(); }
};
],
[]
)],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_FAILURE(use g++ >3.4)
]
)
])

AC_DEFUN([AC_CHECK_LIB_XERCES], [
AC_MSG_CHECKING([for -lxerces-c])
check_lib_xerces_LIBS=$LIBS
LIBS="-lxerces-c $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <xercesc/util/PlatformUtils.hpp>
XERCES_CPP_NAMESPACE_USE
],
[XMLPlatformUtils::Initialize();]
)],
[AS_VAR_SET(use_libXerces, yes)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_XERCES, 1)
],
[AS_VAR_SET(use_libXerces, no)
AC_MSG_RESULT(no)
])
LIBS=$check_lib_xerces_LIBS
AS_IF(
[test AS_VAR_GET(use_libXerces) = yes],
[LIBS="-lxerces-c $LIBS"])
AC_SUBST([use_libXerces])
])

dnl Takes a single parameter - where to look.
AC_DEFUN([AC_CHECK_PHP], [
AC_PATH_PROG([php], [php], [], ["$1/bin"])
# For config.h:
AC_DEFINE_UNQUOTED([PHP_INSTALL_PATH], ["$1"])
# For autovars.php.in:
AC_SUBST([php_install_path], ["$1"])
# For use below:
PHP_INSTALL_PATH=$1

dnl To check if the PHP embed SAPI has been installed, we temporarily add the
dnl PHP installation path to LDFLAGS and CFLAGS, and restore it later (since
dnl we do not need that path to build phc itself).
AS_VAR_SET(found_embed_sapi, yes)
OLD_LDFLAGS=$LDFLAGS
OLD_CFLAGS=$CFLAGS
LDFLAGS="-L${PHP_INSTALL_PATH}/lib $LDFLAGS"
CFLAGS="-isystem${PHP_INSTALL_PATH}/include/php -isystem${PHP_INSTALL_PATH}/include/php/main -isystem${PHP_INSTALL_PATH}/include/php/TSRM -isystem${PHP_INSTALL_PATH}/include/php/Zend $CFLAGS"
AC_CHECK_LIB(
[php5],
[zend_eval_string],
[
AS_VAR_SET(found_embed_sapi, yes)
AC_DEFINE(HAVE_EMBED, 1)
AC_SUBST([libphp_headers], ["-isystem${PHP_INSTALL_PATH}/include/php -isystem${PHP_INSTALL_PATH}/include/php/main -isystem${PHP_INSTALL_PATH}/include/php/TSRM -isystem${PHP_INSTALL_PATH}/include/php/Zend"])
LIBS="-lphp5 -L${PHP_INSTALL_PATH}/lib -R${PHP_INSTALL_PATH}/lib $LIBS"
],
[
AS_VAR_SET(found_embed_sapi, no)
],
[]
)
AC_CHECK_HEADER(
[sapi/embed/php_embed.h],
[],
[AS_VAR_SET(found_embed_sapi, no)],
[]
)
CFLAGS=$OLD_CFLAGS
LDFLAGS=$OLD_LDFLAGS
])


AC_DEFUN([PHC_CHECK_SVN],
[
AS_IF([test -d .svn], [AC_MSG_WARN([
***********************************************
* You are using the phc svn repository. Read *
* README.svn or you may experience problems. *
***********************************************]
)])
])
}
Show details Hide details

Change log

r2890 by paul.biggar on Jun 23, 2009   Diff
This adds a warning at the end of
configure for those using the svn
repository. It tells them to read
README.svn. While it may be irritating in
general, this seems to be the number one
problem people have when checking out the
source code (people don't read manuals or
READMEs it seems).
Go to: 
Sign in to write a code review

Older revisions

r1217 by paul.biggar on May 13, 2008   Diff
gcc 4.2 raises some warnings in the
PHP header files. Instead of using -I,
we can use -isystem to mark them as
system headers, and to ignore their
errors. This still results is some
...
r1017 by paul.biggar on Jan 31, 2008   Diff
Allow phc to be configured with the
--without-php flag. --with-php can
still be used at the command line.
This removes some code duplication by
moving the PHP checks into
...
r163 by edskodevries on Mar 27, 2007   Diff
Making the branch the new trunk/, and
moving trunk/ up one level, as
requested
by Paul. Still getting source-vs-
semantic errors, but that's a problem
...
All revisions of this file

File info

Size: 3168 bytes, 119 lines
Hosted by Google Code