diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2007-06-28 20:36:08 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2007-06-28 20:36:08 (GMT) |
commit | 58467956ba56fc52dd03e3540f14b062f9a6c5bb (patch) | |
tree | ddff2bedfd24083e8a180e1492fa169160104e67 /configure.in | |
parent | 10f04e651970fde07a8ac61e92359eaaad977571 (diff) | |
download | hdf5-58467956ba56fc52dd03e3540f14b062f9a6c5bb.zip hdf5-58467956ba56fc52dd03e3540f14b062f9a6c5bb.tar.gz hdf5-58467956ba56fc52dd03e3540f14b062f9a6c5bb.tar.bz2 |
[svn-r13925] Purpose: intermediate checkin for offsetof fix for PGI compiler.
Description: added new configuration to generate a pubconf file
in the c++/src directory, H5cxx_pubconf.h. When C++
compiler recognizes 'offsetof', the macro
H5_CXX_HAVE_OFFSETOF is defined in the new
pubconf file.
tested: kagiso, smirom
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/configure.in b/configure.in index 3f82020..a805593 100644 --- a/configure.in +++ b/configure.in @@ -444,6 +444,43 @@ int main(void) { CXXFLAGS="${CXXFLAGS} -DBOOL_NOTDEFINED" ]) + AC_CONFIG_HEADER([c++/src/H5cxx_config.h]) + + AC_OUTPUT_COMMANDS([ + echo "creating c++/src/H5cxx_pubconf.h" + sed 's/#define /#define H5_CXX_/' <c++/src/H5cxx_config.h |\ + sed 's/#undef /#undef H5_CXX_/' >pubconf + if test ! -f c++/src/H5cxx_pubconf.h; then + /bin/mv -f pubconf c++/src/H5cxx_pubconf.h + elif (diff pubconf c++/src/H5cxx_pubconf.h >/dev/null); then + rm -f pubconf + echo "c++/src/H5cxx_pubconf.h is unchanged" + else + /bin/mv -f pubconf c++/src/H5cxx_pubconf.h + fi + ]) + + AC_MSG_CHECKING([if $CXX has offsetof extension]) + AC_TRY_COMPILE([ + #include <stdio.h> + #include <stddef.h> + ],[ + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + ], + AC_DEFINE([HAVE_OFFSETOF], [1], + [Define if C++ compiler recognizes offsetof]) + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no])) + AC_MSG_CHECKING([if $CXX can handle static cast]) AC_TRY_RUN([ int main(void) { @@ -1932,13 +1969,6 @@ AC_TRY_COMPILE(,[(void)__FUNCTION__], AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])) -AC_MSG_CHECKING([for __offsetof__ extension]) -AC_TRY_COMPILE(,[size_t __offsetof__(unused)], - AC_DEFINE([HAVE_OFFSETOF], [1], - [Define if the __offsetof__ extension is present]) - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no])) - dnl ---------------------------------------------------------------------- dnl Try to figure out how to print `long long'. Some machines use `%lld' dnl and others use `%qd'. There may be more! The final `l' is a |