File: configure.in

package info (click to toggle)
emboss 6.6.0+dfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 571,544 kB
  • sloc: ansic: 460,579; java: 29,439; perl: 13,573; sh: 12,754; makefile: 3,283; csh: 706; asm: 351; xml: 239; pascal: 237; modula3: 8
file content (1051 lines) | stat: -rw-r--r-- 27,594 bytes parent folder | download | duplicates (3)
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
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
#                                               -*- Autoconf -*-
# Configure template for the EMBOSS package.
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.64])
AC_INIT([EMBOSS],
[6.6.0],
[emboss-bug@emboss.open-bio.org],
[EMBOSS],
[http://emboss.open-bio.org/])
AC_REVISION([$Revision: 1.162 $])
AC_CONFIG_SRCDIR([ajax/acd/ajacd.c])
AC_CONFIG_HEADERS([ajax/core/config.h])
AC_CONFIG_MACRO_DIR([m4])

# Make sure CFLAGS is defined to stop AC_PROG_CC adding -g.
CFLAGS="${CFLAGS} "

# Checks for programs.
AC_PROG_AWK
AC_PROG_CC([icc gcc cc])
AC_PROG_CXX([icpc g++])
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P

AM_INIT_AUTOMAKE

# Use libtool to make a shared library.
LT_INIT




# Check if 64 bit pointer support is required on 32 bit machines
# Disabled by default

AC_ARG_ENABLE([64],
[AS_HELP_STRING([--enable-64], [64 bit pointers on 32 bit machines])])

AS_IF([test "x${enable_64}" = "xyes"],
[
  AC_MSG_CHECKING([for 64bit compilation support])

  AS_CASE([${host_os}],
  [aix*],
  [
    CPPFLAGS="-DAJ_AIX64 ${CPPFLAGS}"
    AS_CASE([${CC}],
    [gcc],
    [],
    [
      AS_VAR_APPEND([CC], [" -q64"])
    ])
    NM="nm -B -X 64"
    AR="ar -X 64"
  ],
  [hpux*],
  [
    AS_CASE([${CC}],
    [gcc],
    [],
    [
      AS_VAR_APPEND([CC], [" +DD64"])
    ])
    AC_DEFINE([HPUX64PTRS], [1], [Set to 1 if HPUX 64bit ptrs on 32 bit m/c])
  ])
  AC_MSG_RESULT([done])
])




# Compiler optimisations
# The Solaris 64bit ptr check has to be done here owing to param order

AC_ARG_WITH([optimisation],
[AS_HELP_STRING([--without-optimisation], [Disable compiler optimisation])])

AS_IF([test "x${with_optimisation}" != "xno"],
[
  AS_CASE([${CC}],
  [gcc],
  [
    # Intel MacOSX requires reduced optimisation for PCRE code
    # other OSs just use -O2
    AS_CASE([${host_os}],
    [darwin*],
    [
      AS_IF([test "x${host_cpu}" = "xi386"],
      [AS_VAR_APPEND([CFLAGS], [" -O1"])],
      [AS_VAR_APPEND([CFLAGS], [" -O2"])])
    ],
    [
      AS_VAR_APPEND([CFLAGS], [" -O2"])
    ])
  ],
  [
    AS_CASE([${host_os}],
    [aix*],
    [
      AS_VAR_APPEND([CFLAGS], [" -O3 -qstrict -qarch=auto -qtune=auto"])
    ],
    [irix*],
    [
      LD="/usr/bin/ld -IPA"
      AS_VAR_APPEND([CFLAGS], [" -O3"])
    ],
    [hpux*],
    [
      AS_VAR_APPEND([CFLAGS], [" -fast"])
    ],
    [osf*],
    [
      AS_VAR_APPEND([CFLAGS], [" -fast -U_FASTMATH"])
    ],
    [solaris*],
    [
      AS_VAR_APPEND([CFLAGS], [" -O"])
      # test for 64 bit ptr here (see Solaris 64bit above)
      AS_IF([test "x${enable_64}" = "xyes"],
      [AS_VAR_APPEND([CFLAGS], [" -xtarget=ultra -xarch=v9"])])
    ],
    [linux*],
    [
      # Default optimisation for non-gcc compilers under Linux
      AS_VAR_APPEND([CFLAGS], [" -O2"])
    ],
    [freebsd*],
    [
      AS_VAR_APPEND([CFLAGS], [" -O2"])
    ])
  ])
])




# Compiler warning settings: --enable-warnings, defines WARN_CFLAGS

AC_ARG_ENABLE([warnings],
[AS_HELP_STRING([--enable-warnings], [compiler warnings])])

AS_IF([test "x${enable_warnings}" = "xyes"],
[
  AS_CASE([${CC}],
  [gcc],
  [
    # -Wall priovides:
    #    -Waddress
    #    -Warray-bounds (only with -O2)
    #    -Wc++0x-compat
    #    -Wchar-subscripts
    #    -Wenum-compare (in C/Objc; this is on by default in C++)
    #    -Wimplicit-int (C and Objective-C only)
    #    -Wimplicit-function-declaration (C and Objective-C only)
    #    -Wcomment
    #    -Wformat
    #    -Wmain (only for C/ObjC and unless -ffreestanding)
    #    -Wmissing-braces
    #    -Wnonnull
    #    -Wparentheses
    #    -Wpointer-sign
    #    -Wreorder
    #    -Wreturn-type
    #    -Wsequence-point
    #    -Wsign-compare (only in C++)
    #    -Wstrict-aliasing
    #    -Wstrict-overflow=1
    #    -Wswitch
    #    -Wtrigraphs
    #    -Wuninitialized
    #    -Wunknown-pragmas
    #    -Wunused-function
    #    -Wunused-label
    #    -Wunused-value
    #    -Wunused-variable
    #    -Wvolatile-register-var

    AS_VAR_SET([WARN_CFLAGS], ["-Wall -fno-strict-aliasing"])
  ])
])

AC_SUBST([WARN_CFLAGS])




# Compiler developer warning settings: --enable-devwarnings,
# sets DEVWARN_CFLAGS

AC_ARG_ENABLE([devwarnings],
[AS_HELP_STRING([--enable-devwarnings],
[strict compiler warnings for developers])])

AS_IF([test "x${enable_devwarnings}" = "xyes"],
[
  AS_CASE([${CC}],
  [gcc],
  [
    # Diagnostic options for the GNU GCC compiler version 4.6.1.
    # http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/Warning-Options.html
    #
    # -Wextra: more warnings beyond what -Wall provides
    #    -Wclobbered
    #    -Wempty-body
    #    -Wignored-qualifiers
    #    -Wmissing-field-initializers
    #    -Wmissing-parameter-type (C only)
    #    -Wold-style-declaration (C only)
    #    -Woverride-init
    #    -Wsign-compare
    #    -Wtype-limits
    #    -Wuninitialized
    #    -Wunused-parameter (only with -Wunused or -Wall)
    #    -Wunused-but-set-parameter (only with -Wunused or -Wall)

    AS_VAR_SET([DEVWARN_CFLAGS], ["-Wextra"])

    # Warn if a function is declared or defined without specifying the
    # argument types.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wstrict-prototypes"])

    # Warn if a global function is defined without a previous prototype
    # declaration.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-prototypes"])

    # Warn for obsolescent usages, according to the C Standard,
    # in a declaration.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wold-style-definition"])

    # Warn if a global function is defined without a previous declaration.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-declarations"])

    # When compiling C, give string constants the type const char[length]
    # so that copying the address of one into a non-const char * pointer
    # will get a warning.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wwrite-strings"])

    # Warn whenever a local variable or type declaration shadows another
    # variable, parameter, type, or class member (in C++), or whenever a
    # built-in function is shadowed.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wshadow"])

    # Warn when a declaration is found after a statement in a block.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wdeclaration-after-statement"])

    # Warn if an undefined identifier is evaluated in an `#if' directive.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wundef"])

    # Warn about anything that depends on the "size of" a function type
    # or of void.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpointer-arith"])

    # Warn whenever a pointer is cast so as to remove a type qualifier
    # from the target type.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcast-qual"])

    # Warn whenever a pointer is cast such that the required alignment
    # of the target is increased.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcast-align"])

    # Warn whenever a function call is cast to a non-matching type.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wbad-function-cast"])

    # Warn when a comparison between signed and unsigned values could
    # produce an incorrect result when the signed value is converted to
    # unsigned.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wsign-compare"])

    # Warn if a structure's initializer has some fields missing.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-field-initializers"])

    # An alias of the new option -Wsuggest-attribute=noreturn
    # Warn for cases where adding an attribute may be beneficial.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-noreturn"])

    # Warn if an extern declaration is encountered within a function.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wnested-externs"])

    # Warn if anything is declared more than once in the same scope,
    # even in cases where multiple declaration is valid and changes
    # nothing.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wredundant-decls"])

    # Warn if the loop cannot be optimized because the compiler could not
    # assume anything on the bounds of the loop indices.
    # -Wunsafe-loop-optimizations objects to loops with increments more
    # than 1 because if the end is at INT_MAX it could run forever ...
    # rarely

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunsafe-loop-optimizations"])

    # Warn for implicit conversions that may alter a value.
    # -Wconversion is brain-damaged - complains about char arguments
    # every time

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wconversion"])

    # Warn about certain constructs that behave differently in traditional
    # and ISO C.
    # -Wtraditional gives #elif and #error msgs

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wtraditional"])

    # Warn if floating point values are used in equality comparisons.
    # -Wfloat-equal will not allow tests for values still 0.0

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wfloat-equal"])

    # This option is only active when -ftree-vrp is active
    # (default for -O2 and above). It warns about subscripts to arrays
    # that are always out of bounds.
    # -Warray-bounds gives false positives in gcc 4.6.0
    # Disable rather than use a non-portable pragma

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wno-array-bounds"])
  ],
  [icc],
  [
    # Diagnostic options for the Intel(R) C++ compiler version 11.1.
    # http://software.intel.com/en-us/articles/intel-c-compiler-professional-edition-for-linux-documentation/

    # This option specifies the level of diagnostic messages to be
    # generated by the compiler.

    AS_VAR_SET([DEVWARN_CFLAGS], ["-w2"])

    # This option determines whether a warning is issued if generated
    # code is not C++ ABI compliant.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wabi"])

    # This option tells the compiler to display errors, warnings, and
    # remarks.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wall"])

    # This option tells the compiler to display a shorter form of
    # diagnostic output.

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wbrief"])

    # This option warns if cast is used to override pointer type
    # qualifier

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcast-qual"])

    # This option tells the compiler to perform compile-time code
    # checking for certain code.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcheck"])

    # This option determines whether a warning is issued when /*
    # appears in the middle of a /* */ comment.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcomment"])

    # Set maximum number of template instantiation contexts shown in
    # diagnostic.

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wcontext-limit=n"])

    # This option enables warnings for implicit conversions that may
    # alter a value.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wconversion"])

    # This option determines whether warnings are issued for deprecated
    # features.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wdeprecated"])

    # This option enables warnings based on certain C++ programming
    # guidelines.

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Weffc++"])

    # This option changes all warnings to errors.
    # Alternate: -diag-error warn

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Werror"])

    # This option changes all warnings and remarks to errors.
    # Alternate: -diag-error warn, remark

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Werror-all"])

    # This option determines whether warnings are issued about extra
    # tokens at the end of preprocessor directives.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wextra-tokens"])

    # This option determines whether argument checking is enabled for
    # calls to printf, scanf, and so forth.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wformat"])

    # This option determines whether the compiler issues a warning when
    # the use of format functions may cause security problems.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wformat-security"])

    # This option enables diagnostics about what is inlined and what is
    # not inlined.

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Winline"])

    # This option determines whether a warning is issued if the return
    # type of main is not expected.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmain"])

    # This option determines whether warnings are issued for global
    # functions and variables without prior declaration.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-declarations"])

    # Determines whether warnings are issued for missing prototypes.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmissing-prototypes"])

    # This option enables warnings if a multicharacter constant
    # ('ABC') is used.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wmultichar"])

    # Issue a warning when a class appears to be polymorphic,
    # yet it declares a non-virtual one.
    # This option is supported in C++ only.

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wnon-virtual-dtor"])

    # This option warns about operations that could result in
    # integer overflow.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Woverflow"])

    # This option tells the compiler to display diagnostics for 64-bit
    # porting.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wp64"])

    # Determines whether warnings are issued for questionable pointer
    # arithmetic.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpointer-arith"])

    # his option determines whether a warning is issued about the
    # use of #pragma once.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpragma-once"])

    # Issue a warning when the order of member initializers does not
    # match the order in which they must be executed.
    # This option is supported with C++ only.

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wreorder"])

    # This option determines whether warnings are issued when a function
    # uses the default int return type or when a return statement is
    # used in a void function.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wreturn-type"])

    # This option determines whether a warning is issued when a variable
    # declaration hides a previous declaration.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wshadow"])

    # This option warns for code that might violate the optimizer's
    # strict aliasing rules. Warnings are issued only when using
    # -fstrict-aliasing or -ansi-alias.

    # AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wstrict-aliasing"])

    # This option determines whether warnings are issued for functions
    # declared or defined without specified argument types.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wstrict-prototypes"])

    # This option determines whether warnings are issued if any trigraphs
    # are encountered that might change the meaning of the program.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wtrigraphs"])

    # This option determines whether a warning is issued if a variable
    # is used before being initialized.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wuninitialized"])

    # This option determines whether a warning is issued if an unknown
    # #pragma directive is used.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunknown-pragmas"])

    # This option determines whether a warning is issued if a declared
    # function is not used.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunused-function"])

    # This option determines whether a warning is issued if a local or
    # non-constant static variable is unused after being declared.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wunused-variable"])

    # This option issues a diagnostic message if const char* is
    # converted to (non-const) char *.

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wwrite-strings"])

    # Disable warning #981 operands are evaluated in unspecified order
    # http://software.intel.com/en-us/articles/cdiag981/

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -diag-disable 981"])
  ])
])

AC_SUBST([DEVWARN_CFLAGS])




# Compiler extra developer warning settings: --enable-devextrawarnings,
# appends DEVWARN_CFLAGS
# Will only have an effect if --enable-devwarnings also given

AC_ARG_ENABLE([devextrawarnings],
[AS_HELP_STRING([--enable-devextrawarnings],
[add extra warnings to devwarnings])])

AS_IF([test "x${enable_devwarnings}" = "xyes" &&
       test "x${enable_devextrawarnings}" = "xyes"],
[
  AS_CASE([${CC}],
  [gcc],
  [
    # flags used by Ubuntu 8.10 to check open has 2/3 arguments etc.

    AC_DEFINE([_FORTIFY_SOURCE], [2], [Set to 2 for open args])

    # compiler flags

    CPPFLAGS="-fstack-protector ${CPPFLAGS}"

    # warnings used by Ubuntu 8.10
    # -Wall already includes:
    #           -Wformat

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wformat-security -Wl,-z,relro"])

    # -Wpadded means moving char to end of structs - but also flags
    #  end of struct so need to add padding at end

    AS_VAR_APPEND([DEVWARN_CFLAGS], [" -Wpadded"])
  ])
])




# Compile deprecated functions still used in the book text for 6.2.0

AC_ARG_ENABLE([buildbookdeprecated],
[AS_HELP_STRING([--enable-buildbookdeprecated],
[build deprecated functions used in books for 6.2.0])])

# Compile all deprecated functions

AC_ARG_ENABLE([buildalldeprecated],
[AS_HELP_STRING([--enable-buildalldeprecated],
[build all deprecated functions])])

AS_IF([test "x${enable_buildbookdeprecated}" = "xyes" ||
       test "x${enable_buildalldeprecated}" = "xyes"],
[
  AC_DEFINE([AJ_COMPILE_DEPRECATED_BOOK], [1],
  [Define to 1 to compile deprecated functions used in book texts for 6.2.0])
])

AS_IF([test "x${enable_buildalldeprecated}" = "xyes"],
[
  AC_DEFINE([AJ_COMPILE_DEPRECATED], [1],
  [Define to 1 to compile all deprecated functions])
])




# Add extensions to Solaris for some reentrant functions

AS_CASE([${host_os}],
[solaris*],
[AS_VAR_APPEND([CFLAGS], [" -D__EXTENSIONS__"])])




# Test whether --with-sgiabi given for IRIX (n32m3 n32m4 64m3 64m4)

AS_CASE([${host_os}],
[irix*],
[
  AS_CASE([${CC}],
  [gcc],
  [],
  [cc],
  [CHECK_SGI])
])




dnl PCRE library definitions - see the MAJOR and MINOR values
dnl to see which version's configure.in these lines come from

dnl Provide the current PCRE version information. Do not use numbers
dnl with leading zeros for the minor version, as they end up in a C
dnl macro, and may be treated as octal constants. Stick to single
dnl digits for minor numbers less than 10. There are unlikely to be
dnl that many releases anyway.

PCRE_MAJOR="7"
PCRE_MINOR="9"
PCRE_DATE="11-Apr-2009"
PCRE_VERSION="${PCRE_MAJOR}.${PCRE_MINOR}"

dnl Default values for miscellaneous macros

POSIX_MALLOC_THRESHOLD="-DPOSIX_MALLOC_THRESHOLD=10"

dnl Provide versioning information for libtool shared libraries that
dnl are built by default on Unix systems.

PCRE_LIB_VERSION="0:1:0"
PCRE_POSIXLIB_VERSION="0:0:0"


dnl Define where the EMBOSS package is located
AC_SUBST([AJAX_FIXED_ROOT])
AJAX_FIXED_ROOT="\\\"`pwd`/emboss\\\""
AC_SUBST([EMBOSS_TOP])
EMBOSS_TOP=`pwd`
AC_SUBST([AJAX_SYSTEM])
AJAX_SYSTEM="\\\"`uname`\\\""




dnl FIXME: This does no longer seem required with Autoconf 2.67?
dnl Intel MacOSX 10.6 puts X11 in a non-standard place
dnl AS_IF([test "x${with_x}" != "xno"],
dnl [
dnl   AS_CASE([${host_os}],
dnl   [darwin*],
dnl   [
dnl     OSXX=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
dnl     AS_IF([test ${OSXX} '>' '10.4'],
dnl     [AS_VAR_APPEND([CFLAGS], [" -I/usr/X11/include -L/usr/X11/lib"])])
dnl   ])
dnl ])




# Checks for header files.
AC_PATH_XTRA
AC_HEADER_DIRENT
AC_HEADER_STDC

AC_CHECK_HEADERS([unistd.h TargetConfig.h])


# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM


# Checks for library functions.
AC_FUNC_GETPGRP
AC_FUNC_STRFTIME
AC_FUNC_FORK
AC_FUNC_VPRINTF

AC_CHECK_FUNCS([memmove])

AS_IF([test "x${with_x}" != "xno"], [LF_EMBOSS_PATH_XLIB])


# Library checks.
AC_CHECK_LIB([c], [socket], [LIBS="${LIBS}"], [LIBS="${LIBS} -lsocket"])
AC_CHECK_LIB([m], [main])


# GD for FreeBSD requires libiconv

AS_CASE([${host_os}],
[freebsd*],
[
  AS_IF([test "x${with_pngdriver}" != "xno"],
  [AC_CHECK_LIB([iconv], [main], [LIBS="${LIBS}"], [LIBS="-liconv ${LIBS}"])])
])




AM_CONDITIONAL([AMPNG], [false])
AM_CONDITIONAL([AMPDF], [false])

CHECK_GENERAL
CHECK_IDXDBS
CHECK_JAVA
CHECK_HPDF
CHECK_AXIS2C
CHECK_PNGDRIVER

AX_LIB_MYSQL
AX_LIB_POSTGRESQL




dnl "Export" these variables for PCRE

AC_SUBST([HAVE_MEMMOVE])
AC_SUBST([HAVE_STRERROR])
AC_SUBST([PCRE_MAJOR])
AC_SUBST([PCRE_MINOR])
AC_SUBST([PCRE_DATE])
AC_SUBST([PCRE_VERSION])
AC_SUBST([PCRE_LIB_VERSION])
AC_SUBST([PCRE_POSIXLIB_VERSION])
AC_SUBST([POSIX_MALLOC_THRESHOLD])




# Enable debugging: --enable-debug, sets CFLAGS

AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [debug (-g option on compiler)])])

