dnl Process this file with autoconf to produce a configure script. AC_INIT(gsl_math.h) AM_INIT_AUTOMAKE(gsl, 0.5+) AM_CONFIG_HEADER(config.h) dnl things required by automake AC_ARG_PROGRAM AC_PROG_MAKE_SET dnl Check for which system. AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(AR, ar, :) AC_PROG_RANLIB #AM_PROG_LIBTOOL dnl Check compiler features AC_TYPE_SIZE_T AC_C_CONST AC_C_INLINE dnl Check for "extern inline", using a modified version of the test dnl for AC_C_INLINE from acspecific.mt dnl AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline, [ac_cv_c_extern_inline=no AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x); extern $ac_cv_c_inline double foo(double x) { return x + 1.0 ; } ; double foo (double x) { return x + 1.0 ; };], [ foo(1.0) ], [ac_cv_c_extern_inline="yes"]) ]) if test "$ac_cv_c_extern_inline" != no ; then AC_DEFINE(HAVE_INLINE,1) AC_SUBST(HAVE_INLINE) fi dnl some magic to get a full path to the working directory full_top_srcdir=`cd $srcdir; pwd` full_top_builddir=`pwd` echo srcdir is $srcdir echo full_top_srcdir is $full_top_srcdir echo full_top_builddir is $full_top_builddir AC_SUBST(full_top_srcdir) AC_SUBST(full_top_builddir) dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_CHECK_LIB(m, main) AC_CHECK_FUNCS(hypot) AC_CHECK_FUNCS(isinf) dnl AC_FUNC_ALLOCA AC_FUNC_VPRINTF dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added. dnl removed strerror from this list, it's hardcoded in the err/ directory dnl Any functions which appear in this list of functions should be provided dnl in the utils/ directory dnl xmalloc is not used, removed (bjg) AC_REPLACE_FUNCS(memcpy memmove strdup strtol strtoul) AC_CHECK_FUNCS(clock) AC_CACHE_CHECK(for CLOCKS_PER_SEC, ac_cv_decl_clocks_per_sec, AC_EGREP_CPP(yes, [ #include #ifdef CLOCKS_PER_SEC yes #endif ], ac_cv_decl_clocks_per_sec=yes, ac_cv_decl_clocks_per_sec=no) ) if test "$ac_cv_decl_clocks_per_sec" = yes ; then AC_DEFINE(HAVE_CLOCKS_PER_SEC) else AC_MSG_CHECKING(whether CLOCKS_PER_SEC is known for $host_os) case "$host" in *-*-sunos4.*) AC_DEFINE(HAVE_GUESSED_CLOCKS_PER_SEC,1000000) AC_MSG_RESULT([yes (microseconds)]) ;; *-*-nextstep*) dnl dnl Nextstep3 defines CLK_TCK 64 in /usr/include/ansi/time.h, dnl which seems to agree with observation of clock(). dnl AC_DEFINE(HAVE_GUESSED_CLOCKS_PER_SEC,64) AC_MSG_RESULT([yes (15.625 milliseconds)]) ;; *) AC_DEFINE(HAVE_GUESSED_CLOCKS_PER_SEC,1000000) AC_MSG_RESULT([no, assuming microseconds]) ;; esac fi AC_CACHE_CHECK(for EXIT_SUCCESS and EXIT_FAILURE, ac_cv_decl_exit_success_and_failure, AC_EGREP_CPP(yes, [ #include #ifdef EXIT_SUCCESS yes #endif ], ac_cv_decl_exit_success_and_failure=yes, ac_cv_decl_exit_success_and_failure=no) ) if test "$ac_cv_decl_exit_success_and_failure" = yes ; then AC_DEFINE(HAVE_EXIT_SUCCESS_AND_FAILURE) fi ; AC_MSG_CHECKING(for IEEE arithmetic interface type) case "$host" in sparc-*-linux*) AC_DEFINE(HAVE_SPARCLINUX_IEEE_INTERFACE) AC_MSG_RESULT([sparclinux]) ;; *-*-linux*) AC_DEFINE(HAVE_LINUX_IEEE_INTERFACE) AC_MSG_RESULT([linux]) ;; *-*-sunos4*) AC_DEFINE(HAVE_SUNOS4_IEEE_INTERFACE) AC_MSG_RESULT([sunos4]) ;; *-*-solaris*) AC_DEFINE(HAVE_SOLARIS_IEEE_INTERFACE) AC_MSG_RESULT([solaris]) ;; *-*-hpux*) AC_DEFINE(HAVE_HPUX_IEEE_INTERFACE) AC_MSG_RESULT([hpux]) ;; *-*-osf*) AC_DEFINE(HAVE_TRU64_IEEE_INTERFACE) AC_MSG_RESULT([osf/tru64]) ;; *-*-aix*) AC_DEFINE(HAVE_AIX_IEEE_INTERFACE) AC_MSG_RESULT([aix]) ;; *-*-irix*) AC_DEFINE(HAVE_IRIX_IEEE_INTERFACE) AC_MSG_RESULT([irix]) ;; *) AC_MSG_RESULT([unknown]) ;; esac AC_MSG_CHECKING([for rounding-control compiler flags]) save_cflags="$CFLAGS" case "$host" in alpha*-*-*) if test X"$GCC" = Xyes ; then ieee_alpha_options='-mfp-rounding-mode=d' CFLAGS="$ieee_alpha_options $CFLAGS" else # This assumes Compaq's C compiler, which is probably # a pretty bad assumption. Improvements welcome. ieee_alpha_options='-fprm d' CFLAGS="$ieee_alpha_options $CFLAGS" fi # # now see if the option we think should be accepted actually is # AC_TRY_COMPILE( ,[ int foo; ],[ AC_MSG_RESULT([$ieee_alpha_options]) dnl dnl after the check is over, CFLAGS will become save_cflags, dnl which has just acquired the additional flag. dnl save_cflags="$CFLAGS" ],[ AC_MSG_RESULT([unknown!]) AC_MSG_WARN( [I don't know how to enable dynamic rounding with your compiler] ) ] ) dnl here ends our AC_TRY_COMPILE ;; *) AC_MSG_RESULT([none]) ;; esac # Now restore our (possibly augmented) CFLAGS. CFLAGS="$save_cflags" AC_MSG_CHECKING([for IEEE-conformance compiler flags]) save_cflags="$CFLAGS" case "$host" in alpha*-*-*) if test X"$GCC" = Xyes ; then ieee_alpha_options='-mieee' CFLAGS="$ieee_alpha_options $CFLAGS" else # This assumes Compaq's C compiler, which is probably # a pretty bad assumption. Improvements welcome. ieee_alpha_options='-ieee' CFLAGS="$ieee_alpha_options $CFLAGS" fi # # now see if the option we think should be accepted actually is # AC_TRY_COMPILE( ,[ int foo; ],[ AC_MSG_RESULT([$ieee_alpha_options]) dnl dnl after the check is over, CFLAGS will become save_cflags, dnl which has just acquired the additional flag. dnl save_cflags="$CFLAGS" ],[ AC_MSG_RESULT([unknown!]) AC_MSG_WARN( [I don't know how to enable full IEEE mode with your compiler] ) ] ) dnl here ends our AC_TRY_COMPILE ;; *) AC_MSG_RESULT([none]) ;; esac # Now restore our (possibly augmented) CFLAGS. CFLAGS="$save_cflags" dnl AC_ARG_ENABLE(exceptions,[exceptions],AC_PROG_CXX) dnl dnl FIXME: on Solaris we will need a prototype for hypot, since it is dnl missing from their math.h according to Jerry. dnl dnl extern double hypot(double, double); dnl AC_MSG_CHECKING([whether printf/scanf works with long double]) AC_TRY_RUN([ #include #include int main (void) { const char * s = "5678"; long double x = 1.234 ; fprintf(stderr,"%Lg\n",x) ; sscanf(s, "%Lg", &x); if (x == 5678) {exit (0);} else {exit(1); }; }], ac_cv_func_printf_longdouble=yes, ac_cv_func_printf_longdouble=no, ac_cv_func_printf_longdouble=no) if test $ac_cv_func_printf_longdouble = yes; then AC_DEFINE(HAVE_PRINTF_LONGDOUBLE) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl AC_OUTPUT(gsl-config err/Makefile sys/Makefile utils/Makefile min/Makefile multimin/Makefile ieee-utils/Makefile fft/Makefile specfunc/Makefile dht/Makefile statistics/Makefile sum/Makefile roots/Makefile multiroots/Makefile poly/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 blas/Makefile linalg/Makefile eigen/Makefile Makefile)