diff options
author | Bill Wendling <wendling@ncsa.uiuc.edu> | 2002-05-31 22:28:03 (GMT) |
---|---|---|
committer | Bill Wendling <wendling@ncsa.uiuc.edu> | 2002-05-31 22:28:03 (GMT) |
commit | f945d80d75510302437d27ef0eaa377d1bc2d715 (patch) | |
tree | 1eb1f2d86eb36331d84cef00c0882c4bc42ca20d | |
parent | 372da9076ca0f7310cf5e56092ae333760e980b4 (diff) | |
download | hdf5-f945d80d75510302437d27ef0eaa377d1bc2d715.zip hdf5-f945d80d75510302437d27ef0eaa377d1bc2d715.tar.gz hdf5-f945d80d75510302437d27ef0eaa377d1bc2d715.tar.bz2 |
[svn-r5496] Purpose:
Bug Fix
Description:
C++ uses the "off_t" type for external files as well. I'm assuming
that there's going to be a problem with 4 byte off_ts and 8 byte
off_ts in the C++ code as well. I compiled everything on Linux and it
worked, but I don't think we have a check for this bug in the library
yet...
Platforms tested:
Linux
-rwxr-xr-x | c++/configure | 123 | ||||
-rw-r--r-- | c++/configure.in | 48 |
2 files changed, 167 insertions, 4 deletions
diff --git a/c++/configure b/c++/configure index c18d7fb..16cc1b8 100755 --- a/c++/configure +++ b/c++/configure @@ -1008,6 +1008,8 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-production Determines how to run the compiler. --enable-static-exec Build only statically linked executables default=no + --enable-linux-lfs Enable support for large (64-bit) files on Linux. + default=check Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -4394,7 +4396,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4397 "configure"' > conftest.$ac_ext + echo '#line 4399 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4935,7 +4937,7 @@ chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:4938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:4940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -6746,7 +6748,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 6749 "configure" +#line 6751 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -6844,7 +6846,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 6847 "configure" +#line 6849 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -7783,6 +7785,119 @@ else fi +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + # Check whether --enable-linux-lfs or --disable-linux-lfs was given. +if test "${enable_linux_lfs+set}" = set; then + enableval="$enable_linux_lfs" + +fi; + + LINUX_LFS="no" + case "X-$enable_linux_lfs" in + X-yes) + LINUX_LFS=yes + ;; + X-no) + ;; + X-|*) + +for ac_func in getdents64 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + LINUX_LFS=yes +fi +done + + ;; + esac + + echo "$as_me:$LINENO: checking for large file support on linux mode" >&5 +echo $ECHO_N "checking for large file support on linux mode... $ECHO_C" >&6 + if test "X$LINUX_LFS" = "Xyes"; then + echo "$as_me:$LINENO: result: enabled" >&5 +echo "${ECHO_T}enabled" >&6 + + CXXFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $CXXFLAGS" + else + echo "$as_me:$LINENO: result: disabled" >&5 +echo "${ECHO_T}disabled" >&6 + fi + + CXXFLAGS="-D_POSIX_SOURCE $CXXFLAGS" + + CXXFLAGS="-D_BSD_SOURCE $CXXFLAGS" + ;; +esac + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/c++/configure.in b/c++/configure.in index c46e53c..5c08201 100644 --- a/c++/configure.in +++ b/c++/configure.in @@ -281,6 +281,54 @@ else fi AC_SUBST(LT_STATIC_EXEC) +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + dnl ---------------------------------------------------------------------- + dnl Enable large file support on linux? Store the result in the LINUX_LFS + dnl variable for posterity + AC_ARG_ENABLE(linux-lfs, + [ --enable-linux-lfs Enable support for large (64-bit) files on Linux. + [default=check]]) + + LINUX_LFS="no" + case "X-$enable_linux_lfs" in + X-yes) + LINUX_LFS=yes + ;; + X-no) + ;; + X-|*) + AC_CHECK_FUNCS(getdents64, + dnl Add the large file support flags to the + dnl CXXFLAGS macro if we're on a Linux system + dnl which austensibly supports LFS. (We think it + dnl does if it has the `getdents64' syscall). + LINUX_LFS=yes) + ;; + esac + + AC_MSG_CHECKING(for large file support on linux mode) + if test "X$LINUX_LFS" = "Xyes"; then + AC_MSG_RESULT(enabled) + + CXXFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $CXXFLAGS" + else + AC_MSG_RESULT(disabled) + fi + + dnl Add POSIX support on Linux systems, so <features.h> defines + dnl __USE_POSIX, which is required to get the prototype for fdopen + dnl defined correctly in <stdio.h> + CXXFLAGS="-D_POSIX_SOURCE $CXXFLAGS" + + dnl Also add BSD support on Linux systems, so <features.h> defines + dnl __USE_BSD, which is required to get the prototype for strdup + dnl defined correctly in <string.h> and snprintf & vsnprintf defined + dnl correctly in <stdio.h> + CXXFLAGS="-D_BSD_SOURCE $CXXFLAGS" + ;; +esac + dnl ---------------------------------------------------------------------- dnl Checks for compiler characteristics. dnl |