AS_IF([test "x${enable_debug}" = "xyes"], [AS_VAR_APPEND([CFLAGS], [" -g"])])




# Turn off irritating linker warnings in IRIX

AS_CASE([${host_os}],
[irix*],
[
  CFLAGS="-Wl,-LD_MSG:off=85:off=84:off=16:off=134 ${CFLAGS}"
])




# Enable the large file interface: --enable-large, appends CPPFLAGS

AC_ARG_ENABLE([large],
[AS_HELP_STRING([--enable-large],
[over 2Gb file support @<:@default=yes@:>@])])

AC_MSG_CHECKING([for large file support])

AS_IF([test "x${enable_large}" = "xno"],
[
  AC_MSG_RESULT([no])
],
[
  AS_CASE([${host_os}],
  [linux*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_LinuxLF"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE_SOURCE"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE64_SOURCE"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_FILE_OFFSET_BITS=64"])
  ],
  [freebsd*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_FreeBSDLF"])
  ],
  [solaris*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_SolarisLF"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE_SOURCE"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_FILE_OFFSET_BITS=64"])
  ],
  [osf*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_OSF1LF"])
  ],
  [irix*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_IRIXLF"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE64_SOURCE"])
  ],
  [aix*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_AIXLF"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGE_FILES"])
  ],
  [hpux*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_HPUXLF"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_LARGEFILE_SOURCE"])
    AS_VAR_APPEND([CPPFLAGS], [" -D_FILE_OFFSET_BITS=64"])
  ],
  [darwin*],
  [
    AS_VAR_APPEND([CPPFLAGS], [" -DAJ_MACOSXLF"])
  ])

  AC_MSG_RESULT([yes])
])




