Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([gsl],[1.11])
4 AC_CONFIG_SRCDIR(gsl_math.h)
5
6 AM_INIT_AUTOMAKE([gnu no-dependencies])
7 AC_CONFIG_HEADERS([config.h])
8 AM_MAINTAINER_MODE
9
10 dnl Library versioning (current:revision:age)
11 dnl See the libtool manual for an explanation of the numbers
12 dnl
13 dnl gsl-1.0    libgsl 0:0:0  libgslcblas 0:0:0
14 dnl gsl-1.1    libgsl 1:0:1  libgslcblas 0:0:0
15 dnl gsl-1.1.1  libgsl 2:0:2  libgslcblas 0:0:0
16 dnl gsl-1.2    libgsl 3:0:3  libgslcblas 0:0:0
17 dnl gsl-1.3    libgsl 4:0:4  libgslcblas 0:0:0
18 dnl gsl-1.4    libgsl 5:0:5  libgslcblas 0:0:0
19 dnl gsl-1.5    libgsl 6:0:6  libgslcblas 0:0:0
20 dnl gsl-1.6    libgsl 7:0:7  libgslcblas 0:0:0
21 dnl gsl-1.7    libgsl 8:0:8  libgslcblas 0:0:0
22 dnl gsl-1.8    libgsl 9:0:9  libgslcblas 0:0:0
23 dnl gsl-1.9    libgsl 10:0:10 libgslcblas 0:0:0 
24 dnl gsl-1.10   libgsl 10:0:10 (*) libgslcblas 0:0:0 
25 dnl gsl-1.11   libgsl 12:0:12  libgslcblas 0:0:0 
26 dnl 
27 dnl (*) There was an error on this release.  Firstly, the versioning
28 dnl numbers were not updated.  Secondly, 2 functions were removed, but
29 dnl the age not reset--this should have been 11:0:0.  However these
30 dnl functions were not documented and are regarded as internal, so we
31 dnl will assume 11:0:11.
32 dnl
33 dnl How to update library version number
34 dnl ====================================
35 dnl 
36 dnl C: increment if the interface has additions, changes, removals.
37 dnl
38 dnl R: increment any time the source changes; set to 0 if you
39 dnl incremented CURRENT
40 dnl
41 dnl A: increment if any interfaces have been added; set to 0 if any
42 dnl interfaces have been removed. removal has precedence over adding,
43 dnl so set to 0 if both happened.
44
45 dnl
46 GSL_CURRENT=12
47 GSL_REVISION=0
48 GSL_AGE=12
49 dnl
50 CBLAS_CURRENT=0
51 CBLAS_REVISION=0
52 CBLAS_AGE=0
53
54 GSL_LT_VERSION="${GSL_CURRENT}:${GSL_REVISION}:${GSL_AGE}"
55 AC_SUBST(GSL_LT_VERSION)
56
57 GSL_LT_CBLAS_VERSION="${CBLAS_CURRENT}:${CBLAS_REVISION}:${CBLAS_AGE}"
58 AC_SUBST(GSL_LT_CBLAS_VERSION)
59
60 case "$VERSION" in
61     *+)
62         ;;
63     *)
64         AC_DEFINE(RELEASED,[],[Defined if this is an official release])
65         ;;
66 esac
67
68 dnl things required by automake
69 dnl AC_ARG_PROGRAM
70 AC_PROG_MAKE_SET
71
72 dnl Check for which system.
73 AC_CANONICAL_HOST
74
75 dnl Checks for programs.
76 AC_LANG(C)
77 AC_PROG_CC
78 AC_PROG_CPP
79 AC_PROG_INSTALL
80 AC_PROG_LN_S
81 AC_PROG_LIBTOOL
82
83 dnl Check compiler features
84 AC_TYPE_SIZE_T
85 dnl AC_C_CONST
86 AC_C_VOLATILE
87 AC_C_INLINE
88 AC_C_CHAR_UNSIGNED
89
90 GSL_CFLAGS="-I$includedir"
91 GSL_LIBS="-L$libdir -lgsl"
92
93 AC_SUBST(GSL_CFLAGS)
94 AC_SUBST(GSL_LIBS)
95
96 dnl Check for "extern inline", using a modified version of the test
97 dnl for AC_C_INLINE from acspecific.mt
98 dnl
99 AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
100 [ac_cv_c_extern_inline=no
101 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern $ac_cv_c_inline double foo(double x);
102 extern $ac_cv_c_inline double foo(double x) { return x + 1.0 ; } ;
103 double foo (double x) { return x + 1.0 ; };]], [[  foo(1.0)  ]])],[ac_cv_c_extern_inline="yes"],[])
104 ])
105
106 if test "$ac_cv_c_extern_inline" != no ; then
107    AC_DEFINE(HAVE_INLINE,[],[Define if you have inline])
108 fi
109
110 dnl Checks for header files.
111 AC_CHECK_HEADERS(ieeefp.h)
112
113 dnl Checks for typedefs, structures, and compiler characteristics.
114
115 case "$host_os" in
116      *mingw*)
117         MINGW=true
118         ;;
119 esac
120
121 AM_CONDITIONAL(MINGW32_HOST, test "$MINGW" = "true")
122
123 dnl Checks for library functions.
124
125 dnl AC_FUNC_ALLOCA
126 AC_FUNC_VPRINTF
127
128 dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added.
129 dnl removed strerror from this list, it's hardcoded in the err/ directory
130 dnl Any functions which appear in this list of functions should be provided
131 dnl in the utils/ directory
132 dnl xmalloc is not used, removed (bjg)
133 AC_REPLACE_FUNCS(memcpy memmove strdup strtol strtoul)
134
135 AC_CACHE_CHECK(for EXIT_SUCCESS and EXIT_FAILURE,
136 ac_cv_decl_exit_success_and_failure,
137 AC_EGREP_CPP(yes,
138 [
139 #include <stdlib.h>
140 #ifdef EXIT_SUCCESS
141 yes
142 #endif
143 ], 
144 ac_cv_decl_exit_success_and_failure=yes,
145 ac_cv_decl_exit_success_and_failure=no)
146 )
147
148 if test "$ac_cv_decl_exit_success_and_failure" = yes ; then
149   AC_DEFINE(HAVE_EXIT_SUCCESS_AND_FAILURE,1,[Defined if you have ansi EXIT_SUCCESS and EXIT_FAILURE in stdlib.h])
150 fi ;
151
152 dnl Use alternate libm if specified by user
153
154 if test "x$LIBS" = "x" ; then
155   AC_CHECK_LIB(m, cos)
156 fi
157
158 dnl Remember to put a definition in acconfig.h for each of these
159 AC_CHECK_DECLS(feenableexcept,,,[#define _GNU_SOURCE 1
160 #include <fenv.h>]) 
161 AC_CHECK_DECLS(fesettrapenable,,,[#define _GNU_SOURCE 1
162 #include <fenv.h>]) 
163 AC_CHECK_DECLS(hypot,,,[#include <math.h>]) 
164 AC_CHECK_DECLS(expm1,,,[#include <math.h>])
165 AC_CHECK_DECLS(acosh,,,[#include <math.h>])
166 AC_CHECK_DECLS(asinh,,,[#include <math.h>])
167 AC_CHECK_DECLS(atanh,,,[#include <math.h>])
168 AC_CHECK_DECLS(ldexp,,,[#include <math.h>])
169 AC_CHECK_DECLS(frexp,,,[#include <math.h>])
170 AC_CHECK_DECLS(isinf,,,[#include <math.h>])
171 AC_CHECK_DECLS(isfinite,,,[#include <math.h>])
172 AC_CHECK_DECLS(finite,,,[#include <math.h>
173 #if HAVE_IEEEFP_H
174 #include <ieeefp.h>
175 #endif])
176 AC_CHECK_DECLS(isnan,,,[#include <math.h>])
177
178 dnl OpenBSD has a broken implementation of log1p.
179 case "$host" in
180     *-*-*openbsd*)
181        AC_MSG_RESULT([avoiding OpenBSD system log1p - using gsl version])
182        ;;
183     *)
184         AC_CHECK_DECLS(log1p,,,[#include <math.h>])
185        ;;
186 esac
187
188 AC_CACHE_CHECK([for long double stdio], ac_cv_func_printf_longdouble,
189 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
190 #include <stdlib.h>
191 #include <stdio.h>
192 int main (void) 
193
194 const char * s = "5678.25"; long double x = 1.234 ; 
195 fprintf(stderr,"%Lg\n",x) ; 
196 sscanf(s, "%Lg", &x);
197 if (x == 5678.25) {exit (0);} else {exit(1); };
198 }]])],[ac_cv_func_printf_longdouble="yes"],[ac_cv_func_printf_longdouble="no"],[ac_cv_func_printf_longdouble="no"])])
199
200 if test "$ac_cv_func_printf_longdouble" != no; then
201   AC_DEFINE(HAVE_PRINTF_LONGDOUBLE,1,[Define this if printf can handle %Lf for long double])
202 fi
203
204 AC_CACHE_CHECK([for extended floating point registers],ac_cv_c_extended_fp,
205 [case "$host" in
206     *sparc*-*-*)
207         ac_cv_c_extended_fp=no
208         ;;     
209     *powerpc*-*-*)
210         ac_cv_c_extended_fp=no
211         ;;      
212     *hppa*-*-*)
213         ac_cv_c_extended_fp=no
214         ;;      
215     *alpha*-*-*)
216         ac_cv_c_extended_fp=no
217         ;;      
218     *68k*-*-*)
219         ac_cv_c_extended_fp=yes
220         ;;      
221     *86-*-*)
222         ac_cv_c_extended_fp=yes
223         ;;      
224     x86_64-*-*)
225         ac_cv_c_extended_fp=yes
226         ;;      
227     *) 
228         ac_cv_c_extended_fp=unknown
229         ;;
230 esac
231 ])
232
233 if test $ac_cv_c_extended_fp != "no" ; then
234     AC_DEFINE(HAVE_EXTENDED_PRECISION_REGISTERS,1,[Defined on architectures with excess floating-point precision])
235 fi
236
237 AC_CACHE_CHECK([for IEEE arithmetic interface type], ac_cv_c_ieee_interface,
238 [case "$host" in
239     sparc-*-linux*) 
240         ac_cv_c_ieee_interface=gnusparc
241         ;;
242     m68k-*-linux*) 
243         ac_cv_c_ieee_interface=gnum68k
244         ;;
245     powerpc-*-linux*) 
246         ac_cv_c_ieee_interface=gnuppc
247         ;;
248     *86-*-gnu | *86_64-*-gnu | *86-*-linux* | *86_64-*-linux*) 
249         ac_cv_c_ieee_interface=gnux86
250         ;;
251     *-*-sunos4*) 
252         ac_cv_c_ieee_interface=sunos4
253         ;;
254     *-*-solaris*) 
255         ac_cv_c_ieee_interface=solaris
256         ;;
257     *-*-hpux11*) 
258         ac_cv_c_ieee_interface=hpux11
259         ;;
260     *-*-hpux*) 
261         ac_cv_c_ieee_interface=hpux
262         ;;
263     *-*-osf*) 
264         ac_cv_c_ieee_interface=tru64
265         ;;
266     *-*-aix*) 
267         ac_cv_c_ieee_interface=aix
268         ;;
269     *-*-irix*) 
270         ac_cv_c_ieee_interface=irix
271         ;;
272     powerpc-*-*darwin*) 
273         ac_cv_c_ieee_interface=darwin
274         ;;
275     *86-*-*darwin*) 
276         ac_cv_c_ieee_interface=darwin86
277         ;;
278     *-*-*netbsd*) 
279         ac_cv_c_ieee_interface=netbsd
280         ;;
281     *-*-*openbsd*)  
282         ac_cv_c_ieee_interface=openbsd
283         ;;
284     *-*-*bsd*) 
285         ac_cv_c_ieee_interface=freebsd
286         ;;
287     *-*-os2*)
288         ac_cv_c_ieee_interface=os2emx
289         ;;
290     *)
291         ac_cv_c_ieee_interface=unknown
292         ;;
293 esac
294 ])
295
296 if test "$ac_cv_c_ieee_interface" = "gnux86" ; then
297     AC_CACHE_CHECK([for FPU_SETCW], ac_cv_c_fpu_setcw,
298     [ac_cv_c_fpu_setcw=no
299     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fpu_control.h>
300 #ifndef _FPU_SETCW
301 #include <i386/fpu_control.h>
302 #define _FPU_SETCW(cw) __setfpucw(cw)
303 #endif
304 ]], [[ unsigned short mode = 0 ; _FPU_SETCW(mode); ]])],[ac_cv_c_fpu_setcw="yes"],[ac_cv_c_ieee_interface=unknown])
305     ])
306 fi
307
308 if test "$ac_cv_c_ieee_interface" = "gnux86" ; then
309     AC_CACHE_CHECK([for SSE extensions], ac_cv_c_fpu_sse,
310     [ac_cv_c_fpu_sse=no
311     AC_RUN_IFELSE([AC_LANG_PROGRAM([[
312 #include <stdlib.h>
313 #define _FPU_SETMXCSR(cw_sse) asm volatile ("ldmxcsr %0" : : "m" (*&cw_sse))
314 ]], [[ unsigned int mode = 0x1f80 ; _FPU_SETMXCSR(mode); exit(0); ]])],[ac_cv_c_fpu_sse="yes"])
315     ])
316     if test $ac_cv_c_fpu_sse = yes; then
317         AC_DEFINE([HAVE_FPU_X86_SSE], 1,
318                   [Define if x86 processor has sse extensions.])
319    fi
320 fi
321
322 ac_tr_ieee_interface=HAVE_`echo $ac_cv_c_ieee_interface | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_IEEE_INTERFACE
323 AC_DEFINE_UNQUOTED($ac_tr_ieee_interface,1,[IEEE Interface Type])
324
325 AC_SUBST(HAVE_GNUSPARC_IEEE_INTERFACE)
326 AC_SUBST(HAVE_GNUM68K_IEEE_INTERFACE)
327 AC_SUBST(HAVE_GNUPPC_IEEE_INTERFACE)
328 AC_SUBST(HAVE_GNUX86_IEEE_INTERFACE)
329 AC_SUBST(HAVE_SUNOS4_IEEE_INTERFACE)
330 AC_SUBST(HAVE_SOLARIS_IEEE_INTERFACE)
331 AC_SUBST(HAVE_HPUX11_IEEE_INTERFACE)
332 AC_SUBST(HAVE_HPUX_IEEE_INTERFACE)
333 AC_SUBST(HAVE_TRU64_IEEE_INTERFACE)
334 AC_SUBST(HAVE_IRIX_IEEE_INTERFACE)
335 AC_SUBST(HAVE_AIX_IEEE_INTERFACE)
336 AC_SUBST(HAVE_FREEBSD_IEEE_INTERFACE)
337 AC_SUBST(HAVE_OS2EMX_IEEE_INTERFACE)
338 AC_SUBST(HAVE_NETBSD_IEEE_INTERFACE)
339 AC_SUBST(HAVE_OPENBSD_IEEE_INTERFACE)
340 AC_SUBST(HAVE_DARWIN_IEEE_INTERFACE)
341 AC_SUBST(HAVE_DARWIN86_IEEE_INTERFACE)
342
343 dnl Check for IEEE control flags
344
345 save_cflags="$CFLAGS"
346 AC_CACHE_CHECK([for IEEE compiler flags], ac_cv_c_ieee_flags,
347 [
348 case "$host" in
349     alpha*-*-*)
350         if test X"$GCC" = Xyes ; then
351             ieee_flags='-mieee -mfp-rounding-mode=d'
352         else
353             # This assumes Compaq's C compiler.
354             ieee_flags='-ieee -fprm d'
355         fi
356         ;;
357 esac
358 if test X"$ieee_flags" != X ; then
359   CFLAGS="$ieee_flags $CFLAGS"
360   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int foo;]])],[ac_cv_c_ieee_flags="$ieee_flags"],[ac_cv_c_ieee_flags="none"])
361 else
362   ac_cv_c_ieee_flags="none"
363 fi])
364
365 if test "$ac_cv_c_ieee_flags" != "none" ; then
366    CFLAGS="$ac_cv_c_ieee_flags $save_cflags"
367 else
368    CFLAGS="$save_cflags"
369 fi
370
371 dnl Check IEEE comparisons, whether "x != x" is true for NaNs
372 dnl
373 AC_CACHE_CHECK([for IEEE comparisons], ac_cv_c_ieee_comparisons,
374 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
375 #include <math.h>
376 int main (void) 
377
378    int status; double inf, nan;
379    inf = exp(1.0e10);
380    nan = inf / inf ;
381    status = (nan == nan);
382    exit (status);
383 }]])],[ac_cv_c_ieee_comparisons="yes"],[ac_cv_c_ieee_comparisons="no"],[ac_cv_c_ieee_comparisons="yes"])
384 ])
385
386 if test "$ac_cv_c_ieee_comparisons" != no ; then
387   AC_DEFINE(HAVE_IEEE_COMPARISONS,1,[Define this if IEEE comparisons work correctly (e.g. NaN != NaN)])
388 fi
389
390 dnl Check for IEEE denormalized arithmetic
391 dnl
392 AC_CACHE_CHECK([for IEEE denormalized values], ac_cv_c_ieee_denormals,
393 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
394 #include <math.h> 
395 int main (void) 
396
397    int i, status; 
398    volatile double z = 1e-308;
399    for (i = 0; i < 5; i++) { z = z / 10.0 ; };        
400    for (i = 0; i < 5; i++) { z = z * 10.0 ; };
401    status = (z == 0.0);
402    exit (status);
403 }]])],[ac_cv_c_ieee_denormals="yes"],[ac_cv_c_ieee_denormals="no"],[ac_cv_c_ieee_denormals="yes"])
404 ])
405
406 if test "$ac_cv_c_ieee_denormals" != no ; then
407   AC_DEFINE(HAVE_IEEE_DENORMALS,1,[Define this if IEEE denormalized numbers are available])
408 fi
409
410 AH_TEMPLATE([HIDE_INLINE_STATIC],[Define if you need to hide the static definitions of inline functions])
411
412 AH_BOTTOM([/* Use 0 and 1 for EXIT_SUCCESS and EXIT_FAILURE if we don't have them */
413 #if !HAVE_EXIT_SUCCESS_AND_FAILURE
414 #define EXIT_SUCCESS 0
415 #define EXIT_FAILURE 1
416 #endif])
417
418 AH_BOTTOM([/* Define one of these if you have a known IEEE arithmetic interface */
419 #undef HAVE_GNUSPARC_IEEE_INTERFACE
420 #undef HAVE_GNUM68K_IEEE_INTERFACE
421 #undef HAVE_GNUPPC_IEEE_INTERFACE
422 #undef HAVE_GNUX86_IEEE_INTERFACE
423 #undef HAVE_SUNOS4_IEEE_INTERFACE
424 #undef HAVE_SOLARIS_IEEE_INTERFACE
425 #undef HAVE_HPUX11_IEEE_INTERFACE
426 #undef HAVE_HPUX_IEEE_INTERFACE
427 #undef HAVE_TRU64_IEEE_INTERFACE
428 #undef HAVE_IRIX_IEEE_INTERFACE
429 #undef HAVE_AIX_IEEE_INTERFACE
430 #undef HAVE_FREEBSD_IEEE_INTERFACE
431 #undef HAVE_OS2EMX_IEEE_INTERFACE
432 #undef HAVE_NETBSD_IEEE_INTERFACE
433 #undef HAVE_OPENBSD_IEEE_INTERFACE
434 #undef HAVE_DARWIN_IEEE_INTERFACE
435 #undef HAVE_DARWIN86_IEEE_INTERFACE])
436
437 AH_BOTTOM([/* Define a rounding function which moves extended precision values
438    out of registers and rounds them to double-precision. This should
439    be used *sparingly*, in places where it is necessary to keep
440    double-precision rounding for critical expressions while running in
441    extended precision. For example, the following code should ensure
442    exact equality, even when extended precision registers are in use,
443
444       double q = GSL_COERCE_DBL(3.0/7.0) ;
445       if (q == GSL_COERCE_DBL(3.0/7.0)) { ... } ;
446
447    It carries a penalty even when the program is running in double
448    precision mode unless you compile a separate version of the
449    library with HAVE_EXTENDED_PRECISION_REGISTERS turned off. */
450
451 #if HAVE_EXTENDED_PRECISION_REGISTERS
452 #define GSL_COERCE_DBL(x) (gsl_coerce_double(x))
453 #else
454 #define GSL_COERCE_DBL(x) (x)
455 #endif])
456
457 AH_BOTTOM([/* Substitute gsl functions for missing system functions */
458
459 #if !HAVE_DECL_HYPOT
460 #define hypot gsl_hypot
461 #endif
462
463 #if !HAVE_DECL_LOG1P
464 #define log1p gsl_log1p
465 #endif
466
467 #if !HAVE_DECL_EXPM1
468 #define expm1 gsl_expm1
469 #endif
470
471 #if !HAVE_DECL_ACOSH
472 #define acosh gsl_acosh
473 #endif
474
475 #if !HAVE_DECL_ASINH
476 #define asinh gsl_asinh
477 #endif
478
479 #if !HAVE_DECL_ATANH
480 #define atanh gsl_atanh
481 #endif
482
483 #if !HAVE_DECL_LDEXP
484 #define ldexp gsl_ldexp
485 #endif
486
487 #if !HAVE_DECL_FREXP
488 #define frexp gsl_frexp
489 #endif
490
491 #if !HAVE_DECL_ISINF
492 #define isinf gsl_isinf
493 #endif
494
495 #if !HAVE_DECL_FINITE
496 #define finite gsl_finite
497 #endif
498
499 #if !HAVE_DECL_ISNAN
500 #define isnan gsl_isnan
501 #endif])
502
503 AH_BOTTOM([#ifdef __GNUC__
504 #define DISCARD_POINTER(p) do { ; } while(p ? 0 : 0);
505 #else
506 #define DISCARD_POINTER(p) /* ignoring discarded pointer */
507 #endif])
508
509 AH_BOTTOM([#if defined(GSL_RANGE_CHECK_OFF) || !defined(GSL_RANGE_CHECK)
510 #define GSL_RANGE_CHECK 0  /* turn off range checking by default internally */
511 #endif])
512
513 AH_VERBATIM([GSL_DISABLE_DEPRECATED],
514 [/* Disable deprecated functions and enums while building */
515 #define GSL_DISABLE_DEPRECATED 1])
516
517 dnl
518 AC_CONFIG_FILES([gsl-config gsl.pc gsl_version.h gsl.spec gsl/Makefile test/Makefile err/Makefile sys/Makefile utils/Makefile const/Makefile min/Makefile multimin/Makefile ieee-utils/Makefile fft/Makefile specfunc/Makefile dht/Makefile fit/Makefile multifit/Makefile bspline/Makefile statistics/Makefile sum/Makefile roots/Makefile multiroots/Makefile ntuple/Makefile poly/Makefile qrng/Makefile rng/Makefile randist/Makefile siman/Makefile integration/Makefile interpolation/Makefile doc/Makefile block/Makefile vector/Makefile matrix/Makefile histogram/Makefile monte/Makefile ode-initval/Makefile cblas/Makefile blas/Makefile linalg/Makefile eigen/Makefile permutation/Makefile combination/Makefile sort/Makefile complex/Makefile diff/Makefile deriv/Makefile cheb/Makefile cdf/Makefile wavelet/Makefile Makefile])
519 AC_OUTPUT