-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.in
491 lines (413 loc) · 19.1 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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# Copyright (c) 2005-2007 Andre Merzky ([email protected])
# Copyright (c) 2008 Ole Weidner ([email protected])
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying Afile LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
m4_include([config/saga.m4])
m4_include([config/saga_base.m4])
m4_include([config/saga_openssl.m4])
m4_include([config/saga_postgresql.m4])
m4_include([config/saga_soci.m4])
m4_include([config/saga_sqlite3.m4])
m4_include([config/saga_xmlrpc.m4])
###########################################################
#
# init configure
#
AC_INIT([saga])
AC_CONFIG_AUX_DIR([config])
#
###########################################################
######################################################################
#
# empty lines as help output separators
#
AC_ARG_ENABLE([1],[ ])
AC_ARG_WITH([2],[ ])
#
###########################################################
###########################################################
#
# saga configuration
#
if test "$prefix" = "NONE"; then
prefix=$ac_default_prefix
fi
# flag is evaluated by AX_SAGA_CHECK_BASE
export SAGA_CORE_CONFIGURE=yes
# basic compiler settings
AX_SAGA_CHECK_BASE()
AX_SAGA_CHECK_PACKAGES()
# we need boost for some type checks in SAGA_CHECK_TYPES
AX_SAGA_CHECK_BOOST(1.33)
AX_SAGA_CHECK_TYPES()
AC_CONFIG_FILES([config/saga.config.boost.c.mk],
[cp config/saga.config.boost.c.mk ./make/])
if test "x$HAVE_BOOST" != "xyes"; then
AC_MSG_ERROR([Cannot build SAGA without boost - abort])
fi
SAGA_DEP_FILES="$SAGA_DEP_FILES $SAGA_BOOST_DEP_FILES"
SAGA_LOCATION=$prefix
AC_SUBST([SAGA_LOCATION])
AC_DEFINE_UNQUOTED([SAGA_LOCATION], ["$SAGA_LOCATION"])
export SAGA_LOCATION
if test "$libdir" = '${exec_prefix}/lib'; then
SAGA_LIB_ROOT=$SAGA_LOCATION/lib
else
SAGA_LIB_ROOT=$libdir
fi
if test "$bindir" = '${exec_prefix}/bin'; then
SAGA_BIN_ROOT="$SAGA_LOCATION/bin"
else
SAGA_BIN_ROOT="$bindir"
fi
if test "$includedir" = '${prefix}/include'; then
SAGA_INC_ROOT="$SAGA_LOCATION/include"
else
SAGA_INC_ROOT="$includedir"
fi
if test "$mandir" = '${datarootdir}/man'; then
SAGA_MAN_ROOT="$SAGA_LOCATION/share/man"
else
SAGA_MAN_ROOT="$mandir"
fi
if test "$datadir" = '${datarootdir}'; then
if test "$datarootdir" = '${prefix}/share'; then
SAGA_DAT_ROOT="$SAGA_LOCATION/share"
else
SAGA_DAT_ROOT="$datarootdir"
fi
else
SAGA_DAT_ROOT="$datadir"
fi
is_saga_dir=`echo $SAGA_DAT_ROOT | sed -e 's/\/$//g' | rev | cut -f 1 | rev`
if ! test "$is_saga_dir" = "saga"; then
SAGA_DAT_ROOT="$SAGA_DAT_ROOT/saga"
fi
AC_SUBST([SAGA_BIN_ROOT])
AC_SUBST([SAGA_LIB_ROOT])
AC_SUBST([SAGA_INC_ROOT])
AC_SUBST([SAGA_MAN_ROOT])
AC_SUBST([SAGA_DAT_ROOT])
SAGA_ARCH=`uname -m`
AC_SUBST([SAGA_ARCH])
#
###########################################################
###########################################################
#
# find external dependencies
#
AX_SAGA_CHECK_LIBDL()
AX_SAGA_CHECK_SQLITE3(3.3)
AC_CONFIG_FILES([config/saga.config.sqlite3.c.mk])
AX_SAGA_CHECK_POSTGRESQL(8.0)
AC_CONFIG_FILES([config/saga.config.postgresql.c.mk])
AC_CONFIG_HEADERS([external/soci/postgresql/postgresql-config.hpp])
AX_SAGA_CHECK_SOCI(2.2)
AC_CONFIG_FILES([config/saga.config.soci.c.mk])
AX_SAGA_CHECK_XMLRPC([0.7.0])
AC_CONFIG_FILES([config/saga.config.xmlrpc.c.mk])
AX_SAGA_CHECK_OPENSSL(0.9.6)
AC_CONFIG_FILES([config/saga.config.openssl.c.mk])
BUILD_ADAPTOR_ADVERT=no
BUILD_ADAPTOR_REPLICA=no
BUILD_ADAPTOR_FILESYSTEM=no
BUILD_ADAPTOR_JOB=no
BUILD_ADAPTOR_RPC=no
BUILD_ADAPTOR_CPR=no
BUILD_ADAPTOR_SD=no
BUILD_ADAPTOR_STREAM=no
BUILD_ADAPTOR_URL=yes
if test "x$SAGA_HAVE_PACKAGE_ADVERT" = "xyes"; then
BUILD_ADAPTOR_ADVERT="yes"
fi
if test "x$SAGA_HAVE_PACKAGE_REPLICA" = "xyes"; then
BUILD_ADAPTOR_REPLICA="yes"
fi
if test "x$SAGA_HAVE_PACKAGE_FILESYSTEM" = "xyes"; then
BUILD_ADAPTOR_FILESYSTEM="yes"
fi
if test "x$SAGA_HAVE_PACKAGE_JOB" = "xyes"; then
BUILD_ADAPTOR_JOB="yes"
fi
if test "x$SAGA_HAVE_PACKAGE_RPC" = "xyes"; then
BUILD_ADAPTOR_RPC="yes"
fi
if test "x$SAGA_HAVE_PACKAGE_CPR" = "xyes"; then
BUILD_ADAPTOR_CPR="yes"
fi
if test "x$SAGA_HAVE_PACKAGE_SD" = "xyes"; then
BUILD_ADAPTOR_SD="yes"
fi
if test "x$SAGA_HAVE_PACKAGE_STREAM" = "xyes"; then
BUILD_ADAPTOR_STREAM="yes"
fi
AC_SUBST([BUILD_ADAPTOR_ADVERT])
AC_SUBST([BUILD_ADAPTOR_REPLICA])
AC_SUBST([BUILD_ADAPTOR_FILESYSTEM])
AC_SUBST([BUILD_ADAPTOR_JOB])
AC_SUBST([BUILD_ADAPTOR_RPC])
AC_SUBST([BUILD_ADAPTOR_CPR])
AC_SUBST([BUILD_ADAPTOR_SD])
AC_SUBST([BUILD_ADAPTOR_URL])
AC_SUBST([BUILD_ADAPTOR_STREAM])
if test "$BUILD_ADAPTOR_ADVERT-$BUILD_ADAPTOR_REPLICA" != "no-no"; then
if test "$HAVE_SQLITE3-$HAVE_POSTGRESQL" = "yes-yes"; then
DB_INFO="(w/ SQLite3 & PostgreSQL)"
SAGA_DBTYPE="postgresql"
SAGA_DEP_FILES="$SAGA_DEP_FILES $SAGA_POSTGRESQL_DEP_FILES"
SAGA_DEP_FILES="$SAGA_DEP_FILES $SAGA_SQLITE3_DEP_FILES"
fi
if test "$HAVE_SQLITE3-$HAVE_POSTGRESQL" = "yes-no"; then
DB_INFO="(w/ SQLite3)"
SAGA_DBTYPE="sqlite3"
SAGA_DEP_FILES="$SAGA_DEP_FILES $SAGA_SQLITE3_DEP_FILES"
fi
if test "$HAVE_SQLITE3-$HAVE_POSTGRESQL" = "no-yes"; then
DB_INFO="(w/ PostgreSQL)"
SAGA_DBTYPE="postgresql"
SAGA_DEP_FILES="$SAGA_DEP_FILES $SAGA_POSTGRESQL_DEP_FILES"
fi
if test "$HAVE_SQLITE3-$HAVE_POSTGRESQL" = "no-no"; then
DB_INFO="(PostgreSQL and/or SQLite3 req'd.)"
SAGA_DBTYPE="none"
BUILD_ADAPTOR_ADVERT=no
BUILD_ADAPTOR_REPLICA=no
fi
fi
AC_SUBST(SAGA_DBTYPE)
if test "x$BUILD_ADAPTOR_ADVERT" = "xyes"; then
DB_INFO_A=$DB_INFO
fi
if test "x$BUILD_ADAPTOR_REPLICA" = "xyes"; then
DB_INFO_R=$DB_INFO
fi
if test "x$BUILD_ADAPTOR_RPC" = "xyes"; then
if test "$HAVE_OPENSSL-$HAVE_XMLRPC" != "yes-yes"; then
RPC_INFO=" (XML RPC and OpenSSL req'd.)"
BUILD_ADAPTOR_RPC="no"
else
SAGA_DEP_FILES="$SAGA_DEP_FILES $SAGA_XMLRPC_DEP_FILES"
SAGA_DEP_FILES="$SAGA_DEP_FILES $SAGA_OPENSSL_DEP_FILES"
fi
fi
if test "x$POSTGRESQL_VERSION" != "x"; then
POSTGRESQL_VERSION_S="($POSTGRESQL_VERSION)"
fi
# create adaptor specific output files
AC_CONFIG_FILES([adaptors/default/advert/default_advert_adaptor.ini])
AC_CONFIG_FILES([adaptors/default/replica/default_replica_adaptor.ini])
#
###########################################################
###########################################################
#
# debian and redhat package support
#
AX_SAGA_CHECK_DEBDEPS([$SAGA_DEP_FILES])
AX_SAGA_CHECK_RPMDEPS([$SAGA_DEP_FILES])
#
###########################################################
###########################################################
#
# create make configs
#
AC_CONFIG_FILES([ config/saga.config.c.mk],
[cp config/saga.config.c.mk ./make/])
AC_CONFIG_FILES([ config/saga.config.check.c.mk],
[cp config/saga.config.check.c.mk ./make/])
# core make configs
AC_CONFIG_FILES([ saga/impl/engine/saga.core.mk],
[cp saga/impl/engine/saga.core.mk ./make/])
AC_CONFIG_FILES([ saga/impl/engine/saga.core.i.mk],
[cp saga/impl/engine/saga.core.i.mk ./make/])
# package make configs
AC_CONFIG_FILES([ saga/impl/packages/advert/saga.package.advert.mk],
[cp saga/impl/packages/advert/saga.package.advert.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/advert/saga.package.advert.i.mk],
[cp saga/impl/packages/advert/saga.package.advert.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/cpr/saga.package.cpr.mk],
[cp saga/impl/packages/cpr/saga.package.cpr.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/cpr/saga.package.cpr.i.mk],
[cp saga/impl/packages/cpr/saga.package.cpr.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/isn/saga.package.isn.mk],
[cp saga/impl/packages/isn/saga.package.isn.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/isn/saga.package.isn.i.mk],
[cp saga/impl/packages/isn/saga.package.isn.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/filesystem/saga.package.filesystem.mk],
[cp saga/impl/packages/filesystem/saga.package.filesystem.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/filesystem/saga.package.filesystem.i.mk],
[cp saga/impl/packages/filesystem/saga.package.filesystem.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/job/saga.package.job.mk],
[cp saga/impl/packages/job/saga.package.job.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/job/saga.package.job.i.mk],
[cp saga/impl/packages/job/saga.package.job.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/namespace/saga.package.namespace.mk],
[cp saga/impl/packages/namespace/saga.package.namespace.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/namespace/saga.package.namespace.i.mk],
[cp saga/impl/packages/namespace/saga.package.namespace.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/replica/saga.package.replica.mk],
[cp saga/impl/packages/replica/saga.package.replica.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/replica/saga.package.replica.i.mk],
[cp saga/impl/packages/replica/saga.package.replica.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/rpc/saga.package.rpc.mk],
[cp saga/impl/packages/rpc/saga.package.rpc.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/rpc/saga.package.rpc.i.mk],
[cp saga/impl/packages/rpc/saga.package.rpc.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/sd/saga.package.sd.mk],
[cp saga/impl/packages/sd/saga.package.sd.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/sd/saga.package.sd.i.mk],
[cp saga/impl/packages/sd/saga.package.sd.i.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/stream/saga.package.stream.mk],
[cp saga/impl/packages/stream/saga.package.stream.mk ./make/])
AC_CONFIG_FILES([ saga/impl/packages/stream/saga.package.stream.i.mk],
[cp saga/impl/packages/stream/saga.package.stream.i.mk ./make/])
#
###########################################################
###########################################################
#
# make helper and scripts
#
AC_CONFIG_FILES([ tools/scripts/saga-config],
[chmod 0755 tools/scripts/saga-config])
AC_CONFIG_FILES([ tools/scripts/saga-run.sh],
[chmod 0755 tools/scripts/saga-run.sh])
AC_CONFIG_FILES([ tools/scripts/saga-install.pl],
[chmod 0755 tools/scripts/saga-install.pl])
AC_CONFIG_FILES([ tools/scripts/saga-install.sh],
[chmod 0755 tools/scripts/saga-install.sh])
AC_CONFIG_FILES([ tools/scripts/saga-profile.sh],
[chmod 0755 tools/scripts/saga-profile.sh])
AC_CONFIG_FILES([ tools/scripts/saga-run-test.sh],
[chmod 0755 tools/scripts/saga-run-test.sh])
#
###########################################################
###########################################################
#
# global config files
#
AC_CONFIG_HEADERS([saga/saga-config.hpp])
AC_CONFIG_FILES([config/saga.ini])
AC_CONFIG_FILES([config/saga.pc])
AC_CONFIG_FILES([config/saga_boost.pc])
AC_CONFIG_FILES([config/saga.config.sh])
#
###########################################################
###########################################################
#
# recursive configure (not used at the moment)
#
SAGA_RECURSIVE_CONFIG=yes
export SAGA_RECURSIVE_CONFIG
#
###########################################################
###########################################################
#
# flag configure success
#
SAGA_CONFIGURE_OK=yes
if test "$HAVE_BOOST" = "no"; then SAGA_CONFIGURE_OK=no; fi
AC_SUBST([SAGA_CONFIGURE_OK])
#
###########################################################
###########################################################
#
# trigger config file write
#
AC_OUTPUT()
#
###########################################################
###########################################################
#
# print configure summary
#
OUT=config.summary
rm -rf $OUT
touch $OUT
echo " " >> $OUT
echo " " >> $OUT
echo " ######################################################## " >> $OUT
echo " " >> $OUT
echo " SAGA CORE " >> $OUT
echo " " >> $OUT
echo " ######################################################## " >> $OUT
echo " " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " Configuration Summary " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " " >> $OUT
echo " SAGA Version : $SAGA_VERSION " >> $OUT
echo " SAGA SVN Revision : $SAGA_REVISION " >> $OUT
echo " SAGA Version Date : $SAGA_VERSION_DATE " >> $OUT
echo " Install Prefix : $SAGA_LOCATION " >> $OUT
echo " SAGA DEBUG : $SAGA_HAVE_DEBUG $SAGA_CXXFLAGS_DEBUG " >> $OUT
echo " " >> $OUT
echo " Architecture : $SAGA_ARCH ($SAGA_DEB_ARCH) " >> $OUT
echo " PreCompiler : $SAGA_CPP ($CPP_VERSION) " >> $OUT
echo " C Compiler : $SAGA_CC ($CC_VERSION) " >> $OUT
echo " C++ Compiler : $SAGA_CXX ($CXX_VERSION) " >> $OUT
echo " Linker (C++) : $SAGA_LD ($LD_VERSION) " >> $OUT
echo " " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " External Libraries " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " " >> $OUT
echo " Boost Found : $HAVE_BOOST " >> $OUT
echo " Boost Version : $BOOST_VERSION " >> $OUT
echo " Boost Location : $BOOST_LOCATION " >> $OUT
echo " " >> $OUT
echo " PostgreSQL Found : $HAVE_POSTGRESQL $POSTGRESQL_VERSION_S" >> $OUT
echo " Version : $POSTGRESQL_VERSION " >> $OUT
echo " Location : $POSTGRESQL_LOCATION " >> $OUT
echo " " >> $OUT
echo " SQLite3 Found : $HAVE_SQLITE3 " >> $OUT
echo " Version : $SQLITE3_VERSION " >> $OUT
echo " Location : $SQLITE3_LOCATION " >> $OUT
echo " " >> $OUT
echo " OpenSSL Found : $HAVE_OPENSSL " >> $OUT
echo " Version : $OPENSSL_VERSION " >> $OUT
echo " Location : $OPENSSL_LOCATION " >> $OUT
echo " " >> $OUT
echo " XML RPC Found : $HAVE_XMLRPC " >> $OUT
echo " Version : $XMLRPC_VERSION " >> $OUT
echo " Location : $XMLRPC_LOCATION " >> $OUT
echo " " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " API Packages " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " " >> $OUT
echo " SAGA PACKAGE JOB : $SAGA_HAVE_PACKAGE_JOB " >> $OUT
echo " SAGA PACKAGE NAMESPACE : $SAGA_HAVE_PACKAGE_NAMESPACE " >> $OUT
echo " SAGA PACKAGE FILESYSTEM : $SAGA_HAVE_PACKAGE_FILESYSTEM " >> $OUT
echo " SAGA PACKAGE REPLICA : $SAGA_HAVE_PACKAGE_REPLICA " >> $OUT
#echo " SAGA PACKAGE STREAM : $SAGA_HAVE_PACKAGE_STREAM " >> $OUT
#echo " SAGA PACKAGE RPC : $SAGA_HAVE_PACKAGE_RPC " >> $OUT
echo " SAGA PACKAGE ADVERT : $SAGA_HAVE_PACKAGE_ADVERT " >> $OUT
echo " SAGA PACKAGE SD : $SAGA_HAVE_PACKAGE_SD " >> $OUT
#echo " SAGA PACKAGE CPR : $SAGA_HAVE_PACKAGE_CPR " >> $OUT
#echo " SAGA PACKAGE MESSAGES : $SAGA_HAVE_PACKAGE_MESSAGES " >> $OUT
echo " SAGA PACKAGE ISN : $SAGA_HAVE_PACKAGE_ISN " >> $OUT
echo " " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " Default Adaptors " >> $OUT
echo " -------------------------------------------------------- " >> $OUT
echo " " >> $OUT
echo " Advert Adaptor : $BUILD_ADAPTOR_ADVERT $DB_INFO_A " >> $OUT
echo " Job Adaptor : $BUILD_ADAPTOR_JOB " >> $OUT
echo " File Adaptor : $BUILD_ADAPTOR_FILESYSTEM " >> $OUT
echo " Replica Adaptor : $BUILD_ADAPTOR_REPLICA $DB_INFO_R " >> $OUT
#echo " Stream Adaptor : $BUILD_ADAPTOR_STREAM " >> $OUT
#echo " RPC Adaptor : $BUILD_ADAPTOR_RPC $RPC_INFO " >> $OUT
#echo " CPR Adaptor : $BUILD_ADAPTOR_CPR " >> $OUT
echo " SD Adaptor : $BUILD_ADAPTOR_SD " >> $OUT
echo " URL Adaptor : $BUILD_ADAPTOR_URL " >> $OUT
echo " " >> $OUT
echo " ######################################################## " >> $OUT
echo " Now type "make" to build SAGA. Have fun! " >> $OUT
echo " Be sure to check out the README file. " >> $OUT
echo " ######################################################## " >> $OUT
echo " " >> $OUT
AC_CONFIG_COMMANDS_POST([touch Makefile.ok])
cat $OUT
#
###########################################################