# Enable libraries provided by the system rather than EMBOSS:
# --enable-systemlibs, sets ESYSTEMLIBS

AC_ARG_ENABLE([systemlibs],
[AS_HELP_STRING([--enable-systemlibs], [utility for RPM/dpkg bundles])])

AM_CONDITIONAL([ESYSTEMLIBS], [test "x${enable_systemlibs}" = "xyes"])




# Enable the purify tool: --enable-purify, sets CC and LIBTOOL

AC_ARG_ENABLE([purify],
[AS_HELP_STRING([--enable-purify], [purify])])

AC_MSG_CHECKING([for purify])

AS_IF([test "x${enable_purify}" = "xyes"],
[
dnl if(purify -version) < /dev/null > /dev/null 2>&1; then
  CC="purify --chain-length=20 -best-effort -windows=yes gcc -g"
  LIBTOOL="${LIBTOOL} --tag=CC"
  AC_MSG_RESULT([yes])
dnl fi
],
[
  AC_MSG_RESULT([no])
])

# Enable GCC profiling: --enable-gccprofile, appends CFLAGS and LDFLAGS

if test "x${with_gccprofile}" = "xyes" ; then
  CFLAGS="${CFLAGS} -pg"
  LDFLAGS="${LDFLAGS} -pg"
fi




