diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-05-12 10:31:27 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-05-12 10:31:27 +0000 |
commit | b7d3f2b9e7597a728a317b98d205be822ce5304a (patch) | |
tree | 87c93afe53d11ecd898d05ae3c4fd55edadf9f8b | |
parent | 175188cc458279a9080b0a99c1b5e1c448105ef2 (diff) |
Check, using C++, for the presence of vector and vector.h . This should
help routines using the C++ STL to include the appropriate headers.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1651 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | lib/make/cctk_Config.h.in | 5 | ||||
-rwxr-xr-x | lib/make/configure | 57 | ||||
-rw-r--r-- | lib/make/configure.in | 7 |
3 files changed, 69 insertions, 0 deletions
diff --git a/lib/make/cctk_Config.h.in b/lib/make/cctk_Config.h.in index 42d9dd6a..27570447 100644 --- a/lib/make/cctk_Config.h.in +++ b/lib/make/cctk_Config.h.in @@ -89,6 +89,11 @@ #undef HAVE_UNISTD_H #undef HAVE_STRING_H +/* Which format does the C++ STL on this machine provide. */ + +#undef HAVE_VECTOR +#undef HAVE_VECTOR_H + /* Timing stuff */ #undef HAVE_TIME_GETTIMEOFDAY diff --git a/lib/make/configure b/lib/make/configure index 96359a32..ca92a4b7 100755 --- a/lib/make/configure +++ b/lib/make/configure @@ -2959,6 +2959,63 @@ EOF fi +# C++ STL stuff + + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +for cctk_hdr in vector vector.h +do +cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 +echo "configure:2977: checking for $cctk_hdr" >&5 +if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2982 "configure" +#include "confdefs.h" +#include <$cctk_hdr> +int main() { +return 0; +; return 0; } +EOF +if { (eval echo configure:2989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "cctk_cv_header_$cctk_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "cctk_cv_header_$cctk_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $cctk_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + diff --git a/lib/make/configure.in b/lib/make/configure.in index e2613952..61b806c7 100644 --- a/lib/make/configure.in +++ b/lib/make/configure.in @@ -296,6 +296,13 @@ CCTK_CHECK_HEADERS(string.h) AC_HEADER_TIME +# C++ STL stuff + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +CCTK_CHECK_HEADERS(vector vector.h) +AC_LANG_RESTORE + dnl Misc stuff AC_SUBST(LIBDIRS) |