File: configure.ac

package info (click to toggle)
harminv 1.3.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,544 kB
  • ctags: 173
  • sloc: sh: 8,530; ansic: 1,256; makefile: 80
file content (135 lines) | stat: -rw-r--r-- 4,495 bytes parent folder | download | duplicates (5)
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
# Process this file with autoconf to produce a configure script.
AC_INIT(harminv, 1.3.1, stevenj@alum.mit.edu)
AM_INIT_AUTOMAKE(1.6)
AC_CONFIG_SRCDIR(harminv.c)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

# Shared-library version number; indicates api compatibility, and is
# *not* the same as the "public" version number.  CURRENT:REVISION:AGE
SHARED_VERSION_INFO="2:4:0"
AC_SUBST(SHARED_VERSION_INFO)
AM_ENABLE_SHARED(no) dnl shared libs cause too many headaches to be default

##############################################################################

AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug,compile for debugging])],
	      enable_debug=$enableval, enable_debug=no)
if test "$enable_debug" = "yes"; then
	CFLAGS="-g"
	CXXFLAGS="-g"
	FFLAGS="-g"
	AC_DEFINE(DEBUG,1,[define to enable debugging code])
fi

##############################################################################

# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL

# Fortran libraries are (probably) required for BLAS and LAPACK:
AC_F77_LIBRARY_LDFLAGS
AC_F77_DUMMY_MAIN
AC_F77_WRAPPERS

# Add lots of compiler warnings to check for if we are using gcc:
# (The variable $GCC is set to "yes" by AC_PROG_CC if we are using gcc.)
if test "$GCC" = "yes" && test "$USE_MAINTAINER_MODE" = yes; then
	CFLAGS="$CFLAGS -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic"
fi

# Checks for header files.
AC_CHECK_HEADERS(unistd.h getopt.h)

###########################################################################

AC_ARG_WITH(cxx, [  --with-cxx=<dir>        force use of C++ and complex<double>], with_cxx=$withval, with_cxx=no)

if test "x$with_cxx" = "xno"; then

have_c_complex=yes
AC_CHECK_HEADERS(complex.h)
AC_CACHE_CHECK([for C complex keyword], acx_cv_c_complex,
 [acx_cv_c_complex=unsupported
  for acx_kw in complex _Complex __complex__; do
    AC_TRY_COMPILE([#include <complex.h>], [float $acx_kw foo;],
                   [acx_cv_c_complex=$acx_kw; break])
  done
 ])

if test "$acx_cv_c_complex" = "unsupported"; then
   AC_MSG_WARN([C doesn't support complex numbers; switching to C++.])
   have_c_complex=no
else
   if test "$acx_cv_c_complex" != "complex"; then
     AC_DEFINE_UNQUOTED(complex, $acx_cv_c_complex, [Define to equivalent of C99 complex keyword.  Do not define if complex is supported directly.])
   fi

  AC_CACHE_CHECK([for C complex I constant], acx_cv_c_complex_I,
   [acx_cv_c_complex_I=unsupported
   for acx_kw in I "(1.0i)"; do
     AC_TRY_COMPILE([#include <complex.h>],
                    [float $acx_cv_c_complex foo = $acx_kw;],
                    [acx_cv_c_complex_I=$acx_kw; break])
   done
  ])

  if test "$acx_cv_c_complex_I" = "unsupported"; then
     AC_MSG_ERROR([C doesn't support complex numbers.])
     have_c_complex=no
  else
     if test "$acx_cv_c_complex_I" != "I"; then
       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.])
     fi
  fi

  AC_CACHE_CHECK([for CX_LIMITED_RANGE_ON macro], acx_cv_c_cx_limited_range_on,
   [acx_cv_c_cx_limited_range_on=no
    AC_TRY_COMPILE([#include <complex.h>],
                   [CX_LIMITED_RANGE_ON;], [acx_cv_c_cx_limited_range_on=yes])])
  if test "$acx_cv_c_cx_limited_range_on" = "no"; then
     AC_DEFINE(CX_LIMITED_RANGE_ON, 0, [Define to no-op if C99 macro is not available.])
  fi

fi # C has complex keyword

fi # $with_cxx = no

if test "$have_c_complex" = "yes"; then
	AC_CHECK_FUNCS(carg)
fi

###########################################################################

AC_PROG_CXX
if test "$with_cxx" = "yes" -o "$have_c_complex" = "no"; then
	CC="$CXX"
	CFLAGS="$CXXFLAGS"
fi

###########################################################################

AC_CHECK_TYPES([long double])

###########################################################################

AC_PROG_LIBTOOL                                                                                
###########################################################################

AC_CHECK_LIB(m, sqrt)

###########################################################################

# Checks for BLAS/LAPACK libraries:

ACX_BLAS([], [AC_MSG_ERROR([BLAS library not found])])
ACX_LAPACK([], [AC_MSG_ERROR([LAPACK library not found])])

LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"

###########################################################################

AC_CONFIG_FILES([Makefile harminv.pc])
AC_OUTPUT