# Enable GCOV pcoverage analysis: --enable-gcov, appends CFLAGS

if test "x${with_gcov}" = "xyes" ; then
  CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
fi




dnl Set extra needed compiler flags
if test "x${CC}" = "xcc"; then
  case "${host}" in
    alpha*-dec-osf*) CFLAGS="${CFLAGS} -ieee";;
  esac
fi

AM_CONDITIONAL([PURIFY], [test "x${enable_purify}" = "xyes"])




dnl Test for cygwin to set AM_LDFLAGS in library & apps Makefile.ams
dnl Replaces original version which used 'expr' and so wasn't entirely
dnl portable.
platform_cygwin="no"
AC_MSG_CHECKING([for cygwin])
case "${host}" in
  *-*-mingw*|*-*-cygwin*)
    platform_cygwin="yes"
    ;;
  *)
    platform_cygwin="no"
    ;;
esac
AC_MSG_RESULT([${platform_cygwin}])
AM_CONDITIONAL([ISCYGWIN], [test "x${platform_cygwin}" = "xyes"])




dnl Tests for AIX
dnl If shared needs -Wl,-G in plplot,ajax,nucleus, -lX11 in plplot,
dnl and -Wl,brtl -Wl,-bdynamic in emboss
dnl We therefore need a static test as well
needajax="no"

