summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-06-22 19:21:55 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-06-22 19:21:55 (GMT)
commit37b14fd3ed8aae8f3b83df03ca29f82178c25f8f (patch)
tree8bcc201f228db1b9260570822f39699063bc7e37 /configure.ac
parentfb27787c2abb889a2184bb39eead626a144117d0 (diff)
downloadhdf5-37b14fd3ed8aae8f3b83df03ca29f82178c25f8f.zip
hdf5-37b14fd3ed8aae8f3b83df03ca29f82178c25f8f.tar.gz
hdf5-37b14fd3ed8aae8f3b83df03ca29f82178c25f8f.tar.bz2
[svn-r27270] Changes that allow the autotools to correctly deal with inline
functions. - Inline markup schemes are now checked with AC_COMPILE_IFELSE tests instead of AC_C_INLINE. - The inline designator is now H5_INLINE instead of H5_inline. This is now set in H5private.h instead of H5pubconf.h. Tested on 64-bit linux VM
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 21 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 211ce44..274ea43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1675,7 +1675,27 @@ AC_CHECK_FUNCS([tmpfile asprintf vasprintf vsnprintf waitpid])
## Check compiler characteristics
##
AC_C_CONST
-AC_C_INLINE
+
+AC_MSG_CHECKING([if the compiler understands __inline__])
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[static __inline__ void f(void){return;};]])],
+ [AC_DEFINE([HAVE___INLINE__], [1], [Define if the compiler understands __inline__]) AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+)
+
+AC_MSG_CHECKING([if the compiler understands __inline])
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[static __inline void f(void){return;};]])],
+ [AC_DEFINE([HAVE___INLINE], [1], [Define if the compiler understands __inline]) AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+)
+
+AC_MSG_CHECKING([if the compiler understands inline])
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[static inline void f(void){return;};]])],
+ [AC_DEFINE([HAVE_INLINE], [1], [Define if the compiler understands inline]) AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+)
AC_MSG_CHECKING([for __attribute__ extension])
AC_TRY_COMPILE(,[int __attribute__((unused)) x],
@@ -2887,16 +2907,6 @@ if test "X$HDF_CXX" = "Xyes"; then
chmod 755 c++/src/h5c++
fi
-## We don't want inline defined for C++ compilers
-## Don't worry about the C++ ifdef wrappers in the H5pubconf file, since
-## 'H5_inline' isn't a C++ keyword.
-cat >> src/H5config.h <<EOF
-
-#if defined(__cplusplus) && defined(inline)
-#undef inline
-#endif
-EOF
-
## HDF5 configure code created by autotools with gcc 4.9.2 is adding problematic
## linker flags: -l with no library name; -l <libname>, specifically gfortran or m.
## This sed script corrects "-l <libname>" first and then "-l " with no library name.