summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-08-03 21:04:29 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-08-03 21:04:29 (GMT)
commitff5070329c34c74082570c925e2a2b9089b99b29 (patch)
tree5337fe5780e5afed0c9431969972ab2126d586c1 /configure.ac
parentb94c3d53d2354f7e4552a72b1d82b57ec40fd93e (diff)
downloadhdf5-ff5070329c34c74082570c925e2a2b9089b99b29.zip
hdf5-ff5070329c34c74082570c925e2a2b9089b99b29.tar.gz
hdf5-ff5070329c34c74082570c925e2a2b9089b99b29.tar.bz2
[svn-r27457] Merge of r27278 from trunk. Fixes HDFFV-9119 and HDFFV-9421.
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: h5committest
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 5d43f9c..c9d3f1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1632,7 +1632,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],
@@ -3106,16 +3126,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.