Commit a86a55dd authored by Karl Wette's avatar Karl Wette
Browse files

Check for a C++ compiler only if required

- refs #40
Original: dda377e0f2acb5a76fe6a5ca7129873316d7e1a7
parent ca1a9544
# lalsuite_build.m4 - top level build macros
#
# serial 34
# serial 35
AC_DEFUN([LALSUITE_REQUIRE_CXX],[
# require a C++ compiler
lalsuite_require_cxx=true
])
# because we want to decide whether to run AC_PROG_CXX/AC_PROG_CXXCPP
# at ./configure run time, we must erase the following macros, which
# (in autoconf 2.64 and later) require AC_PROG_CXX/AC_PROG_CXXCPP to
# be AC_REQUIRE'd at ./configure build time, regardless of whether
# they're needed or not (which is only decided later at run time).
m4_defun([AC_LANG_COMPILER(C++)],[])
m4_defun([AC_LANG_PREPROC(C++)],[])
AC_DEFUN([LALSUITE_PROG_CC_CXX],[
# check for C99 compiler
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CC_C99])
AC_REQUIRE([AC_PROG_CPP])
# check for C++ compiler, if needed
AS_IF([test "${lalsuite_require_cxx}" = true],[
AC_PROG_CXX
AC_PROG_CXXCPP
],[
CXX=
CXXCPP=
AM_CONDITIONAL([am__fastdepCXX],[test 1 == 0])
])
# check complex numbers
LALSUITE_CHECK_C99_COMPLEX_NUMBERS
AS_IF([test "${lalsuite_require_cxx}" = true],[
LALSUITE_CHECK_CXX_COMPLEX_NUMBERS
])
])
AC_DEFUN([LALSUITE_USE_LIBTOOL],
[## $0: Generate a libtool script for use in configure tests
AC_PROVIDE_IFELSE([LT_INIT], ,
[m4_fatal([$0: requires libtool])])[]dnl
AC_REQUIRE([LT_INIT])
LT_OUTPUT
m4_append([AC_LANG(C)],
[ac_link="./libtool --mode=link --tag=CC $ac_link"
......@@ -355,7 +388,8 @@ AC_DEFUN([LALSUITE_ENABLE_BOINC],
*) AC_MSG_ERROR(bad value ${enableval} for --enable-boinc);;
esac
], [ boinc=false ] )
AC_ARG_VAR([BOINC_PREFIX],[BOINC installation directory (optional)])
AS_IF([test "${boinc}" = true],[LALSUITE_REQUIRE_CXX])
AC_ARG_VAR([BOINC_PREFIX],[BOINC installation directory (optional)])
])
AC_DEFUN([LALSUITE_CHECK_BOINC],
......@@ -412,6 +446,7 @@ AC_DEFUN([LALSUITE_WITH_CUDA],
;;
esac
], [ cuda=false ])
AS_IF([test "${cuda}" = true],[LALSUITE_REQUIRE_CXX])
LALSUITE_ENABLE_MODULE([CUDA],[cuda])
])
......@@ -590,14 +625,17 @@ int Function2($3 pz);
])
])
AC_DEFUN([LALSUITE_CHECK_COMPLEX_NUMBER_TYPES],[
# check C99 complex number datatypes
AC_DEFUN([LALSUITE_CHECK_C99_COMPLEX_NUMBERS],[
# check C99 complex numbers
AC_LANG_PUSH([C])
AC_CHECK_HEADERS([complex.h],[],[AC_MSG_ERROR([could not find 'complex.h'])])
LALSUITE_CHECK_COMPLEX_NUMBER_MEMORY_LAYOUT([complex.h],[float],[float complex],[crealf],[cimagf])
LALSUITE_CHECK_COMPLEX_NUMBER_MEMORY_LAYOUT([complex.h],[double],[double complex],[creal],[cimag])
AC_LANG_POP([C])
# check C++ complex number datatypes
])
AC_DEFUN([LALSUITE_CHECK_CXX_COMPLEX_NUMBERS],[
# check C++ complex numbers
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([complex],[],[AC_MSG_ERROR([could not find 'complex'])])
LALSUITE_CHECK_COMPLEX_NUMBER_MEMORY_LAYOUT([complex],[float],[std::complex<float>],[real],[imag])
......
# SWIG configuration
# Author: Karl Wette, 2011
#
# serial 12
# serial 13
# basic version string comparison
# can only handle numeric versions separated by periods
......@@ -16,6 +16,16 @@ AC_DEFUN([LALSUITE_VERSION_COMPARE],[
AS_IF([test ${vcmp_v1} -gt ${vcmp_v2}],[$5])
])
# workaround to check whether SWIG modules are going to be
# built (and therefore a C++ compiler is required) before
# calling LALSUITE_PROG_CC_CXX, since LALSUITE_ENABLE_SWIG
# must appear after LALSUITE_PROG_CC_CXX. to be fixed!
AC_DEFUN([LALSUITE_SWIG_REQUIRE_CXX],[
AS_IF([test "${enable_swig}" = yes],[LALSUITE_REQUIRE_CXX])
AS_IF([test "${enable_swig_octave}" = yes],[LALSUITE_REQUIRE_CXX])
AS_IF([test "${enable_swig_python}" = yes],[LALSUITE_REQUIRE_CXX])
])
# SWIG setup and configuration
AC_DEFUN([LALSUITE_ENABLE_SWIG],[
......
......@@ -160,6 +160,8 @@ LAL_ENABLE_MACROS
LAL_ENABLE_PTHREAD_LOCK
LALSUITE_ENABLE_NIGHTLY
LALSUITE_SWIG_REQUIRE_CXX
# get version
lal_version_major=`echo "$VERSION" | cut -d. -f1`
lal_version_minor=`echo "$VERSION" | cut -d. -f2`
......@@ -178,6 +180,15 @@ AC_DEFINE_UNQUOTED([LAL_CONFIGURE_DATE],["$lal_configure_date"],[LAL Configure D
test "$prefix"="NONE" && lal_prefix="$ac_default_prefix" || lal_prefix="$prefix"
AC_DEFINE_UNQUOTED([LAL_PREFIX],["$lal_prefix"],[LAL Install Prefix])
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# use silent build rules
AM_SILENT_RULES([yes])
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# check for pthreads
lal_pthread_available="yes"
AX_PTHREAD(,[lal_pthread_available="no"])
......@@ -191,25 +202,11 @@ if test "$lal_pthread_lock" = "true" ; then
fi
fi
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
AC_CHECK_PROGS([M4],[gm4 m4], m4)
AC_CHECK_PROGS([LATEX],[pdflatex latex],[echo])
......@@ -222,9 +219,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for support tex flags
if test -z "$TEXFLAGS"
then
......
......@@ -131,11 +131,11 @@ fi
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# check for MPI compiler
if test "x$mpi" = "xtrue"; then
......@@ -143,11 +143,7 @@ if test "x$mpi" = "xtrue"; then
fi
LALSUITE_ENABLE_MODULE([MPI],[mpi])
# use silent build rules
AM_SILENT_RULES([yes])
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
......@@ -188,9 +184,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for system libraries
AC_CHECK_LIB([m],[sin])
AC_CHECK_LIB([z],[compress])
......
......@@ -75,22 +75,17 @@ AC_DEFINE_UNQUOTED([LALBURST_CONFIGURE_DATE],["$lalburst_configure_date"],
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
# check for supported mac os x version
......@@ -99,9 +94,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -56,6 +56,8 @@ LALFRAME_ENABLE_INOTIFY
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS
LALSUITE_SWIG_REQUIRE_CXX
# put version/configure info in config header
lalframe_version_major=`echo "$VERSION" | cut -d. -f1`
lalframe_version_minor=`echo "$VERSION" | cut -d. -f2`
......@@ -81,22 +83,17 @@ AC_DEFINE_UNQUOTED([LALFRAME_CONFIGURE_DATE],["$lalframe_configure_date"],
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
AC_CHECK_PROGS([M4],[gm4 m4],[m4])
......@@ -106,9 +103,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -82,22 +82,17 @@ AC_DEFINE_UNQUOTED([LALINFERENCE_CONFIGURE_DATE],["$lalinspiral_configure_date"]
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
# check for supported mac os x version
......@@ -106,9 +101,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -81,25 +81,17 @@ AC_DEFINE_UNQUOTED([LALINSPIRAL_CONFIGURE_DATE],["$lalinspiral_configure_date"],
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# CUDA requires a c++ compiler
AC_PROG_CXX
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
# check for supported mac os x version
......@@ -108,9 +100,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -74,22 +74,17 @@ AC_DEFINE_UNQUOTED([LALMETAIO_CONFIGURE_DATE],["$lalmetaio_configure_date"],
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
# check for supported mac os x version
......@@ -98,9 +93,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -59,6 +59,8 @@ LALSUITE_ENABLE_BOINC
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS
LALSUITE_SWIG_REQUIRE_CXX
# put version/configure info in config header
lalpulsar_version_major=`echo "$VERSION" | cut -d. -f1`
lalpulsar_version_minor=`echo "$VERSION" | cut -d. -f2`
......@@ -84,22 +86,17 @@ AC_DEFINE_UNQUOTED([LALPULSAR_CONFIGURE_DATE],["$lalpulsar_configure_date"],
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
# check for supported mac os x version
......@@ -108,9 +105,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -53,6 +53,8 @@ LALSUITE_ENABLE_DEBUG
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS
LALSUITE_SWIG_REQUIRE_CXX
# put version/configure info in config header
lalsimulation_version_major=`echo "$VERSION" | cut -d. -f1`
lalsimulation_version_minor=`echo "$VERSION" | cut -d. -f2`
......@@ -78,22 +80,17 @@ AC_DEFINE_UNQUOTED([LALSIMULATION_CONFIGURE_DATE],["$lalsimulation_configure_dat
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
AC_CHECK_PROGS([M4],[gm4 m4],[m4])
......@@ -103,9 +100,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -75,22 +75,17 @@ LALSUITE_ENABLE_GCC_FLAGS
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
# check for supported mac os x version
......@@ -99,9 +94,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
......@@ -50,6 +50,8 @@ LALSUITE_ENABLE_NIGHTLY
# debug
LALSUITE_ENABLE_DEBUG
LALSUITE_SWIG_REQUIRE_CXX
# put version/configure info in config header
lalxml_version_major=`echo "$VERSION" | cut -d. -f1`
lalxml_version_minor=`echo "$VERSION" | cut -d. -f2`
......@@ -78,22 +80,17 @@ LALSUITE_ENABLE_GCC_FLAGS
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK
# check for c compiler
AC_PROG_CC_C99
# use silent build rules
AM_SILENT_RULES([yes])
# check for c++ compiler
AC_PROG_CXX
# check for C/C++ compilers
LALSUITE_PROG_CC_CXX
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_SED
LT_INIT
AM_PATH_PYTHON([2.6],,[AC_MSG_ERROR([Python-2.6, or higher, is required])])
# check for supported mac os x version
......@@ -102,9 +99,6 @@ LALSUITE_OSX_VERSION_CHECK
# link tests using libtool
LALSUITE_USE_LIBTOOL
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES
# check for header files
AC_HEADER_STDC
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment