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
dnl phc -- the open source PHP compiler
dnl See doc/license/README.license for licensing information
dnl
dnl Process this file using autoconf to produce configure

# Running aclocal, automake and autoconf can produce errors. These are avoided by running aclocal:
# $ aclocal -I /usr/share/autoconf-archive -I libltdl
# which adds the macros needed for libtool, boost, etc.

dnl Autoconf requirements
AC_INIT([phc],[0.2.0],[phc-general@phpcompiler.org])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])
AC_PREREQ(2.63) # 2.61 adds a warning. Pre-2.61 just doesnt work.

PHC_CHECK_SVN

dnl configure automake
AM_INIT_AUTOMAKE([foreign -Wall -Werror 1.10]) # 1.10 changed a lot of things.
AM_MAINTAINER_MODE


dnl checks for programs
AC_PROG_CC
AC_PROG_CXX

dnl Configure libtool and libltdl
LT_INIT([dlopen])
LT_CONFIG_LTDL_DIR([libltdl])
LTDL_INIT([convenience])


dnl check for other programs
AC_PATH_PROG([gengetopt], [gengetopt])
AC_PATH_PROG([gperf], [gperf])
AC_PATH_PROG([flex], [flex])
AC_PATH_PROG([bison], [bison])
AC_PATH_PROG([valgrind], [valgrind])
AC_PATH_PROG([dot], [dot])
AC_PATH_PROG([graphviz_gc], [gc])
AX_BOOST_BASE([1.35.0])

AC_ARG_WITH([maketea],
AS_HELP_STRING([--with-maketea], [path to maketea (if installed)]),
[AC_PATH_PROG([maketea], [maketea], [], [${withval}:${withval}/bin])],
[AC_PATH_PROG([maketea], [maketea])]
)

dnl This seems like more of a --enable/disable option, but the maketea and php options both use --with/without
dnl AC_CHECK_LIB_XERCES
AC_ARG_WITH([xerces],
[AS_HELP_STRING([--with-xerces], [support XML input @<:@default=check@:>@])],
[], # with_xerces is set to true false anyway
[with_xerces=check]
)

# check PHP path
AC_ARG_WITH([php],
AS_HELP_STRING([--with-php=PATH], [PHP installation path (defaults to /usr/local)]),
[
AS_IF([test "x$with_php" != xno],
[AC_CHECK_PHP([$withval])], [AS_VAR_SET([found_embed_sapi], [no])])
],
[
AC_CHECK_PHP([/usr/local])
])


dnl Package information
AC_ARG_ENABLE([gc],
[AS_HELP_STRING([--disable-gc], [Link to the Boehm garbage collector @<:@default=enabled@:>@])])


dnl checks for libraries
AC_LANG([C++])
AC_CHECK_COVARIANCE
AC_CHECK_LIB_CRUN

dnl check xerces unless disabled
AS_IF([test "x$with_xerces" != xno], [AC_CHECK_LIB_XERCES], [])

# USE GC unless disabled
AS_IF([test "x$enable_gc" != xno],
[
AC_CHECK_HEADER([gc/gc_cpp.h], [], [AC_MSG_FAILURE(libgc required)])
AC_CHECK_LIB([gc], [main], [], [AC_MSG_FAILURE(libgc required)])
AC_SUBST([gc_lib], [-lgc])
],
[AC_DEFINE(DISABLE_GC, 1)])


# Finishing
# phc_compile_plugin and test/scripts/lib/autovars.php are created using their
# own Make rules, as it's not possible to expand directory prefixes using this
# mechanism. See the autoconf manual, section "Installation Directory
# Variables".
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

# Warn if libphp5 wasn't found
AS_IF(
[test AS_VAR_GET([found_embed_sapi]) = no],
[AC_MSG_WARN(
[
*******************************************************************************
* It seems the PHP embed SAPI has not been installed. *
* *
* You will be able to compile and run phc, but you will not be able to *
* compile PHP scripts with phc. *
* *
* To install the PHP embed SAPI, follow the PHP installation instructions, *
* but make sure to pass the --enable-embed option to the PHP configure *
* script. *
*******************************************************************************]
)])

PHC_CHECK_SVN
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

r2889 by paul.biggar on Jun 23, 2009   Diff
Remove checks for 'diff' and 'patch',
which we haven't used in a long time.

When boostrapping the autotools files,
this also added extra BOOST_* flags.
...
r2560 by paul.biggar on Apr 16, 2009   Diff
Use (and now require) autoconf version
2.63. This avoids the useless warnings
generated by libltdl, by automatically
adding the --disable-option-checking
option to libltdl's configure script.
...
r2359 by paul.biggar on Feb 01, 2009   Diff
Simplify libtool initialization in
autoconf. With thanks to Ralf
Wildenhues.
All revisions of this file

File info

Size: 3787 bytes, 118 lines
Hosted by Google Code