diff options
author | Bill Wendling <wendling@ncsa.uiuc.edu> | 2003-06-05 22:17:03 (GMT) |
---|---|---|
committer | Bill Wendling <wendling@ncsa.uiuc.edu> | 2003-06-05 22:17:03 (GMT) |
commit | ed99e59d6869e2f3d627ae4f5aa4df6c19df0b04 (patch) | |
tree | 5b6eed237ac5974596771f5c97e23cd646889db3 /c++/configure.in | |
parent | ad76468b3e5b91cac0d5b177c1e125431a9498d6 (diff) | |
download | hdf5-ed99e59d6869e2f3d627ae4f5aa4df6c19df0b04.zip hdf5-ed99e59d6869e2f3d627ae4f5aa4df6c19df0b04.tar.gz hdf5-ed99e59d6869e2f3d627ae4f5aa4df6c19df0b04.tar.bz2 |
[svn-r6982] Purpose:
Utility Addition
Description:
Added h5c++ script file to compile HDF5 C++ applications.
Platforms tested:
Verbena (Fortran & C++)
Arabica (Fortran & C++)
Modi4 (Fortran & Parallel)
Misc. update:
Diffstat (limited to 'c++/configure.in')
-rw-r--r-- | c++/configure.in | 241 |
1 files changed, 236 insertions, 5 deletions
diff --git a/c++/configure.in b/c++/configure.in index 8cdedbc..073c201 100644 --- a/c++/configure.in +++ b/c++/configure.in @@ -256,7 +256,7 @@ case "X-$enable_production" in X-yes) AC_MSG_RESULT("production") - dnl Remove the "-g" flag from CFLAGS if it's in there. + dnl Remove the "-g" flag from CFLAGS & CXXFLAGS if it's in there. dnl CXXFLAGS_temp="" if test -n "$CXXFLAGS"; then @@ -268,6 +268,16 @@ case "X-$enable_production" in CXXFLAGS=$CXXFLAGS_temp fi + CFLAGS_temp="" + if test -n "$CFLAGS"; then + for d in $CFLAGS ; do + if test "X$d" != "X-g"; then + CFLAGS_temp="$CFLAGS_temp $d" + fi + done + CFLAGS=$CFLAGS_temp + fi + CONFIG_MODE=production CXXFLAGS="$CXXFLAGS $PROD_CXXFLAGS" CPPFLAGS="$CPPFLAGS $PROD_CPPFLAGS" @@ -291,12 +301,25 @@ case "X-$enable_production" in esac dnl ---------------------------------------------------------------------- +dnl Check for system libraries. +dnl +AC_CHECK_LIB([m], [ceil]) + +if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then + dnl ...for Solaris + AC_CHECK_LIB([socket], [socket]) + AC_CHECK_LIB([nsl], [xdr_int]) +fi + +dnl ---------------------------------------------------------------------- dnl If we should build only static executables dnl -AC_MSG_CHECKING(if should build only statically linked executables) -AC_ARG_ENABLE(static_exec, - [ --enable-static-exec Build only statically linked executables [default=no]], - STATIC_EXEC=$enableval) +AC_MSG_CHECKING([if should build only statically linked executables]) +AC_ARG_ENABLE([static_exec], + [AC_HELP_STRING([--enable-static-exec], + [Build only statically linked executables + [default=no]])], + STATIC_EXEC=$enableval) if test "X$STATIC_EXEC" = "Xyes"; then echo "yes" @@ -442,6 +465,213 @@ int main(void) { ]) dnl ---------------------------------------------------------------------- +dnl Checks for libraries. +dnl + +dnl ---------------------------------------------------------------------- +dnl Is the GNU zlib present? It has a header file `zlib.h' and a library +dnl `-lz' and their locations might be specified with the `--with-zlib' +dnl command-line switch. The value is an include path and/or a library path. +dnl If the library path is specified then it must be preceded by a comma. +dnl +AC_ARG_WITH([zlib], + [AC_HELP_STRING([--with-zlib=DIR], + [Use zlib library for external deflate I/O + filter [default=yes]])],, + withval=yes) + +case $withval in + yes) + HAVE_ZLIB="yes" + AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"]) + AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB]) + AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) + + if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find zlib library]) + fi + ;; + no) + HAVE_ZLIB="no" + AC_MSG_CHECKING([for GNU zlib]) + AC_MSG_RESULT([suppressed]) + ;; + *) + HAVE_ZLIB="yes" + case "$withval" in + *,*) + zlib_inc="`echo $withval |cut -f1 -d,`" + zlib_lib="`echo $withval |cut -f2 -d, -s`" + ;; + *) + if test -n "$withval"; then + zlib_inc="$withval/include" + zlib_lib="$withval/lib" + fi + ;; + esac + + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$zlib_inc" = "X/usr/include"; then + zlib_inc="" + fi + if test "X$zlib_lib" = "X/usr/lib"; then + zlib_lib="" + fi + + saved_CPPFLAGS="$CPPFLAGS" + saved_LDFLAGS="$LDFLAGS" + + if test -n "$zlib_inc"; then + CPPFLAGS="$CPPFLAGS -I$zlib_inc" + fi + + AC_CHECK_HEADERS([zlib.h], + [HAVE_ZLIB_H="yes"], + [CPPFLAGS="$saved_CPPFLAGS"]) + + if test -n "$zlib_lib"; then + LDFLAGS="$LDFLAGS -L$zlib_lib" + fi + + AC_CHECK_LIB([z], [compress2],, + [LDFLAGS="$saved_LDFLAGS"; unset HAVE_ZLIB]) + AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) + + if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find zlib library]) + fi + ;; +esac + +if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2" = "xyes"; then + AC_DEFINE(HAVE_FILTER_DEFLATE, 1, + [Define if support for deflate filter is enabled]) +fi + +dnl ---------------------------------------------------------------------- +dnl Is the szlib present? It has a header file `szlib.h' and a library +dnl `-lsz' and their locations might be specified with the `--with-szlib' +dnl command-line switch. The value is an include path and/or a library path. +dnl If the library path is specified then it must be preceded by a comma. +dnl +AC_ARG_WITH([szlib], + [AC_HELP_STRING([--with-szlib=DIR], + [Use szlib library for external szlib I/O + filter [default=yes]])],, + withval=yes) + +case $withval in + yes) + HAVE_SZLIB="yes" + AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"]) + AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB]) + + if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find szlib library]) + fi + ;; + no) + HAVE_SZLIB="no" + AC_MSG_CHECKING([for szlib]) + AC_MSG_RESULT([suppressed]) + ;; + *) + HAVE_SZLIB="yes" + case "$withval" in + *,*) + szlib_inc="`echo $withval |cut -f1 -d,`" + szlib_lib="`echo $withval |cut -f2 -d, -s`" + ;; + *) + if test -n "$withval"; then + szlib_inc="$withval/include" + szlib_lib="$withval/lib" + fi + ;; + esac + + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$szlib_inc" = "X/usr/include"; then + szlib_inc="" + fi + if test "X$szlib_lib" = "X/usr/lib"; then + szlib_lib="" + fi + + saved_CPPFLAGS="$CPPFLAGS" + saved_LDFLAGS="$LDFLAGS" + + if test -n "$szlib_inc"; then + CPPFLAGS="$CPPFLAGS -I$szlib_inc" + fi + + AC_CHECK_HEADERS([szlib.h], + [HAVE_SZLIB_H="yes"], + [CPPFLAGS="$saved_CPPFLAGS"]) + + if test -n "$szlib_lib"; then + LDFLAGS="$LDFLAGS -L$szlib_lib" + fi + + AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, + [LDFLAGS="$saved_LDFLAGS"; unset HAVE_SZLIB]) + + if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find szlib library]) + fi + ;; +esac + +if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + AC_DEFINE(HAVE_FILTER_SZIP, 1, + [Define if support for szip filter is enabled]) +fi + +dnl ---------------------------------------------------------------------- +dnl Should the Stream Virtual File Driver be compiled in ? +dnl +AC_MSG_CHECKING([for Stream Virtual File Driver support]) +AC_ARG_ENABLE([stream-vfd], + [AC_HELP_STRING([--enable-stream-vfd], + [Build the Stream Virtual File Driver + [default=no]])], + [STREAM_VFD=$enableval]) + +if test "$STREAM_VFD" = "yes"; then + AC_MSG_RESULT([yes]) + AC_CHECK_HEADERS([netinet/tcp.h sys/filio.h]) + AC_DEFINE([HAVE_STREAM], [1], + [Define if the stream virtual file driver should be compiled]) + + dnl Check if 'socklen_t' available + AC_MSG_CHECKING([if socklen_t is defined]) + AC_TRY_COMPILE([ +#include <stdio.h> +#include <stdlib.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + ], + [socklen_t foo; return 0;], + AC_DEFINE([HAVE_SOCKLEN_T], 1, + [Define if \`socklen_t' is defined]) + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + ) +else + AC_MSG_RESULT([not configured]) +fi + +dnl ---------------------------------------------------------------------- dnl Checks for header files. dnl @@ -570,6 +800,7 @@ AC_CONFIG_FILES([config/depend1 config/conclude Makefile src/Makefile + src/h5c++ test/Makefile examples/Makefile]) AC_OUTPUT |