AS_CASE([${host_os}],
[aix*],
[AM_CONDITIONAL([ISAIXIA64], [true])],
[AM_CONDITIONAL([ISAIXIA64], [false])])

AM_CONDITIONAL([ISSHARED], [test "x${enable_shared}" = "xyes"])

AS_CASE([${host_os}],
[aix*],
[
  AS_IF([test -d ajax/.libs],
  [AS_ECHO(["AIX ajax/.libs exists"])], [mkdir ajax/.libs])

  AS_CASE([${host_os}],
  [aix5*], [needajax="no"],
  [aix4.3.3*], [needajax="yes"],
  [needajax="no"])
])

AM_CONDITIONAL([NEEDAJAX], [test "x${needajax}" = "xyes"])




# HP-UX needs -lsec for shadow passwords

AS_CASE([${host_os}],
[hpux*],
[AS_VAR_APPEND([LDFLAGS], [" -lsec"])])




# GNU mcheck functions: --enable-mcheck, defines HAVE_MCHECK

AC_ARG_ENABLE([mcheck],
[AS_HELP_STRING([--enable-mcheck],
[mcheck and mprobe memory allocation test])])

AS_IF([test "x${enable_mcheck}" = "xyes"], [AC_CHECK_FUNCS([mcheck])])




# Collect AJAX statistics: --enable-savestats, defines AJ_SAVESTATS

