Skip to content

Commit

Permalink
update autoconf
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jun 14, 2021
1 parent 80c30df commit f82ca9e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
22 changes: 9 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Process this file with autoconf to produce a configure script.

# note: keep version number in sync with harminv.h
AC_INIT(harminv, 1.4.1, [email protected])
AC_INIT([harminv],[1.4.1],[[email protected]])

AM_INIT_AUTOMAKE([foreign silent-rules 1.11])
AM_SILENT_RULES(yes)
AC_CONFIG_SRCDIR(harminv.c)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE

# Shared-library version number; indicates api compatibility, and is
# *not* the same as the "human" version number. CURRENT:REVISION:AGE
SHARED_VERSION_INFO="3:0:0"
AC_SUBST(SHARED_VERSION_INFO)
AM_ENABLE_SHARED(no) dnl shared libs cause too many headaches to be default
AC_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])],
AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug,compile for debugging])],
enable_debug=$enableval, enable_debug=no)
if test "$enable_debug" = "yes"; then
CFLAGS="-g"
Expand Down Expand Up @@ -54,15 +54,14 @@ AC_ARG_WITH(cxx, [ --with-cxx=<dir> force use of C++ and complex<double>

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

AC_PROG_CC_C99
AC_PROG_CC

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])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <complex.h>]], [[float $acx_kw foo;]])],[acx_cv_c_complex=$acx_kw; break],[])
done
])

Expand All @@ -77,9 +76,7 @@ else
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])
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],[])
done
])

Expand All @@ -94,8 +91,7 @@ else

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])])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#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
Expand All @@ -122,7 +118,7 @@ AC_CHECK_TYPES([long double])

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

AC_PROG_LIBTOOL
LT_INIT
###########################################################################

AC_CHECK_LIB(m, sqrt)
Expand Down
19 changes: 11 additions & 8 deletions m4/ax_blas.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_blas.html
# https://www.gnu.org/software/autoconf-archive/ax_blas.html
# ===========================================================================
#
# SYNOPSIS
Expand Down Expand Up @@ -36,6 +36,7 @@
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <[email protected]>
# Copyright (c) 2019 Geoffrey M. Oxberry <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
Expand All @@ -48,7 +49,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
Expand All @@ -63,11 +64,11 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 14
#serial 17

AU_ALIAS([ACX_BLAS], [AX_BLAS])
AC_DEFUN([AX_BLAS], [
AC_PREREQ(2.50)
AC_PREREQ([2.55])
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
AC_REQUIRE([AC_CANONICAL_HOST])
ax_blas_ok=no
Expand All @@ -77,7 +78,9 @@ AC_ARG_WITH(blas,
case $with_blas in
yes | "") ;;
no) ax_blas_ok=disable ;;
-* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
-* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o)
BLAS_LIBS="$with_blas"
;;
*) BLAS_LIBS="-l$with_blas" ;;
esac
Expand All @@ -93,7 +96,7 @@ if test $ax_blas_ok = no; then
if test "x$BLAS_LIBS" != x; then
save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS])
AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes], [BLAS_LIBS=""])
AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes], [BLAS_LIBS=""])
AC_MSG_RESULT($ax_blas_ok)
LIBS="$save_LIBS"
fi
Expand All @@ -103,7 +106,7 @@ fi
if test $ax_blas_ok = no; then
save_LIBS="$LIBS"; LIBS="$LIBS"
AC_MSG_CHECKING([if $sgemm is being linked in already])
AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes])
AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes])
AC_MSG_RESULT($ax_blas_ok)
LIBS="$save_LIBS"
fi
Expand Down Expand Up @@ -174,7 +177,7 @@ fi
if test $ax_blas_ok = no; then
save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
AC_MSG_CHECKING([for $sgemm in -framework vecLib])
AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
AC_MSG_RESULT($ax_blas_ok)
LIBS="$save_LIBS"
fi
Expand Down
13 changes: 8 additions & 5 deletions m4/ax_lapack.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_lapack.html
# https://www.gnu.org/software/autoconf-archive/ax_lapack.html
# ===========================================================================
#
# SYNOPSIS
Expand Down Expand Up @@ -37,6 +37,7 @@
# LICENSE
#
# Copyright (c) 2009 Steven G. Johnson <[email protected]>
# Copyright (c) 2019 Geoffrey M. Oxberry <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
Expand All @@ -49,7 +50,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
Expand All @@ -64,7 +65,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 7
#serial 10

AU_ALIAS([ACX_LAPACK], [AX_LAPACK])
AC_DEFUN([AX_LAPACK], [
Expand All @@ -76,7 +77,9 @@ AC_ARG_WITH(lapack,
case $with_lapack in
yes | "") ;;
no) ax_lapack_ok=disable ;;
-* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;;
-* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o)
LAPACK_LIBS="$with_lapack"
;;
*) LAPACK_LIBS="-l$with_lapack" ;;
esac
Expand All @@ -93,7 +96,7 @@ fi
if test "x$LAPACK_LIBS" != x; then
save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS])
AC_TRY_LINK_FUNC($cheev, [ax_lapack_ok=yes], [LAPACK_LIBS=""])
AC_LINK_IFELSE([AC_LANG_CALL([], [$cheev])], [ax_lapack_ok=yes], [LAPACK_LIBS=""])
AC_MSG_RESULT($ax_lapack_ok)
LIBS="$save_LIBS"
if test $ax_lapack_ok = no; then
Expand Down

0 comments on commit f82ca9e

Please sign in to comment.