-
Notifications
You must be signed in to change notification settings - Fork 25
/
configure.ac
346 lines (321 loc) · 11.1 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
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
# configure.in for the exonerate package
#
# Guy St.C. Slater. 16:11:2000
#
# ( Borrowed some config tricks from gtk+, gnet, xscreensaver, mutt )
AC_INIT([exonerate], [2.4.0])
AC_CONFIG_SRCDIR([src/sequence/sequence.c])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# AM_PROG_LIBTOOL
# OTHER STUFF
AC_DEFINE([_XOPEN_SOURCE],[600])
# Linux lacks _XOPEN_PATH_MAX in limits.h...
AC_CHECK_DECLS([_XOPEN_PATH_MAX],[],[AC_DEFINE([_XOPEN_PATH_MAX],[1024])],\
[[#include <limits.h>]])
AC_C_CONST
AC_C_INLINE
AC_HEADER_STDC # CHECKS FOR stdlib.h stdarg.h string.h and float.h
AC_CHECK_HEADERS(limits.h errno.h math.h strings.h ctype.h \
sys/stat.h sys/types.h time.h unistd.h)
# SET host (REQUIRES config.guess AND config.sub)
AC_CANONICAL_HOST
AC_SUBST(host)
echo "Set host to $host"
# AVOID autoconf WARNINGS ABOUT --datarootdir
AC_SUBST(datarootdir)
custom_guint64_format="llu"
# TRY TO GET TO BUILD ON ALL PLATFORMS BY DEFAULT
echo ""$host
case $host in
*-apple-darwin*)
echo "Customising build for OSX"
C4_AR_INIT="csq"
C4_AR_APPEND="sq"
;;
*-dec-osf*)
echo "Customising build for OSF"
C4_AR="/bin/ar"
C4_AR_INIT="czr"
C4_AR_APPEND="zr"
# use the TRU64 C compiler
CC="cc"
GCC= # No longer true (prevents GCC specific CFLAGS being set)
CFLAGS="-O3 -arch ev6 -fast"
;;
*-irix*)
echo "Customising build for IRIX"
C4_AR_INIT="cq"
C4_AR_APPEND="q"
;;
*-solaris*)
echo "Customising build for Solaris"
C4_AR_INIT="cq"
C4_AR_APPEND="q"
;;
x86_64-*)
echo "Customising build for X86_64"
custom_guint64_format="lu"
;;
*)
echo "*** Unknown build platform: $host ***"
;;
esac
AC_SUBST(custom_guint64_format)
# SET SOURCE_ROOT_DIR (REQUIRED FOR viterbi.h)
source_root_dir=`pwd`
AC_SUBST(source_root_dir)
echo "Set source_root_dir to $source_root_dir"
echo "----------------------------------------------------------------"
# CHECK FOR socklen_t
# THIS IS TO FIX PROBLEMS WHERE socklen_t ISN'T DEFINED (eg. ON OSF)
#
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
socklen_t x;], [], [AC_MSG_RESULT(yes)],
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
int accept(int, struct sockaddr *, size_t *);],
[], [AC_MSG_RESULT(size_t)
AC_DEFINE(socklen_t, size_t)], [
AC_MSG_RESULT(int)
AC_DEFINE(socklen_t, int)])])
# ALLOW EITHER GLIB-1 OR GLIB-2 TO BE USED
#
# IT SEEMS TRICKY TO ALLOW COMPILATION AGAINST BOTH GLIB-1 AND GLIB-2
# THAT WILL WORK FOR ONE LIBRARY WHEN THE OTHER IS ABSENT ...
#
# ... WHAT FOLLOWS IS FAR FROM IDEAL, BUT SEEMS TO WORK.
# ANY SUGGESTIONS FOR A BETTER WAY OF DOING THIS WILL BE WELCOME.
#
AC_ARG_ENABLE(glib2,
[
--enable-glib2 Use glib2 library
--disable-glib2 Do not glib2 (use glib1 instead)],
[enable_glib2="$enableval"],[enable_glib2=yes])
if test "$enable_glib2" = yes; then
# AM_PATH_GLIB_2_0(2.0.0,
# [LIBS="$LIBS $GLIB_LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS"],
# AC_MSG_ERROR(Cannot find GLIB2: Is pkg-config in path?))
# PKG_CHECK_MODULES(GLIB, [glib-2.0], [:], [:])
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "$PKG_CONFIG" = no; then
echo "ERROR: Could not find pkg-config ... is glib-2 installed ???"
exit 1
fi
echo "Using GLIB-2"
glib_cflags=`pkg-config --cflags glib-2.0`
glib_libs=`pkg-config --libs glib-2.0`
CFLAGS="$CFLAGS $glib_cflags"
LIBS="$LIBS $glib_libs"
elif test "$enable_glib2" = no; then
echo "Using GLIB-1"
# AM_PATH_GLIB([1.2.0],
# [LIBS="$LIBS $GLIB_LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS"],
# AC_MSG_ERROR(Cannot find GLIB1: Is glib-config in path?))
AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
if test "$GLIB_CONFIG" = no; then
echo "ERROR: Could not find glib-config ... is glib-1 installed ???"
exit 1
fi
glib_cflags=`glib-config --cflags glib`
glib_libs=`glib-config --libs glib`
CFLAGS="$CFLAGS $glib_cflags"
LIBS="$LIBS $glib_libs"
else
echo "error: must be yes or no: --enable-glib2:[$enable_glib2]"
exit 1
fi
AC_SUBST(glib_libs)
AC_SUBST(glib_cflags)
# ALLOW ASSERTIONS TO BE TURNED ON OR OFF
# THIS ALSO ACTIVATES DEBUGGING OR OPTIMISATION COMPILE OPTIONS
AC_ARG_ENABLE(assert,
[
--enable-assert Use code for assertion tests
--disable-assert Do not use assertion code],
[enable_assert="$enableval"],[enable_assert=no])
if test "$enable_assert" = yes; then
echo "Turning ASSERTIONS on"
CFLAGS="$CFLAGS -g"
elif test "$enable_assert" = no; then
CFLAGS="$CFLAGS -DG_DISABLE_ASSERT"
echo "Turning assertions off"
if test "$GCC" = "yes"; then
# Not currently using -fomit-frame-pointer as clashes with -pg
# CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -finline-functions"
CFLAGS="$CFLAGS -O3 -finline-functions"
fi
else
echo "error: must be yes or no: --enable-assert:[$enable_assert]"
exit 1
fi
# ALLOW PARANOID CODE CHECKING TO BE TURNED ON OR OFF
AC_ARG_ENABLE(paranoia,
[
--enable-paranoia Use paranoid compilation options
--disable-paranoia Do not use paranoid compilation options],
[enable_paranoia="$enableval"],[enable_paranoia=no])
if test "$enable_paranoia" = yes; then
echo "Turning PARANOID options on"
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -Wall -Werror \
-Wstrict-prototypes -Wmissing-prototypes\
-Wmissing-declarations"
fi
elif test "$enable_paranoia" = no; then
echo "Turning paranoid options off"
else
echo "error: must be yes or no: --enable-paranoia:[$enable_paranoia]"
exit 1
fi
# ALLOW PROFILING WITH GPROF
AC_ARG_ENABLE(gprof,
[
--enable-gprof Generate executables suitable for gprof profiling
--disable-gprof Do not create executables for gprof profiling],
[enable_gprof="$enableval"],[enable_gprof=no])
if test "$enable_gprof" = yes; then
echo "Building executables for profiling with GPROF"
echo "Statically linking for gprof"
echo " Run: <program> then run: gprof <program> gmon.out"
CFLAGS="$CFLAGS -O0 -static -pg"
LDFLAGS="$LDFLAGS -g -pg -nodefaultlibs"
LIBS="$LIBS -lc_p -lgcc -lm"
elif test "$enable_gprof" = no; then
echo "Not using options for profiling with gprof"
else
echo "error: must be yes or no: --enable-gprof:[$enable_gprof]"
exit 1
fi
# ALLOW COVERAGE TESTING WITH GCOV
AC_ARG_ENABLE(gcov,
[
--enable-gcov Generate executables suitable for gcov analysis
--disable-gcov Do not create executables for gcov analysis],
[enable_gcof="$enableval"],[enable_gcov=no])
if test "$enable_gcov" = yes; then
echo "Building executables for analysis with GCOV"
echo " Run <program> then run: gcov <source_file>.c"
echo " then view: <source_file>.c.gcov"
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
elif test "$enable_gcov" = no; then
echo "Not using options for analysis with gcov"
else
echo "error: must be yes or no: --enable-gcov:[$enable_gcov]"
exit 1
fi
# FORCE LARGEFILE SUPPORT FOR 32 BIT SYSTEMS
AC_ARG_ENABLE(largefile,
[
--enable-largefile Enable largefile support on 32 bit systems
--disable-largefile Do not enable largefile support on 32 bit systems],
[enable_largefile="$enableval"],[enable_largefile=yes])
if test "$enable_largefile" = yes; then
echo "Adding support for LARGE FILES (>2Gb) for a 32 bit system"
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
elif test "$enable_largefile" = no; then
echo "Not forcing largefile support for 32 bit systems"
else
echo "error: must be yes or no:"
echo " --enable-largefile:[$enable_largefile]"
exit 1
fi
# ALLOW USE OF COMPILED MODELS
AC_ARG_ENABLE(compiledmodels,
[
--enable-compiledmodels Use compiled C4 models
--disable-compiledmodels Do not use compiled C4 models],
[enable_compiledmodels="$enableval"],[enable_compiledmodels=yes])
if test "$enable_compiledmodels" = yes; then
echo "Using COMPILED C4 MODELS"
codegen_extra_ldadd="viterbi.o scheduler.o c4_model_archive.a"
codegen_extra_sources="c4_model_archive.h"
elif test "$enable_compiledmodels" = no; then
echo "Not using compiled C4 models"
# model_extra_programs="bootstrapper"
codegen_extra_sources=""
codegen_extra_ldadd="`pwd`/src/c4/viterbi.o \
`pwd`/src/sdp/scheduler.o"
else
echo "error: must be yes or no:"
echo " --enable-compiledmodels:[$enable_compiledmodels]"
exit 1
fi
# AC_SUBST(model_extra_programs)
AC_SUBST(codegen_extra_sources)
AC_SUBST(codegen_extra_ldadd)
# ALLOW INSTALLATION OF UTILITIES
AC_ARG_ENABLE(utilities,
[
--enable-utilities Install all utilities
--disable-utilities Do not install utilities],
[enable_utilities="$enableval"],[enable_utilities=yes])
if test "$enable_utilities" = yes; then
echo "Installing UTILITIES"
installed_util_list=" \
fastaclean fastaclip fastachecksum fastacomposition \
fastadiff fastaexplode fastafetch fastahardmask \
fastaindex fastalength fastanrdb fastaoverlap \
fastareformat fastaremove fastarevcomp fastasoftmask \
fastasort fastasplit fastasubseq fastatranslate \
fastavalidcds fasta2esd fastaannotatecdna esd2esi"
elif test "$enable_utilities" = no; then
echo "Not installing utilities"
installed_util_list=""
else
echo "error: must be yes or no:"
echo " --enable-utilities:[$enable_utilities]"
exit 1
fi
AC_SUBST(installed_util_list)
# 2012-01-20 (nathanweeks): Disable pthreads code due to reliability issues &
# limited utility.
## ALLOW DISABLING OF PTHREADS
#AC_ARG_ENABLE(pthreads,
#[
# --enable-pthreads Use pthreads for exonerate-server
# --disable-pthreads Do not use pthreads for exonerate-server],
#[enable_pthreads="$enableval"],[enable_pthreads=yes])
#if test "$enable_pthreads" = yes; then
# echo "Using PTHREADS"
# CFLAGS="$CFLAGS -DUSE_PTHREADS"
# # for g_thread_init()
# g_thread_init_ldflags=`pkg-config --libs gthread-2.0`
# LDFLAGS="$LDFLAGS $g_thread_init_ldflags -lpthread"
#elif test "$enable_pthreads" = no; then
# echo "Not using pthreads"
#else
# echo "error: must be yes or no:"
# echo " --enable-pthreads:[$enable_pthreads]"
# exit 1
#fi
#AC_SUBST(use_pthreads)
echo "----------------------------------------------------------------"
AC_OUTPUT(Makefile \
doc/Makefile \
doc/man/Makefile \
doc/man/man1/Makefile \
src/Makefile \
src/general/Makefile \
src/sequence/Makefile \
src/database/Makefile \
src/struct/Makefile \
src/comparison/Makefile \
src/c4/Makefile \
src/bsdp/Makefile \
src/sdp/Makefile \
src/hub/Makefile \
src/model/Makefile \
src/program/Makefile \
src/util/Makefile \
test/Makefile \
test/util/Makefile \
test/ipcress/Makefile \
test/exonerate/Makefile \
test/data/Makefile \
test/data/cdna/Makefile \
test/data/protein/Makefile )