summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac186
1 files changed, 66 insertions, 120 deletions
diff --git a/configure.ac b/configure.ac
index c5e456f..eacc078 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,16 +39,17 @@ AM_INIT_AUTOMAKE([foreign])
AM_SILENT_RULES([yes])
## AM_MAINTAINER_MODE turns off "rebuild rules" that contain dependencies
-## for Makefiles, configure, src/H5config.h, etc. If AM_MAINTAINER_MODE
-## is *not* included here, these files will be rebuilt if out of date.
-## This is a problem because if users try to build on a machine with
+## for Makefiles, configure, src/H5config.h, etc. If AM_MAINTAINER_MODE
+## is enabled, these files will be rebuilt if out of date. This is a
+## problem because if users try to build on a machine with
## the wrong versions of autoconf and automake, these files will be
## rebuilt with the wrong versions and bad things can happen.
## Also, CVS doesn't preserve dependencies between timestamps, so
## Makefiles will often think rebuilding needs to occur when it doesn't.
-## Developers should './configure --enable-maintainer-mode' to turn on
-## rebuild rules.
-AM_MAINTAINER_MODE
+##
+## By default, it is enabled. Users can configure with
+## --disable-maintainer-mode to prevent running the autotools.
+AM_MAINTAINER_MODE([enable])
## ----------------------------------------------------------------------
## Set prefix default (install directory) to a directory in the build area.
@@ -587,6 +588,7 @@ AC_PROG_INSTALL
## ----------------------------------------------------------------------
## Set up ${TR} which is used to process DEBUG_PKG.
+
AC_PATH_PROG([TR], [tr])
@@ -1596,9 +1598,15 @@ AC_CACHE_SAVE
AC_MSG_CHECKING([for thread safe support])
AC_ARG_ENABLE([threadsafe],
[AS_HELP_STRING([--enable-threadsafe],
- [Enable thread-safe capability])],
+ [Enable thread-safe capability. This will disable the high-level library.
+ You can override this behavior by specifying --enable-hl and --enable-unsupported.
+ [default=no]])],
[THREADSAFE=$enableval])
+## NOTE: The high-level, C++, and Fortran interfaces are not compatible
+## with the thread-safety option because the lock is not hoisted
+## into the higher-level API calls.
+
## The --enable-threadsafe flag is not compatible with --enable-cxx.
## If the user tried to specify both flags, throw an error, unless
## they also provided the --enable-unsupported flag.
@@ -1608,7 +1616,7 @@ if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then
fi
fi
-## --enable-threadsafe is also incompatible with --enable-fortran, unless
+## --enable-threadsafe is also incompatible with --enable-fortran unless
## --enable-unsupported has been specified on the configure line.
if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then
if test "X${HDF_FORTRAN}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then
@@ -1616,6 +1624,7 @@ if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then
fi
fi
+
case "X-$THREADSAFE" in
X-|X-no)
AC_MSG_RESULT([no])
@@ -1634,32 +1643,31 @@ if test "X$THREADSAFE" = "Xyes"; then
AC_DEFINE([HAVE_THREADSAFE], [1], [Define if we have thread safe support])
## ----------------------------------------------------------------------
- ## Is the pthreads library present? It has a header file `pthread.h' and
+ ## Is the Pthreads library present? It has a header file `pthread.h' and
## a library `-lpthread' and their locations might be specified with the
## `--with-pthread' command-line switch. The value is an include path
## and/or a library path. If the library path is specified then it must
## be preceded by a comma.
##
## Thread-safety in HDF5 only uses Pthreads via configure, so the
- ## default is "yes", though this only has an effect when
+ ## default is "check", though this only has an effect when
## --enable-threadsafe is specified.
AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes
AC_ARG_WITH([pthread],
[AS_HELP_STRING([--with-pthread=DIR],
- [Specify alternative path to Pthreads library when thread-safe capability is built])],,
- [withval=yes])
+ [Specify alternative path to Pthreads library when
+ thread-safe capability is built.])],,
+ [withval=check])
case "$withval" in
- yes)
+ check | yes)
AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD])
if test "x$HAVE_PTHREAD" = "xyes"; then
AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD])
fi
;;
no)
- AC_MSG_CHECKING([for pthread])
- AC_MSG_RESULT([suppressed])
- unset HAVE_PTHREAD
+ AC_MSG_ERROR([Must use Pthreads with thread safety])
;;
*)
case "$withval" in
@@ -1708,6 +1716,45 @@ if test "X$THREADSAFE" = "Xyes"; then
fi
;;
esac
+
+ ## ----------------------------------------------------------------------
+ ## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM)
+ ## is supported on this system
+ ##
+ ## Unfortunately, this probably needs to be an AC_TRY_RUN since
+ ## it's impossible to determine if PTHREAD_SCOPE_SYSTEM is
+ ## supported a priori. POSIX.1-2001 requires that a conformant
+ ## system need only support one of SYSTEM or PROCESS scopes.
+ ##
+ ## For cross-compiling, we've added a pessimistic 'no'. You can
+ ## hand-hack the config file if you know otherwise.
+ AC_MSG_CHECKING([Pthreads supports system scope])
+ AC_CACHE_VAL([hdf5_cv_system_scope_threads],
+ [AC_TRY_RUN([
+ #if STDC_HEADERS
+ #include <stdlib.h>
+ #include <pthread.h>
+ #endif
+
+ int main(void)
+ {
+ pthread_attr_t attribute;
+ int ret;
+
+ pthread_attr_init(&attribute);
+ ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
+ exit(ret==0 ? 0 : 1);
+ }
+ ], [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])])
+
+ if test ${hdf5_cv_system_scope_threads} = "yes"; then
+ AC_DEFINE([SYSTEM_SCOPE_THREADS], [1],
+ [Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call.])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_NOTICE([Always 'no' if cross-compiling. Edit the config file if your platform supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM).])
+ fi
fi
## ----------------------------------------------------------------------
@@ -1962,36 +2009,6 @@ AC_MSG_RESULT([%${hdf5_cv_printf_ll}d and %${hdf5_cv_printf_ll}u])
AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"],
[Width for printf() for type `long long' or `__int64', use `ll'])
-## ----------------------------------------------------------------------
-## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM)
-## is supported on this system
-##
-AC_MSG_CHECKING([Threads support system scope])
-AC_CACHE_VAL([hdf5_cv_system_scope_threads],
- [AC_TRY_RUN([
- #if STDC_HEADERS
- #include <stdlib.h>
- #include <pthread.h>
- #endif
-
- int main(void)
- {
- pthread_attr_t attribute;
- int ret;
-
- pthread_attr_init(&attribute);
- ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
- exit(ret==0 ? 0 : 1);
- }
- ], [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no],)])
-
-if test ${hdf5_cv_system_scope_threads} = "yes"; then
- AC_DEFINE([SYSTEM_SCOPE_THREADS], [1],
- [Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call.])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
## ----------------------------------------------------------------------
## Turn on debugging by setting compiler flags
@@ -2415,10 +2432,9 @@ fi
## ----------------------------------------------------------------------
## Check if Direct I/O driver is enabled by --enable-direct-vfd
##
-
-## Check these regardless. If the checks are moved inside the main
-## direct VFD block, the output is nested.
-
+## ----------------------------------------------------------------------
+## Check if Direct I/O driver is enabled by --enable-direct-vfd
+##
AC_CACHE_VAL([hdf5_cv_direct_io],
AC_CHECK_DECL([O_DIRECT], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no], [[#include <fcntl.h>]]))
AC_CACHE_VAL([hdf5_cv_posix_memalign],
@@ -2571,76 +2587,6 @@ esac
## -----------------------------------------------------------------------
## Set flag to indicate that the machine can handle conversion from
-## long double to integers accurately. This flag should be set "yes" for
-## all machines except all SGIs. For SGIs, some conversions are
-## incorrect and its cache value is set "no" in its config/irix6.x and
-## irix5.x.
-##
-AC_MSG_CHECKING([if converting from long double to integers is accurate])
-
-if test ${ac_cv_sizeof_long_double} = 0; then
- hdf5_cv_ldouble_to_integer_accurate=${hdf5_cv_ldouble_to_integer_accurate=no}
-else
- AC_CACHE_VAL([hdf5_cv_ldouble_to_integer_accurate], [hdf5_cv_ldouble_to_integer_accurate=yes])
-fi
-
-if test "${hdf5_cv_ldouble_to_integer_accurate}" = "yes"; then
- AC_DEFINE([LDOUBLE_TO_INTEGER_ACCURATE], [1],
- [Define if your system can convert long double to integers accurately.])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-## -----------------------------------------------------------------------
-## Set flag to indicate that the machine can do conversion from
-## long double to integers regardless of accuracy. This flag should be
-## set "yes" for all machines except HP-UX 11.00. For HP-UX 11.00, the
-## compiler has 'floating exception' when converting 'long double' to all
-## integers except 'unsigned long long'. Other HP-UX systems are unknown
-## yet. (1/8/05 - SLU)
-
-AC_MSG_CHECKING([if converting from long double to integers works])
-
-if test ${ac_cv_sizeof_long_double} = 0; then
- hdf5_cv_ldouble_to_integer_works=${hdf5_cv_ldouble_to_integer_works=no}
-else
- AC_CACHE_VAL([hdf5_cv_ldouble_to_integer_works],
- [AC_TRY_RUN([
- int main(void)
- {
- void *align;
- long double ld= 9701917572145405952.00L;
- unsigned char v1;
- short v2;
- unsigned int v3;
- int ret = 0;
-
- align = (void*)malloc(sizeof(long double));
- memcpy(align, &ld, sizeof(long double));
-
- /*For HU-UX11.00, there's floating exception(core dump) when doing some of casting
- *from 'long double' to integers*/
- v1=(unsigned char)(*((long double*)align));
- v2=(short)(*((long double*)align));
- v3=(unsigned int)(*((long double*)align));
-
- done:
- exit(ret);
- }
- ], [hdf5_cv_ldouble_to_integer_works=yes], [hdf5_cv_ldouble_to_integer_works=no],)])
-fi
-
-if test ${hdf5_cv_ldouble_to_integer_works} = "yes"; then
- AC_DEFINE([LDOUBLE_TO_INTEGER_WORKS], [1],
- [Define if your system can convert from long double to integer values.])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-## -----------------------------------------------------------------------
-## Set flag to indicate that the machine can handle conversion from
## integers to long double. (This flag should be set "yes" for all
## machines except all SGIs, where some conversions are
## incorrect and its cache value is set "no" in its config/irix6.x and