forked from mahmoudimus/prothon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
114 lines (85 loc) · 2.62 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(include/prothon/prothon.h)
AC_CONFIG_HEADER(include/config.h)
dnl Grab some of our macros
sinclude(ac-macros/find_apr.m4)
sinclude(ac-macros/find_apu.m4)
sinclude(ac-macros/libtool.m4)
sinclude(ac-macros/pkg.m4)
PACKAGE_VERSION="0.0"
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_YACC
CFLAGS="$CFLAGS -Wall"
PROTHON_DEFAULT_MODDIR="${libdir}/prothon-${PACKAGE_VERSION}"
AC_SUBST(PROTHON_DEFAULT_MODDIR)
HAVE_BOOST_REGEX=no
BOOST_REGEX_LIBS=
AC_CHECK_HEADER(boost/regex.h,
[AC_CHECK_LIB(boost_regex, regexecA, [
HAVE_BOOST_REGEX=yes
BOOST_REGEX_LIBS=-lboost_regex
])])
AC_SUBST(HAVE_BOOST_REGEX)
AC_SUBST(BOOST_REGEX_LIBS)
PKG_CHECK_MODULES(SQLITE, sqlite, [HAVE_SQLITE=yes], [HAVE_SQLITE=no])
AC_SUBST(HAVE_SQLITE)
AC_CHECK_HEADER(sys/utsname.h, [
AC_DEFINE([HAVE_SYS_UTSNAME_H], [], [Define this to 1 if you have sys/utsname.h])
])
APR_FIND_APR("$srcdir/apr", "./apr", 1)
APR_FIND_APU("$srcdir/apr-util", "./apr-util", 1)
if test $apr_found = "no"; then
AC_MSG_ERROR([no suitable apr found])
fi
if test $apu_found = "no"; then
AC_MSG_ERROR([no suitable aprutil found])
fi
CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --cppflags failed])
fi
CPPFLAGS="$CPPFLAGS `$apr_config --includes`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --includes])
fi
CFLAGS="$CFLAGS `$apr_config --cflags`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --cflags failed])
fi
LDFLAGS="$LDFLAGS `$apr_config --ldflags`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --ldflags failed])
fi
LINK_LD="$LINK_LD `$apr_config --link-ld --libs`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --link-ld --libs failed])
fi
LINK_LIBTOOL="$LINK_LIBTOOL `$apr_config --link-libtool --libs`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --link-libtool --libs failed])
fi
dnl APU
CPPFLAGS="$CPPFLAGS `$apu_config --includes`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --includes])
fi
LDFLAGS="$LDFLAGS `$apu_config --ldflags`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --ldflags failed])
fi
LINK_LD="$LINK_LD `$apu_config --link-ld --libs`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --link-ld --libs failed])
fi
LINK_LIBTOOL="$LINK_LIBTOOL `$apu_config --link-libtool --libs`"
if test $? -ne 0; then
AC_MSG_ERROR([apu-config --link-libtool --libs failed])
fi
AC_SUBST(LINK_LD)
AC_SUBST(LINK_LIBTOOL)
AC_OUTPUT(Rules.mk Makefile src/Makefile modules/Makefile
modules/Re/Makefile
modules/Prosist/Makefile modules/SQLite/Makefile
modules/OS/Makefile modules/DBM/Makefile)