forked from pbiggar/phc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
104 lines (86 loc) · 3.54 KB
/
configure.ac
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
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.3.0], [[email protected]])
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], [config/phc_missing gengetopt])
AC_PATH_PROG([gperf], [gperf], [config/phc_missing gperf])
AC_PATH_PROG([flex], [flex], [config/phc_missing flex])
AC_PATH_PROG([bison], [bison], [config/phc_missing bison])
AC_PATH_PROG([valgrind], [valgrind])
AC_PATH_PROG([dot], [dot])
AC_PATH_PROG([graphviz_gc], [gc])
AC_ARG_WITH([maketea],
AS_HELP_STRING([--with-maketea], [path to maketea (if installed)]),
[AC_PATH_PROG([maketea], [maketea], [config/phc_missing maketea], [${withval}:${withval}/bin])],
[AC_PATH_PROG([maketea], [maketea], [config/phc_missing maketea])]
)
dnl checks for libraries
AC_LANG([C++])
AC_CHECK_COVARIANCE
AC_CHECK_LIB_CRUN
AX_BOOST_BASE([1.35.0])
AX_BOOST_REGEX
dnl PHP
PHP_EMBED
dnl Xerces
AX_LIB_XERCES
AC_SUBST([HAVE_XERCES], [$HAVE_XERCES]) # for autovars.php
AS_IF([test "x$HAVE_XERCES" != xno],
[AC_DEFINE([HAVE_XERCES], [1])]) # for config.h
dnl Boehm-gc
AC_ARG_ENABLE([gc],
[AS_HELP_STRING([--disable-gc], [Link to the Boehm garbage collector @<:@default=enabled@:>@])])
# Use GC unless disabled
# libgccpp overrides ::new, which is required to collect the Boost Graph Library.
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_CHECK_LIB([gccpp], [main], [], [AC_MSG_FAILURE(libgccpp required)])
AC_SUBST([gc_lib], ["-lgc -lgccpp"])
],
[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. *
*******************************************************************************]
)])