"Fossies" - the Fresh Open Source Software Archive

Member "harminv-1.4.2/configure.ac" (6 Feb 2023, 4553 Bytes) of package /linux/privat/harminv-1.4.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.4.1_vs_1.4.2.

    1 # Process this file with autoconf to produce a configure script.
    2 
    3 # note: keep version number in sync with harminv.h
    4 AC_INIT([harminv],[1.4.2],[stevenj@alum.mit.edu])
    5 
    6 AM_INIT_AUTOMAKE([foreign silent-rules 1.11])
    7 AM_SILENT_RULES(yes)
    8 AC_CONFIG_SRCDIR(harminv.c)
    9 AC_CONFIG_HEADERS(config.h)
   10 AC_CONFIG_MACRO_DIR([m4])
   11 AM_MAINTAINER_MODE
   12 
   13 # Shared-library version number; indicates api compatibility, and is
   14 # *not* the same as the "human" version number.  CURRENT:REVISION:AGE
   15 SHARED_VERSION_INFO="3:1:0"
   16 AC_SUBST(SHARED_VERSION_INFO)
   17 AC_ENABLE_SHARED([no]) dnl shared libs cause too many headaches to be default
   18 
   19 ##############################################################################
   20 
   21 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug,compile for debugging])],
   22 	      enable_debug=$enableval, enable_debug=no)
   23 if test "$enable_debug" = "yes"; then
   24 	CFLAGS="-g"
   25 	CXXFLAGS="-g"
   26 	FFLAGS="-g"
   27 	AC_DEFINE(DEBUG,1,[define to enable debugging code])
   28 fi
   29 
   30 ##############################################################################
   31 
   32 # Checks for programs.
   33 AC_PROG_CC
   34 AC_PROG_MAKE_SET
   35 AC_PROG_INSTALL
   36 
   37 # Fortran libraries are (probably) required for BLAS and LAPACK:
   38 AC_F77_LIBRARY_LDFLAGS
   39 AC_F77_DUMMY_MAIN
   40 AC_F77_WRAPPERS
   41 
   42 # Add lots of compiler warnings to check for if we are using gcc:
   43 # (The variable $GCC is set to "yes" by AC_PROG_CC if we are using gcc.)
   44 if test "$GCC" = "yes" && test "$USE_MAINTAINER_MODE" = yes; then
   45 	CFLAGS="$CFLAGS -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic"
   46 fi
   47 
   48 # Checks for header files.
   49 AC_CHECK_HEADERS(unistd.h getopt.h)
   50 
   51 ###########################################################################
   52 
   53 AC_ARG_WITH(cxx, [  --with-cxx=<dir>        force use of C++ and complex<double>], with_cxx=$withval, with_cxx=no)
   54 
   55 if test "x$with_cxx" = "xno"; then
   56 
   57 AC_PROG_CC
   58 
   59 have_c_complex=yes
   60 AC_CHECK_HEADERS(complex.h)
   61 AC_CACHE_CHECK([for C complex keyword], acx_cv_c_complex,
   62  [acx_cv_c_complex=unsupported
   63   for acx_kw in complex _Complex __complex__; do
   64     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex.h>]], [[float $acx_kw foo;]])],[acx_cv_c_complex=$acx_kw; break],[])
   65   done
   66  ])
   67 
   68 if test "$acx_cv_c_complex" = "unsupported"; then
   69    AC_MSG_WARN([C doesn't support complex numbers; switching to C++.])
   70    have_c_complex=no
   71 else
   72    if test "$acx_cv_c_complex" != "complex"; then
   73      AC_DEFINE_UNQUOTED(complex, $acx_cv_c_complex, [Define to equivalent of C99 complex keyword.  Do not define if complex is supported directly.])
   74    fi
   75 
   76   AC_CACHE_CHECK([for C complex I constant], acx_cv_c_complex_I,
   77    [acx_cv_c_complex_I=unsupported
   78    for acx_kw in I "(1.0i)"; do
   79      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex.h>]], [[float $acx_cv_c_complex foo = $acx_kw;]])],[acx_cv_c_complex_I=$acx_kw; break],[])
   80    done
   81   ])
   82 
   83   if test "$acx_cv_c_complex_I" = "unsupported"; then
   84      AC_MSG_ERROR([C doesn't support complex numbers.])
   85      have_c_complex=no
   86   else
   87      if test "$acx_cv_c_complex_I" != "I"; then
   88        AC_DEFINE_UNQUOTED(I, $acx_cv_c_complex_I, [Define to equivalent of C99 complex I constant.  Do not define if I is supported directly.])
   89      fi
   90   fi
   91 
   92   AC_CACHE_CHECK([for CX_LIMITED_RANGE_ON macro], acx_cv_c_cx_limited_range_on,
   93    [acx_cv_c_cx_limited_range_on=no
   94     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex.h>]], [[CX_LIMITED_RANGE_ON;]])],[acx_cv_c_cx_limited_range_on=yes],[])])
   95   if test "$acx_cv_c_cx_limited_range_on" = "no"; then
   96      AC_DEFINE(CX_LIMITED_RANGE_ON, 0, [Define to no-op if C99 macro is not available.])
   97   fi
   98 
   99 fi # C has complex keyword
  100 
  101 fi # $with_cxx = no
  102 
  103 if test "$have_c_complex" = "yes"; then
  104 	AC_CHECK_FUNCS(carg)
  105 fi
  106 
  107 ###########################################################################
  108 
  109 AC_PROG_CXX
  110 if test "$with_cxx" = "yes" -o "$have_c_complex" = "no"; then
  111 	CC="$CXX"
  112 	CFLAGS="$CXXFLAGS"
  113 fi
  114 
  115 ###########################################################################
  116 
  117 AC_CHECK_TYPES([long double])
  118 
  119 ###########################################################################
  120 
  121 LT_INIT
  122 ###########################################################################
  123 
  124 AC_CHECK_LIB(m, sqrt)
  125 
  126 ###########################################################################
  127 
  128 # Checks for BLAS/LAPACK libraries:
  129 
  130 AX_BLAS([], [AC_MSG_ERROR([BLAS library not found])])
  131 AX_LAPACK([], [AC_MSG_ERROR([LAPACK library not found])])
  132 
  133 LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
  134 
  135 ###########################################################################
  136 
  137 AC_CONFIG_FILES([Makefile harminv.pc])
  138 AC_OUTPUT