1#                                               -*- Autoconf -*-
2# Configure template for the EMBOSS package.
3# Process this file with autoconf to produce a configure script.
4
5AC_PREREQ([2.64])
6AC_INIT([EMBOSS],
7[6.6.0],
8[emboss-bug@emboss.open-bio.org],
9[EMBOSS],
10[http://emboss.open-bio.org/])
11AC_REVISION([$Revision: 1.162 $])
12AC_CONFIG_SRCDIR([ajax/acd/ajacd.c])
13AC_CONFIG_HEADERS([ajax/core/config.h])
14AC_CONFIG_MACRO_DIR([m4])
15
16# Make sure CFLAGS is defined to stop AC_PROG_CC adding -g.
17CFLAGS="${CFLAGS} "
18
19# Checks for programs.
20AC_PROG_AWK
21AC_PROG_CC([icc gcc cc])
22AC_PROG_CXX([icpc g++])
23AC_PROG_CPP
24AC_PROG_INSTALL
25AC_PROG_LN_S
26AC_PROG_MAKE_SET
27AC_PROG_MKDIR_P
28
29AM_INIT_AUTOMAKE
30
31# Use libtool to make a shared library.
32LT_INIT
33
34
35
36
37# Check if 64 bit pointer support is required on 32 bit machines
38# Disabled by default
39
40AC_ARG_ENABLE([64],
41[AS_HELP_STRING([--enable-64], [64 bit pointers on 32 bit machines])])
42
43AS_IF([test "x${enable_64}" = "xyes"],
44[
45  AC_MSG_CHECKING([for 64bit compilation support])
46
47  AS_CASE([${host_os}],
48  [aix*],
49  [
50    CPPFLAGS="-DAJ_AIX64 ${CPPFLAGS}"
51    AS_CASE([${CC}],
52    [gcc],
53    [],
54    [
55      AS_VAR_APPEND([CC], [" -q64"])
56    ])
57    NM="nm -B -X 64"
58    AR="ar -X 64"
59  ],
60  [hpux*],
61  [
62    AS_CASE([${CC}],
63    [gcc],
64    [],
65    [
66      AS_VAR_APPEND([CC], [" +DD64"])
67    ])
68    AC_DEFINE([HPUX64PTRS], [1], [Set to 1 if HPUX 64bit ptrs on 32 bit m/c])
69  ])
70  AC_MSG_RESULT([done])
71])
72
73
74
75
76# Compiler optimisations
77# The Solaris 64bit ptr check has to be done here owing to param order
78
79AC_ARG_WITH([optimisation],
80[AS_HELP_STRING([--without-optimisation], [Disable compiler optimisation])])
81
82AS_IF([test "x${with_optimisation}" != "xno"],
83[
84  AS_CASE([${CC}],
85  [gcc],
86  [
87    # Intel MacOSX requires reduced optimisation for PCRE code
88    # other OSs just use -O2
89    AS_CASE([${host_os}],
90    [darwin*],
91    [
92      AS_IF([test "x${host_cpu}" = "xi386"],
93      [AS_VAR_APPEND([CFLAGS], [" -O1"])],
94      [AS_VAR_APPEND([CFLAGS], [" -O2"])])
95    ],
96    [
97      AS_VAR_APPEND([CFLAGS], [" -O2"])
98    ])
99  ],
100  [
101    AS_CASE([${host_os}],
102    [aix*],
103    [
104      AS_VAR_APPEND([CFLAGS], [" -O3 -qstrict -qarch=auto -qtune=auto"])
105    ],
106    [irix*],
107    [
108      LD="/usr/bin/ld -IPA"
109      AS_VAR_APPEND([CFLAGS], [" -O3"])
110    ],
111    [hpux*],
112    [
113      AS_VAR_APPEND([CFLAGS], [" -fast"])
114    ],
115    [osf*],
116    [
117      AS_VAR_APPEND([CFLAGS], [" -fast -U_FASTMATH"])
118    ],
119    [solaris*],
120    [
121      AS_VAR_APPEND([CFLAGS], [" -O"])
122      # test for 64 bit ptr here (see Solaris 64bit above)
123      AS_IF([test "x${enable_64}" = "xyes"],
124      [AS_VAR_APPEND([CFLAGS], [" -xtarget=ultra -xarch=v9"])])
125    ],
126    [linux*],
127    [
128      # Default optimisation for non-gcc compilers under Linux
129      AS_VAR_APPEND([CFLAGS], [" -O2"])
130    ],
131    [freebsd*],
132    [
133      AS_VAR_APPEND([CFLAGS], [" -O2"])
134    ])
135  ])
136])
137
138
139
140
141# Compiler warning settings: --enable-warnings, defines WARN_CFLAGS
142
143AC_ARG_ENABLE([warnings],
144[AS_HELP_STRING([--enable-warnings], [compiler warnings])])
145
146AS_IF([test "x${enable_warnings}" = "xyes"],
147[
148  AS_CASE([${CC}],
149  [gcc],
150  [
151    # -Wall priovides:
152    #    -Waddress
153    #    -Warray-bounds (only with -O2)
154    #    -Wc++0x-compat
155    #    -Wchar-subscripts
156    #    -Wenum-compare (in C/Objc; this is on by default in C++)
157    #    -Wimplicit-int (C and Objective-C only)
158    #    -Wimplicit-function-declaration (C and Objective-C only)
159    #    -Wcomment
160    #    -Wformat
161    #    -Wmain (only for C/ObjC and unless -ffreestanding)
162    #    -Wmissing-braces
163    #    -Wnonnull
164    #    -Wparentheses
165    #    -Wpointer-sign
166    #    -Wreorder
167    #    -Wreturn-type
168    #    -Wsequence-point
169    #    -Wsign-compare (only in C++)
170    #    -Wstrict-aliasing
171    #    -Wstrict-overflow=1
172    #    -Wswitch
173    #    -Wtrigraphs
174    #    -Wuninitialized
175    #    -Wunknown-pragmas
176    #    -Wunused-function
177    #    -Wunused-label
178    #    -Wunused-value
179    #    -Wunused-variable
180    #    -Wvolatile-register-var
181
182    AS_VAR_SET([WARN_CFLAGS], ["-Wall -fno-strict-aliasing"])
183  ])
184])
185
186AC_SUBST([WARN_CFLAGS])
187
188
189
190
191# Compiler developer warning settings: --enable-devwarnings,
192# sets DEVWARN_CFLAGS
193
194AC_ARG_ENABLE([devwarnings],
195[AS_HELP_STRING([--enable-devwarnings],
196[strict compiler warnings for developers])])
197
198AS_IF([test "x${enable_devwarnings}" = "xyes"],
199[
200  AS_CASE([${CC}],
201  [gcc],
202  [
203    # Diagnostic options for the GNU GCC compiler version 4.6.1.
204    # http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/Warning-Options.html
205    #
206    # -Wextra: more warnings beyond what -Wall provides
207    #    -Wclobbered
208    #    -Wempty-body
209    #    -Wignored-qualifiers
210    #    -Wmissing-field-initializers
211    #    -Wmissing-parameter-type (C only)
212    #    -Wold-style-declaration (C only)
213    #    -Woverride-init
214    #    -Wsign-compare
215    #    -Wtype-limits
216    #    -Wuninitialized
217    #    -Wunused-parameter (only with -Wunused or -Wall)
218    #    -Wunused-but-set-parameter (only with -Wunused or -Wall)
219
220    AS_VAR_SET([DEVWARN_CFLAGS], ["-Wextra"])
221
222    # Warn if a function is declared or defined without specifying the
223    # argument types.
224
225    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wstrict-prototypes"])
226
227    # Warn if a global function is defined without a previous prototype
228    # declaration.
229
230    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-prototypes"])
231
232    # Warn for obsolescent usages, according to the C Standard,
233    # in a declaration.
234
235    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wold-style-definition"])
236
237    # Warn if a global function is defined without a previous declaration.
238
239    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-declarations"])
240
241    # When compiling C, give string constants the type const char[length]
242    # so that copying the address of one into a non-const char * pointer
243    # will get a warning.
244
245    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wwrite-strings"])
246
247    # Warn whenever a local variable or type declaration shadows another
248    # variable, parameter, type, or class member (in C++), or whenever a
249    # built-in function is shadowed.
250
251    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wshadow"])
252
253    # Warn when a declaration is found after a statement in a block.
254
255    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wdeclaration-after-statement"])
256
257    # Warn if an undefined identifier is evaluated in an `#if' directive.
258
259    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wundef"])
260
261    # Warn about anything that depends on the "size of" a function type
262    # or of void.
263
264    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpointer-arith"])
265
266    # Warn whenever a pointer is cast so as to remove a type qualifier
267    # from the target type.
268
269    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcast-qual"])
270
271    # Warn whenever a pointer is cast such that the required alignment
272    # of the target is increased.
273
274    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcast-align"])
275
276    # Warn whenever a function call is cast to a non-matching type.
277
278    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wbad-function-cast"])
279
280    # Warn when a comparison between signed and unsigned values could
281    # produce an incorrect result when the signed value is converted to
282    # unsigned.
283
284    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wsign-compare"])
285
286    # Warn if a structure's initializer has some fields missing.
287
288    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-field-initializers"])
289
290    # An alias of the new option -Wsuggest-attribute=noreturn
291    # Warn for cases where adding an attribute may be beneficial.
292
293    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-noreturn"])
294
295    # Warn if an extern declaration is encountered within a function.
296
297    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wnested-externs"])
298
299    # Warn if anything is declared more than once in the same scope,
300    # even in cases where multiple declaration is valid and changes
301    # nothing.
302
303    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wredundant-decls"])
304
305    # Warn if the loop cannot be optimized because the compiler could not
306    # assume anything on the bounds of the loop indices.
307    # -Wunsafe-loop-optimizations objects to loops with increments more
308    # than 1 because if the end is at INT_MAX it could run forever ...
309    # rarely
310
311    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunsafe-loop-optimizations"])
312
313    # Warn for implicit conversions that may alter a value.
314    # -Wconversion is brain-damaged - complains about char arguments
315    # every time
316
317    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wconversion"])
318
319    # Warn about certain constructs that behave differently in traditional
320    # and ISO C.
321    # -Wtraditional gives #elif and #error msgs
322
323    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wtraditional"])
324
325    # Warn if floating point values are used in equality comparisons.
326    # -Wfloat-equal will not allow tests for values still 0.0
327
328    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wfloat-equal"])
329
330    # This option is only active when -ftree-vrp is active
331    # (default for -O2 and above). It warns about subscripts to arrays
332    # that are always out of bounds.
333    # -Warray-bounds gives false positives in gcc 4.6.0
334    # Disable rather than use a non-portable pragma
335
336    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wno-array-bounds"])
337  ],
338  [icc],
339  [
340    # Diagnostic options for the Intel(R) C++ compiler version 11.1.
341    # http://software.intel.com/en-us/articles/intel-c-compiler-professional-edition-for-linux-documentation/
342
343    # This option specifies the level of diagnostic messages to be
344    # generated by the compiler.
345
346    AS_VAR_SET([DEVWARN_CFLAGS], ["-w2"])
347
348    # This option determines whether a warning is issued if generated
349    # code is not C++ ABI compliant.
350
351    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wabi"])
352
353    # This option tells the compiler to display errors, warnings, and
354    # remarks.
355
356    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wall"])
357
358    # This option tells the compiler to display a shorter form of
359    # diagnostic output.
360
361    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wbrief"])
362
363    # This option warns if cast is used to override pointer type
364    # qualifier
365
366    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcast-qual"])
367
368    # This option tells the compiler to perform compile-time code
369    # checking for certain code.
370
371    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcheck"])
372
373    # This option determines whether a warning is issued when /*
374    # appears in the middle of a /* */ comment.
375
376    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcomment"])
377
378    # Set maximum number of template instantiation contexts shown in
379    # diagnostic.
380
381    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcontext-limit=n"])
382
383    # This option enables warnings for implicit conversions that may
384    # alter a value.
385
386    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wconversion"])
387
388    # This option determines whether warnings are issued for deprecated
389    # features.
390
391    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wdeprecated"])
392
393    # This option enables warnings based on certain C++ programming
394    # guidelines.
395
396    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Weffc++"])
397
398    # This option changes all warnings to errors.
399    # Alternate: -diag-error warn
400
401    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Werror"])
402
403    # This option changes all warnings and remarks to errors.
404    # Alternate: -diag-error warn, remark
405
406    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Werror-all"])
407
408    # This option determines whether warnings are issued about extra
409    # tokens at the end of preprocessor directives.
410
411    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wextra-tokens"])
412
413    # This option determines whether argument checking is enabled for
414    # calls to printf, scanf, and so forth.
415
416    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wformat"])
417
418    # This option determines whether the compiler issues a warning when
419    # the use of format functions may cause security problems.
420
421    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wformat-security"])
422
423    # This option enables diagnostics about what is inlined and what is
424    # not inlined.
425
426    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Winline"])
427
428    # This option determines whether a warning is issued if the return
429    # type of main is not expected.
430
431    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmain"])
432
433    # This option determines whether warnings are issued for global
434    # functions and variables without prior declaration.
435
436    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-declarations"])
437
438    # Determines whether warnings are issued for missing prototypes.
439
440    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-prototypes"])
441
442    # This option enables warnings if a multicharacter constant
443    # ('ABC') is used.
444
445    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmultichar"])
446
447    # Issue a warning when a class appears to be polymorphic,
448    # yet it declares a non-virtual one.
449    # This option is supported in C++ only.
450
451    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wnon-virtual-dtor"])
452
453    # This option warns about operations that could result in
454    # integer overflow.
455
456    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Woverflow"])
457
458    # This option tells the compiler to display diagnostics for 64-bit
459    # porting.
460
461    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wp64"])
462
463    # Determines whether warnings are issued for questionable pointer
464    # arithmetic.
465
466    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpointer-arith"])
467
468    # his option determines whether a warning is issued about the
469    # use of #pragma once.
470
471    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpragma-once"])
472
473    # Issue a warning when the order of member initializers does not
474    # match the order in which they must be executed.
475    # This option is supported with C++ only.
476
477    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wreorder"])
478
479    # This option determines whether warnings are issued when a function
480    # uses the default int return type or when a return statement is
481    # used in a void function.
482
483    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wreturn-type"])
484
485    # This option determines whether a warning is issued when a variable
486    # declaration hides a previous declaration.
487
488    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wshadow"])
489
490    # This option warns for code that might violate the optimizer's
491    # strict aliasing rules. Warnings are issued only when using
492    # -fstrict-aliasing or -ansi-alias.
493
494    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wstrict-aliasing"])
495
496    # This option determines whether warnings are issued for functions
497    # declared or defined without specified argument types.
498
499    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wstrict-prototypes"])
500
501    # This option determines whether warnings are issued if any trigraphs
502    # are encountered that might change the meaning of the program.
503
504    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wtrigraphs"])
505
506    # This option determines whether a warning is issued if a variable
507    # is used before being initialized.
508
509    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wuninitialized"])
510
511    # This option determines whether a warning is issued if an unknown
512    # #pragma directive is used.
513
514    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunknown-pragmas"])
515
516    # This option determines whether a warning is issued if a declared
517    # function is not used.
518
519    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunused-function"])
520
521    # This option determines whether a warning is issued if a local or
522    # non-constant static variable is unused after being declared.
523
524    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunused-variable"])
525
526    # This option issues a diagnostic message if const char* is
527    # converted to (non-const) char *.
528
529    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wwrite-strings"])
530
531    # Disable warning #981 operands are evaluated in unspecified order
532    # http://software.intel.com/en-us/articles/cdiag981/
533
534    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -diag-disable 981"])
535  ])
536])
537
538AC_SUBST([DEVWARN_CFLAGS])
539
540
541
542
543# Compiler extra developer warning settings: --enable-devextrawarnings,
544# appends DEVWARN_CFLAGS
545# Will only have an effect if --enable-devwarnings also given
546
547AC_ARG_ENABLE([devextrawarnings],
548[AS_HELP_STRING([--enable-devextrawarnings],
549[add extra warnings to devwarnings])])
550
551AS_IF([test "x${enable_devwarnings}" = "xyes" &&
552       test "x${enable_devextrawarnings}" = "xyes"],
553[
554  AS_CASE([${CC}],
555  [gcc],
556  [
557    # flags used by Ubuntu 8.10 to check open has 2/3 arguments etc.
558
559    AC_DEFINE([_FORTIFY_SOURCE], [2], [Set to 2 for open args])
560
561    # compiler flags
562
563    CPPFLAGS="-fstack-protector ${CPPFLAGS}"
564
565    # warnings used by Ubuntu 8.10
566    # -Wall already includes:
567    #           -Wformat
568
569    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wformat-security -Wl,-z,relro"])
570
571    # -Wpadded means moving char to end of structs - but also flags
572    #  end of struct so need to add padding at end
573
574    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpadded"])
575  ])
576])
577
578
579
580
581# Compile deprecated functions still used in the book text for 6.2.0
582
583AC_ARG_ENABLE([buildbookdeprecated],
584[AS_HELP_STRING([--enable-buildbookdeprecated],
585[build deprecated functions used in books for 6.2.0])])
586
587# Compile all deprecated functions
588
589AC_ARG_ENABLE([buildalldeprecated],
590[AS_HELP_STRING([--enable-buildalldeprecated],
591[build all deprecated functions])])
592
593AS_IF([test "x${enable_buildbookdeprecated}" = "xyes" ||
594       test "x${enable_buildalldeprecated}" = "xyes"],
595[
596  AC_DEFINE([AJ_COMPILE_DEPRECATED_BOOK], [1],
597  [Define to 1 to compile deprecated functions used in book texts for 6.2.0])
598])
599
600AS_IF([test "x${enable_buildalldeprecated}" = "xyes"],
601[
602  AC_DEFINE([AJ_COMPILE_DEPRECATED], [1],
603  [Define to 1 to compile all deprecated functions])
604])
605
606
607
608
609# Add extensions to Solaris for some reentrant functions
610
611AS_CASE([${host_os}],
612[solaris*],
613[AS_VAR_APPEND([CFLAGS], [" -D__EXTENSIONS__"])])
614
615
616
617
618# Test whether --with-sgiabi given for IRIX (n32m3 n32m4 64m3 64m4)
619
620AS_CASE([${host_os}],
621[irix*],
622[
623  AS_CASE([${CC}],
624  [gcc],
625  [],
626  [cc],
627  [CHECK_SGI])
628])
629
630
631
632
633dnl PCRE library definitions - see the MAJOR and MINOR values
634dnl to see which version's configure.in these lines come from
635
636dnl Provide the current PCRE version information. Do not use numbers
637dnl with leading zeros for the minor version, as they end up in a C
638dnl macro, and may be treated as octal constants. Stick to single
639dnl digits for minor numbers less than 10. There are unlikely to be
640dnl that many releases anyway.
641
642PCRE_MAJOR="7"
643PCRE_MINOR="9"
644PCRE_DATE="11-Apr-2009"
645PCRE_VERSION="${PCRE_MAJOR}.${PCRE_MINOR}"
646
647dnl Default values for miscellaneous macros
648
649POSIX_MALLOC_THRESHOLD="-DPOSIX_MALLOC_THRESHOLD=10"
650
651dnl Provide versioning information for libtool shared libraries that
652dnl are built by default on Unix systems.
653
654PCRE_LIB_VERSION="0:1:0"
655PCRE_POSIXLIB_VERSION="0:0:0"
656
657
658dnl Define where the EMBOSS package is located
659AC_SUBST([AJAX_FIXED_ROOT])
660AJAX_FIXED_ROOT="\\\"`pwd`/emboss\\\""
661AC_SUBST([EMBOSS_TOP])
662EMBOSS_TOP=`pwd`
663AC_SUBST([AJAX_SYSTEM])
664AJAX_SYSTEM="\\\"`uname`\\\""
665
666
667
668
669dnl FIXME: This does no longer seem required with Autoconf 2.67?
670dnl Intel MacOSX 10.6 puts X11 in a non-standard place
671dnl AS_IF([test "x${with_x}" != "xno"],
672dnl [
673dnl   AS_CASE([${host_os}],
674dnl   [darwin*],
675dnl   [
676dnl     OSXX=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
677dnl     AS_IF([test ${OSXX} '>' '10.4'],
678dnl     [AS_VAR_APPEND([CFLAGS], [" -I/usr/X11/include -L/usr/X11/lib"])])
679dnl   ])
680dnl ])
681
682
683
684
685# Checks for header files.
686AC_PATH_XTRA
687AC_HEADER_DIRENT
688AC_HEADER_STDC
689
690AC_CHECK_HEADERS([unistd.h TargetConfig.h])
691
692
693# Checks for typedefs, structures, and compiler characteristics.
694AC_C_BIGENDIAN
695AC_C_CONST
696AC_C_INLINE
697AC_TYPE_PID_T
698AC_TYPE_SIZE_T
699AC_STRUCT_TM
700
701
702# Checks for library functions.
703AC_FUNC_GETPGRP
704AC_FUNC_STRFTIME
705AC_FUNC_FORK
706AC_FUNC_VPRINTF
707
708AC_CHECK_FUNCS([memmove])
709
710AS_IF([test "x${with_x}" != "xno"], [LF_EMBOSS_PATH_XLIB])
711
712
713# Library checks.
714AC_CHECK_LIB([c], [socket], [LIBS="${LIBS}"], [LIBS="${LIBS} -lsocket"])
715AC_CHECK_LIB([m], [main])
716
717
718# GD for FreeBSD requires libiconv
719
720AS_CASE([${host_os}],
721[freebsd*],
722[
723  AS_IF([test "x${with_pngdriver}" != "xno"],
724  [AC_CHECK_LIB([iconv], [main], [LIBS="${LIBS}"], [LIBS="-liconv ${LIBS}"])])
725])
726
727
728
729
730AM_CONDITIONAL([AMPNG], [false])
731AM_CONDITIONAL([AMPDF], [false])
732
733CHECK_GENERAL
734CHECK_IDXDBS
735CHECK_JAVA
736CHECK_HPDF
737CHECK_AXIS2C
738CHECK_PNGDRIVER
739
740AX_LIB_MYSQL
741AX_LIB_POSTGRESQL
742
743
744
745
746dnl "Export" these variables for PCRE
747
748AC_SUBST([HAVE_MEMMOVE])
749AC_SUBST([HAVE_STRERROR])
750AC_SUBST([PCRE_MAJOR])
751AC_SUBST([PCRE_MINOR])
752AC_SUBST([PCRE_DATE])
753AC_SUBST([PCRE_VERSION])
754AC_SUBST([PCRE_LIB_VERSION])
755AC_SUBST([PCRE_POSIXLIB_VERSION])
756AC_SUBST([POSIX_MALLOC_THRESHOLD])
757
758
759
760
761# Enable debugging: --enable-debug, sets CFLAGS
762
763AC_ARG_ENABLE([debug],
764[AS_HELP_STRING([--enable-debug], [debug (-g option on compiler)])])
765
766AS_IF([test "x${enable_debug}" = "xyes"], [AS_VAR_APPEND([CFLAGS], [" -g"])])
767
768
769
770
771# Turn off irritating linker warnings in IRIX
772
773AS_CASE([${host_os}],
774[irix*],
775[
776  CFLAGS="-Wl,-LD_MSG:off=85:off=84:off=16:off=134 ${CFLAGS}"
777])
778
779
780
781
782# Enable the large file interface: --enable-large, appends CPPFLAGS
783
784AC_ARG_ENABLE([large],
785[AS_HELP_STRING([--enable-large],
786[over 2Gb file support @<:@default=yes@:>@])])
787
788AC_MSG_CHECKING([for large file support])
789
790AS_IF([test "x${enable_large}" = "xno"],
791[
792  AC_MSG_RESULT([no])
793],
794[
795  AS_CASE([${host_os}],
796  [linux*],
797  [
798    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_LinuxLF"])
799    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE_SOURCE"])
800    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE64_SOURCE"])
801    AS_VAR_APPEND([CPPFLAGS], [" -D_FILE_OFFSET_BITS=64"])
802  ],
803  [freebsd*],
804  [
805    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_FreeBSDLF"])
806  ],
807  [solaris*],
808  [
809    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_SolarisLF"])
810    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE_SOURCE"])
811    AS_VAR_APPEND([CPPFLAGS], [" -D_FILE_OFFSET_BITS=64"])
812  ],
813  [osf*],
814  [
815    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_OSF1LF"])
816  ],
817  [irix*],
818  [
819    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_IRIXLF"])
820    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE64_SOURCE"])
821  ],
822  [aix*],
823  [
824    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_AIXLF"])
825    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGE_FILES"])
826  ],
827  [hpux*],
828  [
829    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_HPUXLF"])
830    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE_SOURCE"])
831    AS_VAR_APPEND([CPPFLAGS], [" -D_FILE_OFFSET_BITS=64"])
832  ],
833  [darwin*],
834  [
835    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_MACOSXLF"])
836  ])
837
838  AC_MSG_RESULT([yes])
839])
840
841
842
843
844# Enable libraries provided by the system rather than EMBOSS:
845# --enable-systemlibs, sets ESYSTEMLIBS
846
847AC_ARG_ENABLE([systemlibs],
848[AS_HELP_STRING([--enable-systemlibs], [utility for RPM/dpkg bundles])])
849
850AM_CONDITIONAL([ESYSTEMLIBS], [test "x${enable_systemlibs}" = "xyes"])
851
852
853
854
855# Enable the purify tool: --enable-purify, sets CC and LIBTOOL
856
857AC_ARG_ENABLE([purify],
858[AS_HELP_STRING([--enable-purify], [purify])])
859
860AC_MSG_CHECKING([for purify])
861
862AS_IF([test "x${enable_purify}" = "xyes"],
863[
864dnl if(purify -version) < /dev/null > /dev/null 2>&1; then
865  CC="purify --chain-length=20 -best-effort -windows=yes gcc -g"
866  LIBTOOL="${LIBTOOL} --tag=CC"
867  AC_MSG_RESULT([yes])
868dnl fi
869],
870[
871  AC_MSG_RESULT([no])
872])
873
874# Enable GCC profiling: --enable-gccprofile, appends CFLAGS and LDFLAGS
875
876if test "x${with_gccprofile}" = "xyes" ; then
877  CFLAGS="${CFLAGS} -pg"
878  LDFLAGS="${LDFLAGS} -pg"
879fi
880
881
882
883
884# Enable GCOV pcoverage analysis: --enable-gcov, appends CFLAGS
885
886if test "x${with_gcov}" = "xyes" ; then
887  CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
888fi
889
890
891
892
893dnl Set extra needed compiler flags
894if test "x${CC}" = "xcc"; then
895  case "${host}" in
896    alpha*-dec-osf*) CFLAGS="${CFLAGS} -ieee";;
897  esac
898fi
899
900AM_CONDITIONAL([PURIFY], [test "x${enable_purify}" = "xyes"])
901
902
903
904
905dnl Test for cygwin to set AM_LDFLAGS in library & apps Makefile.ams
906dnl Replaces original version which used 'expr' and so wasn't entirely
907dnl portable.
908platform_cygwin="no"
909AC_MSG_CHECKING([for cygwin])
910case "${host}" in
911  *-*-mingw*|*-*-cygwin*)
912    platform_cygwin="yes"
913    ;;
914  *)
915    platform_cygwin="no"
916    ;;
917esac
918AC_MSG_RESULT([${platform_cygwin}])
919AM_CONDITIONAL([ISCYGWIN], [test "x${platform_cygwin}" = "xyes"])
920
921
922
923
924dnl Tests for AIX
925dnl If shared needs -Wl,-G in plplot,ajax,nucleus, -lX11 in plplot,
926dnl and -Wl,brtl -Wl,-bdynamic in emboss
927dnl We therefore need a static test as well
928needajax="no"
929
930AS_CASE([${host_os}],
931[aix*],
932[AM_CONDITIONAL([ISAIXIA64], [true])],
933[AM_CONDITIONAL([ISAIXIA64], [false])])
934
935AM_CONDITIONAL([ISSHARED], [test "x${enable_shared}" = "xyes"])
936
937AS_CASE([${host_os}],
938[aix*],
939[
940  AS_IF([test -d ajax/.libs],
941  [AS_ECHO(["AIX ajax/.libs exists"])], [mkdir ajax/.libs])
942
943  AS_CASE([${host_os}],
944  [aix5*], [needajax="no"],
945  [aix4.3.3*], [needajax="yes"],
946  [needajax="no"])
947])
948
949AM_CONDITIONAL([NEEDAJAX], [test "x${needajax}" = "xyes"])
950
951
952
953
954# HP-UX needs -lsec for shadow passwords
955
956AS_CASE([${host_os}],
957[hpux*],
958[AS_VAR_APPEND([LDFLAGS], [" -lsec"])])
959
960
961
962
963# GNU mcheck functions: --enable-mcheck, defines HAVE_MCHECK
964
965AC_ARG_ENABLE([mcheck],
966[AS_HELP_STRING([--enable-mcheck],
967[mcheck and mprobe memory allocation test])])
968
969AS_IF([test "x${enable_mcheck}" = "xyes"], [AC_CHECK_FUNCS([mcheck])])
970
971
972
973
974# Collect AJAX statistics: --enable-savestats, defines AJ_SAVESTATS
975
976AC_ARG_ENABLE([savestats],
977[AS_HELP_STRING([--enable-savestats],
978[save AJAX statistics and print with debug output])])
979
980AC_MSG_CHECKING([for savestats])
981
982AS_IF([test "x${enable_savestats}" = "xyes"],
983[
984  AC_DEFINE([AJ_SAVESTATS], [1],
985  [Define to 1 to collect AJAX library usage statistics.])
986  AC_MSG_RESULT([yes])
987],
988[
989  AC_MSG_RESULT([no])
990])
991
992
993
994
995AC_CONFIG_FILES([Makefile
996                 ajax/Makefile
997                 ajax/acd/Makefile
998                 ajax/ajaxdb/Makefile
999                 ajax/core/Makefile
1000                 ajax/ensembl/Makefile
1001                 ajax/expat/Makefile
1002                 ajax/graphics/Makefile
1003                 ajax/pcre/Makefile
1004                 ajax/zlib/Makefile
1005                 doc/Makefile
1006                 doc/manuals/Makefile
1007                 doc/programs/Makefile
1008                 doc/programs/html/Makefile
1009                 doc/programs/text/Makefile
1010                 doc/tutorials/Makefile
1011                 emboss/Makefile
1012                 emboss/acd/Makefile
1013                 emboss/data/AAINDEX/Makefile
1014                 emboss/data/CODONS/Makefile
1015                 emboss/data/JASPAR_CNE/Makefile
1016                 emboss/data/JASPAR_CORE/Makefile
1017                 emboss/data/JASPAR_FAM/Makefile
1018                 emboss/data/JASPAR_PBM/Makefile
1019                 emboss/data/JASPAR_PBM_HLH/Makefile
1020                 emboss/data/JASPAR_PBM_HOMEO/Makefile
1021                 emboss/data/JASPAR_PHYLOFACTS/Makefile
1022                 emboss/data/JASPAR_POLII/Makefile
1023                 emboss/data/JASPAR_SPLICE/Makefile
1024                 emboss/data/Makefile
1025                 emboss/data/OBO/Makefile
1026                 emboss/data/PRINTS/Makefile
1027                 emboss/data/PROSITE/Makefile
1028                 emboss/data/REBASE/Makefile
1029                 emboss/data/TAXONOMY/Makefile
1030                 emboss/index/Makefile
1031                 jemboss/Makefile
1032                 jemboss/runJemboss.sh
1033                 jemboss/images/Makefile
1034                 jemboss/lib/Makefile
1035                 jemboss/lib/axis/Makefile
1036                 jemboss/resources/Makefile
1037                 jemboss/utils/Makefile
1038                 nucleus/Makefile
1039                 plplot/Makefile
1040                 plplot/lib/Makefile
1041                 test/Makefile
1042                 test/data/Makefile
1043                 test/embl/Makefile
1044                 test/genbank/Makefile
1045                 test/pir/Makefile
1046                 test/swiss/Makefile
1047                 test/swnew/Makefile
1048                 test/testdb/Makefile
1049])
1050
1051AC_OUTPUT
1052