AC_ARG_ENABLE([savestats],
[AS_HELP_STRING([--enable-savestats],
[save AJAX statistics and print with debug output])])

AC_MSG_CHECKING([for savestats])

AS_IF([test "x${enable_savestats}" = "xyes"],
[
  AC_DEFINE([AJ_SAVESTATS], [1],
  [Define to 1 to collect AJAX library usage statistics.])
  AC_MSG_RESULT([yes])
],
[
  AC_MSG_RESULT([no])
])




AC_CONFIG_FILES([Makefile
                 ajax/Makefile
                 ajax/acd/Makefile
                 ajax/ajaxdb/Makefile
                 ajax/core/Makefile
                 ajax/ensembl/Makefile
                 ajax/expat/Makefile
                 ajax/graphics/Makefile
                 ajax/pcre/Makefile
                 ajax/zlib/Makefile
                 doc/Makefile
                 doc/manuals/Makefile
                 doc/programs/Makefile
                 doc/programs/html/Makefile
                 doc/programs/text/Makefile
                 doc/tutorials/Makefile
                 emboss/Makefile
                 emboss/acd/Makefile
                 emboss/data/AAINDEX/Makefile
                 emboss/data/CODONS/Makefile
                 emboss/data/JASPAR_CNE/Makefile
                 emboss/data/JASPAR_CORE/Makefile
                 emboss/data/JASPAR_FAM/Makefile
                 emboss/data/JASPAR_PBM/Makefile
                 emboss/data/JASPAR_PBM_HLH/Makefile
                 emboss/data/JASPAR_PBM_HOMEO/Makefile
                 emboss/data/JASPAR_PHYLOFACTS/Makefile
                 emboss/data/JASPAR_POLII/Makefile
                 emboss/data/JASPAR_SPLICE/Makefile
                 emboss/data/Makefile
                 emboss/data/OBO/Makefile
                 emboss/data/PRINTS/Makefile
                 emboss/data/PROSITE/Makefile
                 emboss/data/REBASE/Makefile
                 emboss/data/TAXONOMY/Makefile
                 emboss/index/Makefile
                 jemboss/Makefile
                 jemboss/runJemboss.sh
                 jemboss/images/Makefile
                 jemboss/lib/Makefile
                 jemboss/lib/axis/Makefile
                 jemboss/resources/Makefile
                 jemboss/utils/Makefile
                 nucleus/Makefile
                 plplot/Makefile
                 plplot/lib/Makefile
                 test/Makefile
                 test/data/Makefile
                 test/embl/Makefile
                 test/genbank/Makefile
                 test/pir/Makefile
                 test/swiss/Makefile
                 test/swnew/Makefile
                 test/testdb/Makefile
])

AC_OUTPUT