diff options
author | Bill Wendling <wendling@ncsa.uiuc.edu> | 2001-12-10 18:37:44 (GMT) |
---|---|---|
committer | Bill Wendling <wendling@ncsa.uiuc.edu> | 2001-12-10 18:37:44 (GMT) |
commit | c597c46ae4ab72205cb1fe3f6592e52c1f3c7c5a (patch) | |
tree | 5cca243fe637fea263986296db4b25ff121d9868 /c++ | |
parent | 692896a9e73ecff9e77ab5487335d879c7551a91 (diff) | |
download | hdf5-c597c46ae4ab72205cb1fe3f6592e52c1f3c7c5a.zip hdf5-c597c46ae4ab72205cb1fe3f6592e52c1f3c7c5a.tar.gz hdf5-c597c46ae4ab72205cb1fe3f6592e52c1f3c7c5a.tar.bz2 |
[svn-r4688]
Purpose:
Bug Fix
Description & Solution:
In the test for "namespace", we needed to include the "iostream"
header file to remove errors for strict compilers who need iostream
for namespaces. I moved the test for namespace to after the test for
"old header filenames" to make sure that I'm #including the correct
iostream ("iostream" or "iostream.h").
Platforms tested:
Linux
Diffstat (limited to 'c++')
-rwxr-xr-x | c++/configure | 78 | ||||
-rw-r--r-- | c++/configure.in | 35 |
2 files changed, 63 insertions, 50 deletions
diff --git a/c++/configure b/c++/configure index cc7545c..976ca4f 100755 --- a/c++/configure +++ b/c++/configure @@ -1894,8 +1894,8 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking if $CXX can handle namespaces""... $ac_c" 1>&6 -echo "configure:1899: checking if $CXX can handle namespaces" >&5 +echo $ac_n "checking if $CXX needs old style header files in includes""... $ac_c" 1>&6 +echo "configure:1899: checking if $CXX needs old style header files in includes" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else @@ -1903,69 +1903,75 @@ else #line 1904 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int); +extern "C" void exit(int) throw(); #endif -using namespace std; - -namespace H5 { -int fnord; -} +#include <iostream> -int main(void) { - using namespace H5; - fnord = 37; - return 0; -} +int main(void) { return 0; } EOF -if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then - echo yes + echo no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - echo no - CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" + echo yes + CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" fi rm -fr conftest* fi -echo $ac_n "checking if $CXX needs old style header files in includes""... $ac_c" 1>&6 -echo "configure:1942: checking if $CXX needs old style header files in includes" >&5 +echo $ac_n "checking if $CXX can handle namespaces""... $ac_c" 1>&6 +echo "configure:1934: checking if $CXX can handle namespaces" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1947 "configure" +#line 1939 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int); +extern "C" void exit(int) throw(); #endif +#ifdef OLD_HEADER_FILENAME +#include <iostream.h> +#else #include <iostream> +#endif -int main(void) { return 0; } +using namespace std; + +namespace H5 { +int fnord; +} + +int main(void) { + using namespace H5; + fnord = 37; + return 0; +} EOF -if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then - echo no + echo yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - echo yes - CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" + echo no + CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" fi rm -fr conftest* @@ -1973,15 +1979,15 @@ fi echo $ac_n "checking if $CXX supports bool types""... $ac_c" 1>&6 -echo "configure:1977: checking if $CXX supports bool types" >&5 +echo "configure:1983: checking if $CXX supports bool types" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1982 "configure" +#line 1988 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int); +extern "C" void exit(int) throw(); #endif int main(void) { @@ -1990,7 +1996,7 @@ int main(void) { } EOF -if { (eval echo configure:1994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo yes @@ -2009,15 +2015,15 @@ fi echo $ac_n "checking if $CXX can handle static cast""... $ac_c" 1>&6 -echo "configure:2013: checking if $CXX can handle static cast" >&5 +echo "configure:2019: checking if $CXX can handle static cast" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 2018 "configure" +#line 2024 "configure" #include "confdefs.h" #ifdef __cplusplus -extern "C" void exit(int); +extern "C" void exit(int) throw(); #endif int main(void) { @@ -2029,7 +2035,7 @@ int main(void) { } EOF -if { (eval echo configure:2033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo yes @@ -2097,7 +2103,7 @@ rm -f confcache echo $ac_n "checking make""... $ac_c" 1>&6 -echo "configure:2101: checking make" >&5 +echo "configure:2107: checking make" >&5 if test "`${MAKE-make} --version -f /dev/null 2>/dev/null |\ sed -n 1p|cut -c1-8`" = "GNU Make"; then @@ -2114,7 +2120,7 @@ fi if test -z "$DEPEND"; then echo $ac_n "checking how to include a makefile""... $ac_c" 1>&6 -echo "configure:2118: checking how to include a makefile" >&5 +echo "configure:2124: checking how to include a makefile" >&5 cat >makeinc <<EOF foo: diff --git a/c++/configure.in b/c++/configure.in index f4bba77..f44afdc 100644 --- a/c++/configure.in +++ b/c++/configure.in @@ -1,8 +1,9 @@ dnl ---------------------------------------------------------------------- dnl Process this file with autoconf to produce configure. dnl -dnl Copyright (C) 2000 National Center for Supercomputing Applications. -dnl All rights reserved. +dnl Copyright (C) 2000, 2001 +dnl National Center for Supercomputing Applications. +dnl All rights reserved. dnl ---------------------------------------------------------------------- dnl ---------------------------------------------------------------------- @@ -268,8 +269,26 @@ dnl Checks for compiler characteristics. dnl AC_LANG_CPLUSPLUS +AC_MSG_CHECKING(if $CXX needs old style header files in includes) +AC_TRY_RUN([ +#include <iostream> + +int main(void) { return 0; } +], [ + echo no +], [ + echo yes + CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" +]) + AC_MSG_CHECKING(if $CXX can handle namespaces) AC_TRY_RUN([ +#ifdef OLD_HEADER_FILENAME +#include <iostream.h> +#else +#include <iostream> +#endif + using namespace std; namespace H5 { @@ -288,18 +307,6 @@ int main(void) { CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" ]) -AC_MSG_CHECKING(if $CXX needs old style header files in includes) -AC_TRY_RUN([ -#include <iostream> - -int main(void) { return 0; } -], [ - echo no -], [ - echo yes - CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" -]) - AC_MSG_CHECKING(if $CXX supports bool types) AC_TRY_RUN([ int main(void) { |