From: Alexei Sheplyakov Date: Sat, 6 Sep 2008 04:51:19 +0000 (+0400) Subject: build: faster check for standard C++ headers. X-Git-Tag: release_1-4-4~14 X-Git-Url: https://ginac.de/ginac.git/tutorial/ginac.git?a=commitdiff_plain;h=b07d01d93adea20c4289c295a4b25141bc98c076;p=ginac.git build: faster check for standard C++ headers. Include them all into a test program and check if it compiles (in order to reduce the run time of the `configure' script). --- diff --git a/acinclude.m4 b/acinclude.m4 index 9645620e..886e7f2b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -4,6 +4,33 @@ dnl additions' names with AC_ but with GINAC_ in order to steer clear of dnl future trouble. dnl =========================================================================== +dnl Usage: GINAC_STD_CXX_HEADERS +dnl Check for standard C++ headers, bail out if something is missing. +AC_DEFUN([GINAC_STD_CXX_HEADERS], [ +AC_CACHE_CHECK([for standard C++ header files], [ginac_cv_std_cxx_headers], [ + ginac_cv_std_cxx_headers="no" + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + ]])], [ginac_cv_std_cxx_headers="yes"]) + AC_LANG_POP([C++])]) +if test "${ginac_cv_std_cxx_headers}" != "yes"; then + AC_MSG_ERROR([Standard ISO C++ 98 headers are missing]) +fi +]) + dnl Usage: GINAC_LIBREADLINE dnl dnl Check if GNU readline library and headers are avialable. diff --git a/configure.ac b/configure.ac index bc93f55a..9c2fc1b6 100644 --- a/configure.ac +++ b/configure.ac @@ -82,27 +82,14 @@ AC_CHECK_SIZEOF(void *) dnl Switch to C++ language mode for the following libraries and headers. AC_LANG([C++]) +dnl Make sure all the necessary standard headers are installed on the system. +GINAC_STD_CXX_HEADERS + dnl Check for stuff needed for building the GiNaC interactive shell (ginsh). AC_CHECK_HEADERS(unistd.h) GINAC_HAVE_RUSAGE GINAC_READLINE -dnl Make sure all the necessary standard headers are installed on the system. -AC_CHECK_HEADER(iosfwd, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(iostream, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(vector, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(list, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(map, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(string, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(sstream, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(typeinfo, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(stdexcept, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(algorithm, , GINAC_ERROR([The standard header file could not be found.])) -AC_CHECK_HEADER(limits, , GINAC_ERROR([The standard header file could not be found.])) -if test "x$CONFIG_RUSAGE" = "xno"; then - AC_CHECK_HEADER(ctime, , GINAC_ERROR([The standard header file could not be found.])) -fi - DL_LIBS="" dnl Check for dl library (needed for GiNaC::compile). AC_CHECK_LIB(dl, dlopen,