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