From c597c46ae4ab72205cb1fe3f6592e52c1f3c7c5a Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 10 Dec 2001 13:37:44 -0500 Subject: [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 --- c++/configure | 78 ++++++++++++++++++++++++++++++-------------------------- 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 -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 < +#else #include +#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 <&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 <&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 < + +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 +#else +#include +#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 - -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) { -- cgit v0.12