From 93129f271e71e669a3218c93a71d361155cb4c7e Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 8 May 2001 13:42:42 -0500 Subject: [svn-r3892] Purpose: Better Mouse Trap^W^WBug Fix Description: Instead of having the large file support stuff be in the config/gnu-flags directory, I added it to the configure.in file so that it first checks for the syscall ``getdents64()''. If it finds it, then it removes the ``-malign-double'' flag if the GCC compiler is 2.95.x since this flag doesn't play well with the LFS stuff. Solution: Added test for getdents64(), if found it removes the -malign-double flag if the compiler is 2.95.x. This is done in the configure.in file. The gnu-flags file is returned to normal. A new field is added to the H5config.h.in file because of the getdents64 check. Platforms tested: Linux --- config/gnu-flags | 19 +------ configure | 151 +++++++++++++++++++++++++++++++++++++++--------------- configure.in | 28 ++++++++-- src/H5config.h.in | 3 ++ 4 files changed, 140 insertions(+), 61 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 9ad36b2..4d61105 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -101,24 +101,9 @@ case "$host_os-$host_cpu" in ;; *-i686) - # Large file system support has to be compiled with these flags. - LFS_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" case "$cc_vendor-$cc_version" in - gcc-2.95*) - case "`uname -r`" in - # For kernels 2.2 and below, we don't have support - # for >2GB files. We care only about >2.3. - [2-9].[3-9].*) - # The -malign-double flag is bad for our - # architecture with large file support. Define - # these flags so that we can have large file - # support in the library. - ARCH=${ARCH:="-march=i686 $LFS_FLAGS"} - ;; - *) - ARCH=${ARCH:="-march=i686 -malign-double"} - ;; - esac + gcc-2.9[56]*) + ARCH=${ARCH:="-march=i686 -malign-double"} ;; gcc-*|egcs-*|pgcc-*) ARCH=${ARCH:="-mcpu=pentiumpro -march=pentiumpro -malign-double"} diff --git a/configure b/configure index d6f7708..17d2790 100755 --- a/configure +++ b/configure @@ -8735,7 +8735,7 @@ fi rm -f conftest* -for ac_func in getpwuid gethostname system getrusage fork waitpid +for ac_func in compress2 difftime fork gethostname getpwuid getrusage do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:8742: checking for $ac_func" >&5 @@ -8790,7 +8790,7 @@ else fi done -for ac_func in gettimeofday BSDgettimeofday difftime snprintf vsnprintf +for ac_func in gettimeofday BSDgettimeofday longjmp setsysinfo sigaction do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:8797: checking for $ac_func" >&5 @@ -8845,7 +8845,7 @@ else fi done -for ac_func in compress2 setsysinfo longjmp signal sigaction strdup +for ac_func in signal snprintf vsnprintf strdup system waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:8852: checking for $ac_func" >&5 @@ -8973,14 +8973,83 @@ else fi rm -f conftest* +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + for ac_func in getdents64 +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:8982: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +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 +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:9010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + ;; +esac + echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:8979: checking for working const" >&5 +echo "configure:9048: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -9050,21 +9119,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:9054: checking for inline" >&5 +echo "configure:9123: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -9091,16 +9160,16 @@ esac echo $ac_n "checking for __attribute__ extension""... $ac_c" 1>&6 -echo "configure:9095: checking for __attribute__ extension" >&5 +echo "configure:9164: checking for __attribute__ extension" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ATTRIBUTE 1 @@ -9116,16 +9185,16 @@ fi rm -f conftest* echo $ac_n "checking for __FUNCTION__ extension""... $ac_c" 1>&6 -echo "configure:9120: checking for __FUNCTION__ extension" >&5 +echo "configure:9189: checking for __FUNCTION__ extension" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_FUNCTION 1 @@ -9141,7 +9210,7 @@ fi rm -f conftest* echo $ac_n "checking how to print long long""... $ac_c" 1>&6 -echo "configure:9145: checking how to print long long" >&5 +echo "configure:9214: checking how to print long long" >&5 if eval "test \"`echo '$''{'hdf5_cv_printf_ll'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9153,7 +9222,7 @@ for hdf5_cv_printf_ll in l L q ll unknown; do { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -9169,7 +9238,7 @@ int main(void) } EOF -if { (eval echo configure:9173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then break else @@ -9190,7 +9259,7 @@ EOF echo $ac_n "checking for debug flags""... $ac_c" 1>&6 -echo "configure:9194: checking for debug flags" >&5 +echo "configure:9263: checking for debug flags" >&5 # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" @@ -9228,7 +9297,7 @@ if test -n "$DEBUG_PKG"; then fi echo $ac_n "checking for API tracing""... $ac_c" 1>&6 -echo "configure:9232: checking for API tracing" >&5; +echo "configure:9301: checking for API tracing" >&5; # Check whether --enable-trace or --disable-trace was given. if test "${enable_trace+set}" = set; then enableval="$enable_trace" @@ -9304,7 +9373,7 @@ case "$CC_BASENAME" in mpicc) PARALLEL=mpicc echo $ac_n "checking for mpirun""... $ac_c" 1>&6 -echo "configure:9308: checking for mpirun" >&5 +echo "configure:9377: checking for mpirun" >&5 cmd=`echo $CC |cut -f1 -d' '` if (echo $cmd |grep / >/dev/null); then @@ -9331,7 +9400,7 @@ echo "configure:9308: checking for mpirun" >&5 hcc) PARALLEL=hcc echo $ac_n "checking for mpirun_lam or mpirun""... $ac_c" 1>&6 -echo "configure:9335: checking for mpirun_lam or mpirun" >&5 +echo "configure:9404: checking for mpirun_lam or mpirun" >&5 cmd=`echo $CC |cut -f1 -d' '` if (echo $cmd |grep / >/dev/null); then @@ -9376,7 +9445,7 @@ fi echo $ac_n "checking for parallel support files""... $ac_c" 1>&6 -echo "configure:9380: checking for parallel support files" >&5 +echo "configure:9449: checking for parallel support files" >&5 case "X-$enable_parallel" in X-|X-no|X-none) echo "$ac_t""skipped" 1>&6 @@ -9387,21 +9456,21 @@ case "X-$enable_parallel" in PARALLEL=yes cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo $ac_n "checking for MPI_Init in -lmpi""... $ac_c" 1>&6 -echo "configure:9405: checking for MPI_Init in -lmpi" >&5 +echo "configure:9474: checking for MPI_Init in -lmpi" >&5 ac_lib_var=`echo mpi'_'MPI_Init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9409,7 +9478,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmpi $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9453,21 +9522,21 @@ rm -f conftest* if test "X$PARALLEL" = "Xyes"; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo $ac_n "checking for MPI_File_open in -lmpio""... $ac_c" 1>&6 -echo "configure:9471: checking for MPI_File_open in -lmpio" >&5 +echo "configure:9540: checking for MPI_File_open in -lmpio" >&5 ac_lib_var=`echo mpio'_'MPI_File_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9475,7 +9544,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmpio $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9529,7 +9598,7 @@ rm -f conftest* PARALLEL=mpich echo $ac_n "checking for MPI_Init in -lmpich""... $ac_c" 1>&6 -echo "configure:9533: checking for MPI_Init in -lmpich" >&5 +echo "configure:9602: checking for MPI_Init in -lmpich" >&5 ac_lib_var=`echo mpich'_'MPI_Init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9537,7 +9606,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmpich $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9595,23 +9664,23 @@ EOF echo $ac_n "checking prefix for running on one processor""... $ac_c" 1>&6 -echo "configure:9599: checking prefix for running on one processor" >&5 +echo "configure:9668: checking prefix for running on one processor" >&5 echo "$ac_t""$RUNSERIAL" 1>&6 echo $ac_n "checking prefix for running in parallel""... $ac_c" 1>&6 -echo "configure:9602: checking prefix for running in parallel" >&5 +echo "configure:9671: checking prefix for running in parallel" >&5 echo "$ac_t""$RUNPARALLEL" 1>&6 echo $ac_n "checking whether a simple MPI-IO program can be linked""... $ac_c" 1>&6 -echo "configure:9606: checking whether a simple MPI-IO program can be linked" >&5 +echo "configure:9675: checking whether a simple MPI-IO program can be linked" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else diff --git a/configure.in b/configure.in index c4a4f6c..421d7b0 100644 --- a/configure.in +++ b/configure.in @@ -1030,14 +1030,36 @@ AC_MSG_RESULT(no)) dnl ---------------------------------------------------------------------- dnl Check for functions. dnl -AC_CHECK_FUNCS(getpwuid gethostname system getrusage fork waitpid) -AC_CHECK_FUNCS(gettimeofday BSDgettimeofday difftime snprintf vsnprintf) -AC_CHECK_FUNCS(compress2 setsysinfo longjmp signal sigaction strdup) +AC_CHECK_FUNCS(compress2 difftime fork gethostname getpwuid getrusage) +AC_CHECK_FUNCS(gettimeofday BSDgettimeofday longjmp setsysinfo sigaction) +AC_CHECK_FUNCS(signal snprintf vsnprintf strdup system waitpid) AC_TRY_COMPILE([#include], [off64_t n = 0;], AC_CHECK_FUNCS(lseek64 fseek64), AC_MSG_RESULT([skipping test for lseek64() and fseek64()])) +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + AC_CHECK_FUNCS(getdents64, + dnl Add the large file support flags to the CPPFLAGS macro if + dnl we're on a Linux system which austensibly supports LFS. (We + dnl think it does if it has the ``getdents64'' syscall). + CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $CPPFLAGS" + if test $cc_vers_all -gt 2095000 -a $cc_vers_all -lt 2096000; then + dnl For GCC compilers 2.95.x, the -malign-double flag plays + dnl havoc with the LFS stuff. Remove it. It apparently works + dnl for 2.96, though, so... + CFLAGS_saved=$CFLAGS + CFLAGS="" + for flag in X $CFLAGS_saved; do + if test "$flag" != "X" -a "$flag" != "-malign-double"; then + CFLAGS="$CFLAGS $flag" + fi + done + fi) + ;; +esac + dnl ---------------------------------------------------------------------- dnl Check compiler characteristics diff --git a/src/H5config.h.in b/src/H5config.h.in index ac0e50c..d61f9e3 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -227,6 +227,9 @@ /* Define if you have the fseek64 function. */ #undef HAVE_FSEEK64 +/* Define if you have the getdents64 function. */ +#undef HAVE_GETDENTS64 + /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME -- cgit v0.12