This repository has been archived by the owner on Jan 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
configure.in
263 lines (225 loc) · 7.03 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
dnl $Id$
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT([okws], [3.1.38.1])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([subdir-objects])
SFS_INIT_LDVERSION(3500, SFSLITE_ABI_VERSION)
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(PUB)
AC_SUBST(XMLRPCC)
AC_SUBST(OKRPCC)
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC([clang gcc cc])
AC_PROG_CPP
AC_PROG_CXX([clang++ g++ c++])
OKWS_BISON
SFS_WFLAGS
SFS_PATH_CPP
AC_PROG_INSTALL_C
AC_PROG_LN_S
AC_PATH_PROG(PERL, perl, perl)
AC_PATH_PROGS(M4, gm4 gnum4 m4, '$(top_srcdir)/missing')
AC_PATH_PROGS(UPTIME, uptime, '$(top_srcdir)/missing')
dnl
dnl On FreeBSD, look for PTH by default. However, PTH stopped working
dnl on Linux with hard system calls, so use pthreads by default on
dnl Linux, and don't give the option for PTH.
dnl
OKWS_DO_THREADS
test "$PUB" || PUB='$(top_builddir)/pub/pub'
test "$XMLRPCC" || XMLRPCC='$(top_builddir)/xmlrpcc/xmlrpcc'
test "$RPCC" || RPCC='/usr/local/bin/rpcc'
test "$TAME" || TAME='/usr/local/bin/tame'
dnl
dnl OKWS_TAG might set "with_sfs", so it should come before
dnl SFS_SFS, which will reset it if needs be
dnl
OKWS_TAG
# XXX - next line seems to be required for some autoconf/-make/libtool versions
test -z "$target" && target=NONE
AC_DISABLE_SHARED
AM_PROG_LIBTOOL
AM_PROG_LEX
AM_CONDITIONAL(STATIC, test "$enable_shared" != yes)
AM_PATH_PYTHON(,, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
SFS_SFS
SFS_SET_CLOCK
SFS_FIND_RESOLV
OKWS_CHECK_SFS_DEBUG
OKWS_LIBS
OKWS_MYSQL
OKWS_EXPAT
OKWS_GMTOFF
OKWS_SSL
OKWS_SNAPPY
OKWS_HIREDIS
OKWS_LINUX_PRCTL_DUMP
dnl
dnl Extracting major/minor/patch level from the package version
dnl
okws_version_major="$(echo "${PACKAGE_VERSION}" | cut -f 1 -d ".")"
okws_version_minor="$(echo "${PACKAGE_VERSION}" | cut -f 2 -d ".")"
okws_version_patchlevel="$(echo "${PACKAGE_VERSION}" | cut -f 3 -d ".")"
AC_SUBST(okws_version_major)
AC_SUBST(okws_version_minor)
AC_SUBST(okws_version_patchlevel)
dnl
dnl Need to use the xmlrpcc if possible when publishing OKWS .x files
dnl
OKRPCC="$RPCC"
if test "${use_xml}" = "yes"
then
OKRPCC="$XMLRPCC"
fi
AM_CONDITIONAL(USE_MYSQL, test "${sfs_cv_libmysqlclient+set}")
AM_CONDITIONAL(USE_REDIS, test "${okws_cv_libhiredis+set}")
SFS_LAYOUT_VERSION
SFS_MAKE_SYMLINK
SHORTVERSION=`echo ${layoutversion} | awk -F. '{ print $1 "." $2 }' `
AC_SUBST(SHORTVERSION)
if test -z "$okwslibdir"; then
okwslibdirp='${pkglibdir}-${SHORTVERSION}'
okwslibdir='${pkglibdir}-${SHORTVERSION}${okwstagdir}'
fi
if test -z "$okwsincludedir"; then
okwsincludedirp='${pkgincludedir}-${SHORTVERSION}'
okwsincludedir='${pkgincludedir}-${SHORTVERSION}${okwstagdir}'
fi
okwsexecdir="$okwslibdir"
CPPFLAG="$CPPFLAGS -DEXECDIR="'\"$(okwsexecdir)\"'
if test "${okws_systembin+set}" = "set" ; then
okwsbindir='${prefix}/bin'
else
okwsbindir="$okwslibdir"
fi
AC_SUBST(okwsincludedir)
AC_SUBST(okwsincludedirp)
AC_SUBST(okwslibdir)
AC_SUBST(okwsbindir)
AC_SUBST(okwslibdirp)
AC_SUBST(okwsexecdir)
SFS_CFLAGS
CPPFLAGS="$CPPFLAGS -I"'$(top_srcdir)'
dnl
dnl for .x files, need header in build directory
dnl
for lib in libpub libaok libweb libamysql ezdb/libezdb; do
CPPFLAGS="$CPPFLAGS -I"'$(top_builddir)'"/$lib"
done
dnl
dnl library directories
dnl
for lib in libpub libahttp libokxml libaok libamt libamt_pthread libamysql \
libweb libokssl librfn ezdb/libezdb libredis; do
CPPFLAGS="$CPPFLAGS -I"'$(top_srcdir)'"/$lib"
done
dnl
dnl when compiling the PUB program, do not link againgst libahttp
dnl
LIBPUB='$(top_builddir)/libpub/libpub.la'
LIBAHTTP='$(top_builddir)/libahttp/libahttp.la'
LIBOKXML='$(top_builddir)/libokxml/libokxml.la'
LIBAOK='$(top_builddir)/libaok/libaok.la'
LIBAMT='$(top_builddir)/libamt/libamt.la'
LIBREDIS='$(top_builddir)/libredis/libredis.la'
if test "$ac_do_pthreads" = "1"; then
LIBAMT_PTHREAD='$(top_builddir)/libamt_pthread/libamt_pthread.la'
fi
LIBAMYSQL='$(top_builddir)/libamysql/libamysql.la'
LIBWEB='$(top_builddir)/libweb/libweb.la'
LIBEZDB='$(top_builddir)/ezdb/libezdb/libezdb.la'
LIBEZDBSRV='$(top_builddir)/ezdb/libezdb/libezdbsrv.la'
LIBOKSSL='$(top_builddir)/libokssl/libokssl.la'
LIBRFN='$(top_builddir)/librfn/librfn.la'
LDADD_PUB='$(LIBPUB) '"$LDADD"
LDADD_RFN='$(LIBRFN) $(LIBAHTTP) $(LIBPUB) '"$LDADD"
LDADD='$(LIBEZDB) $(LIBAOK) $(LIBRFN) $(LIBWEB) $(LIBOKSSL) $(LIBOKXML) $(LIBAHTTP) $(LIBPUB) '"$LDADD"' $(LIBEXPAT) $(LIBSSL)'
LDADD_AMT='$(LIBAMT) $(LIBAMT_PTHREAD)'"$LDADD"
LDADD_REDIS='$(LIBREDIS) $(LIBHIREDIS)'
if test "$enable_shared" = yes; then
LDEPS=
LDEPS_PUB=
LDEPS_RFN=
LDEPS_AMT=
else
LDEPS_PUB='$(LIBPUB) '"$LDEPS"
LDEPS_RFN='$(LIBPUB) $(LIBAHTTP) $(LIBRFN) '"$LDEPS"
LDEPS='$(LIBWEB) $(LIBAOK) $(LIBAHTTP) $(LIBOKXML) $(LIBPUB) '"$LDEPS"
LDEPS_AMT='$(LIBAMT) $(LIBAMT_PTHREAD)'"$LDEPS"
LDEPS_AMYSQL='$(LIBEZDBSRV) $(LIBAMT) $(LIBAMT_PTHREAD) $(LIBAMYSQL) '"$LDEPS"
LDEPS_REDIS='$(LIBREDIS) '"$LDEPS"
fi
LDADD_AMYSQL='$(LIBEZDBSRV) $(LIBAMT) $(LIBAMT_PTHREAD) $(LIBAMYSQL) '"$LDADD"' $(LDADD_THR) $(LDADD_MYSQL) '
dnl
dnl Where OKWS stores its files (except for those otherwise dumped
dnl in lib/ and include/)
dnl
OKWS_PREFIX
dnl
dnl Macros and variables for dealing with an OKWS 'Module'.
dnl An OKWS 'Module' is a bundle of services, libraries, and maybe
dnl DB-proxies or RPC servers. In this case, we're just build a test
dnl module for out-of-the-box testing. In other cases, we might
dnl be using this macro to build something useful.
dnl
OKWS_MODULE
dnl
dnl prefer c++11
dnl
SFS_CPP11_IF_POSSIBLE
dnl
dnl The OKWS prefix macro sets the module name to $PACKAGE, but
dnl we want to hardcode to 'test' in this case.
dnl
module_name='test'
dnl
dnl Set FLEX version since we have version-specific fixes for FLEX memory
dnl leaks
dnl
OKWS_FLEX_VERSION
ETAGS_ARGS='-C /dev/null'
OKWS_SET_VERSION
AC_SUBST(LIBPUB)
AC_SUBST(LIBAHTTP)
AC_SUBST(LIBOKXML)
AC_SUBST(LIBAOK)
AC_SUBST(LIBAMT)
AC_SUBST(LIBAMT_PTHREAD)
AC_SUBST(LIBWEB)
AC_SUBST(LIBOKSSL)
AC_SUBST(LIBRFN)
AC_SUBST(LIBEZDB)
AC_SUBST(LIBEZDBSRV)
AC_SUBST(LIBAMYSQL)
AC_SUBST(LIBREDIS)
AC_SUBST(LDADD_PUB)
AC_SUBST(LDEPS_PUB)
AC_SUBST(LDADD_RFN)
AC_SUBST(LDEPS_RFN)
AC_SUBST(LDADD_AMT)
AC_SUBST(LDADD_REDIS)
AC_SUBST(LDADD_AMYSQL)
AC_SUBST(LDEPS_AMT)
AC_SUBST(LDEPS_AMYSQL)
AC_SUBST(ETAGS_ARGS)
PUB_PDEBUG
PUBFLAGS='-rF'
AC_SUBST(PUBFLAGS)
AC_CONFIG_COMMANDS([mkdir], [$MKDIR_P py/okws])
AC_CONFIG_FILES(test/pub/test_runner, [chmod +x test/pub/test_runner])
AC_OUTPUT(libpub/Makefile pub/Makefile
okd/Makefile libahttp/Makefile libaok/Makefile
libokxml/Makefile client/Makefile libamt/Makefile libamysql/Makefile
libweb/Makefile libredis/Makefile logd/Makefile Makefile
conf/Makefile conf/freebsd/Makefile test/Makefile test/unit/Makefile
test/system/Makefile test/pub/Makefile htdocs/Makefile contrib/Makefile
xmlrpcc/Makefile test/system/xmlxlate/Makefile
test/system/3tier/Makefile libokssl/Makefile ssld/Makefile
librfn/Makefile test/regtest/Makefile test/regtest/cases/Makefile
libamt_pthread/Makefile ezdb/Makefile ezdb/libezdb/Makefile
ezdb/server/Makefile py/Makefile py/gen_okws_config.sh libpub/okws_sfs.h)