From 31c4e7ef21ae3679db80171b665d8daa2e78af67 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 26 May 1999 18:45:11 +0000 Subject: Fixed the sense of the fcntl_lock* tests using WIFEXITED. Don't check for fcntl64 if the glibc2.1 broken test has already failed. This *should* fix the RedHat 6.0 glibc2.1 bugs. Jeremy. --- source/configure | 198 ++++++++++++++++++++++---------------------- source/configure.in | 28 ++++--- source/tests/fcntl_lock.c | 2 +- source/tests/fcntl_lock64.c | 4 +- 4 files changed, 122 insertions(+), 110 deletions(-) diff --git a/source/configure b/source/configure index eb537c79905..4e32087dbd4 100755 --- a/source/configure +++ b/source/configure @@ -8515,18 +8515,56 @@ EOF fi -echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6 -echo "configure:8520: checking for 64 bit fcntl locking" >&5 -if eval "test \"`echo '$''{'samba_cv_HAVE_STRUCT_FLOCK64'+set}'`\" = set"; then +echo $ac_n "checking for broken (glibc2.1/x86) 64 bit fcntl locking""... $ac_c" 1>&6 +echo "configure:8520: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5 +if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_FCNTL64_LOCKS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - samba_cv_HAVE_STRUCT_FLOCK64=cross + samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" 1>&6 +if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_BROKEN_FCNTL64_LOCKS 1 +EOF + + +else + + + echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6 +echo "configure:8558: checking for 64 bit fcntl locking" >&5 +if eval "test \"`echo '$''{'samba_cv_HAVE_STRUCT_FLOCK64'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + samba_cv_HAVE_STRUCT_FLOCK64=cross +else + cat > conftest.$ac_ext < @@ -8549,7 +8587,7 @@ exit(1); #endif } EOF -if { (eval echo configure:8553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_STRUCT_FLOCK64=yes else @@ -8564,51 +8602,17 @@ fi fi echo "$ac_t""$samba_cv_HAVE_STRUCT_FLOCK64" 1>&6 -if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_STRUCT_FLOCK64 1 -EOF - -fi -echo $ac_n "checking for broken (glibc2.1/x86) 64 bit fcntl locking""... $ac_c" 1>&6 -echo "configure:8576: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5 -if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_FCNTL64_LOCKS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -if test "$cross_compiling" = yes; then - samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" 1>&6 -if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_BROKEN_FCNTL64_LOCKS 1 + if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_FLOCK64 1 EOF + fi fi echo $ac_n "checking for sysv ipc""... $ac_c" 1>&6 -echo "configure:8612: checking for sysv ipc" >&5 +echo "configure:8616: checking for sysv ipc" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_SYSV_IPC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8617,11 +8621,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_SYSV_IPC=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_SYSV_IPC=yes else @@ -8644,7 +8648,7 @@ EOF fi echo $ac_n "checking for a crypt that needs truncated salt""... $ac_c" 1>&6 -echo "configure:8648: checking for a crypt that needs truncated salt" >&5 +echo "configure:8652: checking for a crypt that needs truncated salt" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_TRUNCATED_SALT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8653,11 +8657,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_TRUNCATED_SALT=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_TRUNCATED_SALT=no else @@ -8680,13 +8684,13 @@ EOF fi echo $ac_n "checking for broken nisplus include files""... $ac_c" 1>&6 -echo "configure:8684: checking for broken nisplus include files" >&5 +echo "configure:8688: checking for broken nisplus include files" >&5 if eval "test \"`echo '$''{'samba_cv_BROKEN_NISPLUS_INCLUDE_FILES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if defined(HAVE_RPCSVC_NIS_H) @@ -8696,7 +8700,7 @@ int main() { return 0; ; return 0; } EOF -if { (eval echo configure:8700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no else @@ -8720,7 +8724,7 @@ fi ################################################# # check for smbwrapper support echo $ac_n "checking whether to use smbwrapper""... $ac_c" 1>&6 -echo "configure:8724: checking whether to use smbwrapper" >&5 +echo "configure:8728: checking whether to use smbwrapper" >&5 # Check whether --with-smbwrapper or --without-smbwrapper was given. if test "${with_smbwrapper+set}" = set; then withval="$with_smbwrapper" @@ -8764,7 +8768,7 @@ fi ################################################# # check for the AFS filesystem echo $ac_n "checking whether to use AFS""... $ac_c" 1>&6 -echo "configure:8768: checking whether to use AFS" >&5 +echo "configure:8772: checking whether to use AFS" >&5 # Check whether --with-afs or --without-afs was given. if test "${with_afs+set}" = set; then withval="$with_afs" @@ -8790,7 +8794,7 @@ fi ################################################# # check for the DFS auth system echo $ac_n "checking whether to use DFS auth""... $ac_c" 1>&6 -echo "configure:8794: checking whether to use DFS auth" >&5 +echo "configure:8798: checking whether to use DFS auth" >&5 # Check whether --with-dfs or --without-dfs was given. if test "${with_dfs+set}" = set; then withval="$with_dfs" @@ -8815,7 +8819,7 @@ fi ################################################# # check for Kerberos IV auth system echo $ac_n "checking whether to use Kerberos IV""... $ac_c" 1>&6 -echo "configure:8819: checking whether to use Kerberos IV" >&5 +echo "configure:8823: checking whether to use Kerberos IV" >&5 # Check whether --with-krb4 or --without-krb4 was given. if test "${with_krb4+set}" = set; then withval="$with_krb4" @@ -8825,7 +8829,7 @@ if test "${with_krb4+set}" = set; then EOF echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6 -echo "configure:8829: checking for dn_expand in -lresolv" >&5 +echo "configure:8833: checking for dn_expand in -lresolv" >&5 ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8833,7 +8837,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8883,7 +8887,7 @@ fi ################################################# # check for Kerberos 5 auth system echo $ac_n "checking whether to use Kerberos 5""... $ac_c" 1>&6 -echo "configure:8887: checking whether to use Kerberos 5" >&5 +echo "configure:8891: checking whether to use Kerberos 5" >&5 # Check whether --with-krb5 or --without-krb5 was given. if test "${with_krb5+set}" = set; then withval="$with_krb5" @@ -8904,7 +8908,7 @@ fi ################################################# # check for automount support echo $ac_n "checking whether to use AUTOMOUNT""... $ac_c" 1>&6 -echo "configure:8908: checking whether to use AUTOMOUNT" >&5 +echo "configure:8912: checking whether to use AUTOMOUNT" >&5 # Check whether --with-automount or --without-automount was given. if test "${with_automount+set}" = set; then withval="$with_automount" @@ -8929,7 +8933,7 @@ fi ################################################# # check for smbmount support echo $ac_n "checking whether to use SMBMOUNT""... $ac_c" 1>&6 -echo "configure:8933: checking whether to use SMBMOUNT" >&5 +echo "configure:8937: checking whether to use SMBMOUNT" >&5 # Check whether --with-smbmount or --without-smbmount was given. if test "${with_smbmount+set}" = set; then withval="$with_smbmount" @@ -8958,7 +8962,7 @@ fi ################################################# # check for a PAM password database echo $ac_n "checking whether to use PAM password database""... $ac_c" 1>&6 -echo "configure:8962: checking whether to use PAM password database" >&5 +echo "configure:8966: checking whether to use PAM password database" >&5 # Check whether --with-pam or --without-pam was given. if test "${with_pam+set}" = set; then withval="$with_pam" @@ -8985,7 +8989,7 @@ fi ################################################# # check for a LDAP password database echo $ac_n "checking whether to use LDAP password database""... $ac_c" 1>&6 -echo "configure:8989: checking whether to use LDAP password database" >&5 +echo "configure:8993: checking whether to use LDAP password database" >&5 # Check whether --with-ldap or --without-ldap was given. if test "${with_ldap+set}" = set; then withval="$with_ldap" @@ -9010,7 +9014,7 @@ fi ################################################# # check for a NISPLUS password database echo $ac_n "checking whether to use NISPLUS password database""... $ac_c" 1>&6 -echo "configure:9014: checking whether to use NISPLUS password database" >&5 +echo "configure:9018: checking whether to use NISPLUS password database" >&5 # Check whether --with-nisplus or --without-nisplus was given. if test "${with_nisplus+set}" = set; then withval="$with_nisplus" @@ -9035,7 +9039,7 @@ fi ################################################# # check for a NISPLUS_HOME support echo $ac_n "checking whether to use NISPLUS_HOME""... $ac_c" 1>&6 -echo "configure:9039: checking whether to use NISPLUS_HOME" >&5 +echo "configure:9043: checking whether to use NISPLUS_HOME" >&5 # Check whether --with-nisplus-home or --without-nisplus-home was given. if test "${with_nisplus_home+set}" = set; then withval="$with_nisplus_home" @@ -9060,7 +9064,7 @@ fi ################################################# # check for the secure socket layer echo $ac_n "checking whether to use SSL""... $ac_c" 1>&6 -echo "configure:9064: checking whether to use SSL" >&5 +echo "configure:9068: checking whether to use SSL" >&5 # Check whether --with-ssl or --without-ssl was given. if test "${with_ssl+set}" = set; then withval="$with_ssl" @@ -9120,7 +9124,7 @@ fi ################################################# # check for experimental mmap support echo $ac_n "checking whether to use MMAP""... $ac_c" 1>&6 -echo "configure:9124: checking whether to use MMAP" >&5 +echo "configure:9128: checking whether to use MMAP" >&5 # Check whether --with-mmap or --without-mmap was given. if test "${with_mmap+set}" = set; then withval="$with_mmap" @@ -9145,7 +9149,7 @@ fi ################################################# # check for syslog logging echo $ac_n "checking whether to use syslog logging""... $ac_c" 1>&6 -echo "configure:9149: checking whether to use syslog logging" >&5 +echo "configure:9153: checking whether to use syslog logging" >&5 # Check whether --with-syslog or --without-syslog was given. if test "${with_syslog+set}" = set; then withval="$with_syslog" @@ -9170,7 +9174,7 @@ fi ################################################# # check for experimental netatalk resource fork support echo $ac_n "checking whether to support netatalk""... $ac_c" 1>&6 -echo "configure:9174: checking whether to support netatalk" >&5 +echo "configure:9178: checking whether to support netatalk" >&5 # Check whether --with-netatalk or --without-netatalk was given. if test "${with_netatalk+set}" = set; then withval="$with_netatalk" @@ -9197,7 +9201,7 @@ fi QUOTAOBJS=noquotas.o echo $ac_n "checking whether to support disk-quotas""... $ac_c" 1>&6 -echo "configure:9201: checking whether to support disk-quotas" >&5 +echo "configure:9205: checking whether to support disk-quotas" >&5 # Check whether --with-quotas or --without-quotas was given. if test "${with_quotas+set}" = set; then withval="$with_quotas" @@ -9295,14 +9299,14 @@ fi ################################################# # these tests are taken from the GNU fileutils package echo "checking how to get filesystem space usage" 1>&6 -echo "configure:9299: checking how to get filesystem space usage" >&5 +echo "configure:9303: checking how to get filesystem space usage" >&5 space=no # Test for statvfs64. if test $space = no; then # SVR4 echo $ac_n "checking statvfs64 function (SVR4)""... $ac_c" 1>&6 -echo "configure:9306: checking statvfs64 function (SVR4)" >&5 +echo "configure:9310: checking statvfs64 function (SVR4)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statvfs64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9310,7 +9314,7 @@ else fu_cv_sys_stat_statvfs64=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statvfs64=yes else @@ -9357,12 +9361,12 @@ fi if test $space = no; then # SVR4 echo $ac_n "checking statvfs function (SVR4)""... $ac_c" 1>&6 -echo "configure:9361: checking statvfs function (SVR4)" >&5 +echo "configure:9365: checking statvfs function (SVR4)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statvfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -9370,7 +9374,7 @@ int main() { struct statvfs fsd; statvfs (0, &fsd); ; return 0; } EOF -if { (eval echo configure:9374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* fu_cv_sys_stat_statvfs=yes else @@ -9395,7 +9399,7 @@ fi if test $space = no; then # DEC Alpha running OSF/1 echo $ac_n "checking for 3-argument statfs function (DEC OSF/1)""... $ac_c" 1>&6 -echo "configure:9399: checking for 3-argument statfs function (DEC OSF/1)" >&5 +echo "configure:9403: checking for 3-argument statfs function (DEC OSF/1)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs3_osf1'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9403,7 +9407,7 @@ else fu_cv_sys_stat_statfs3_osf1=no else cat > conftest.$ac_ext < @@ -9416,7 +9420,7 @@ else exit (statfs (".", &fsd, sizeof (struct statfs))); } EOF -if { (eval echo configure:9420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs3_osf1=yes else @@ -9443,7 +9447,7 @@ fi if test $space = no; then # AIX echo $ac_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)""... $ac_c" 1>&6 -echo "configure:9447: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 +echo "configure:9451: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_bsize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9451,7 +9455,7 @@ else fu_cv_sys_stat_statfs2_bsize=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs2_bsize=yes else @@ -9497,7 +9501,7 @@ fi if test $space = no; then # SVR3 echo $ac_n "checking for four-argument statfs (AIX-3.2.5, SVR3)""... $ac_c" 1>&6 -echo "configure:9501: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 +echo "configure:9505: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9505,7 +9509,7 @@ else fu_cv_sys_stat_statfs4=no else cat > conftest.$ac_ext < #include @@ -9515,7 +9519,7 @@ else exit (statfs (".", &fsd, sizeof fsd, 0)); } EOF -if { (eval echo configure:9519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs4=yes else @@ -9542,7 +9546,7 @@ fi if test $space = no; then # 4.4BSD and NetBSD echo $ac_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)""... $ac_c" 1>&6 -echo "configure:9546: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 +echo "configure:9550: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_fsize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9550,7 +9554,7 @@ else fu_cv_sys_stat_statfs2_fsize=no else cat > conftest.$ac_ext < #ifdef HAVE_SYS_PARAM_H @@ -9566,7 +9570,7 @@ else exit (statfs (".", &fsd)); } EOF -if { (eval echo configure:9570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs2_fsize=yes else @@ -9593,7 +9597,7 @@ fi if test $space = no; then # Ultrix echo $ac_n "checking for two-argument statfs with struct fs_data (Ultrix)""... $ac_c" 1>&6 -echo "configure:9597: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 +echo "configure:9601: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 if eval "test \"`echo '$''{'fu_cv_sys_stat_fs_data'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9601,7 +9605,7 @@ else fu_cv_sys_stat_fs_data=no else cat > conftest.$ac_ext < #ifdef HAVE_SYS_PARAM_H @@ -9621,7 +9625,7 @@ else exit (statfs (".", &fsd) != 1); } EOF -if { (eval echo configure:9625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_fs_data=yes else @@ -9655,7 +9659,7 @@ fi # echo "checking if large file support can be enabled" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes else @@ -9693,11 +9697,11 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "configure OK"; else diff --git a/source/configure.in b/source/configure.in index dad63888472..1078905ad08 100644 --- a/source/configure.in +++ b/source/configure.in @@ -898,8 +898,21 @@ if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then AC_DEFINE(HAVE_FCNTL_LOCK) fi -AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[ -AC_TRY_RUN([ +AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[ +AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"], + samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)]) +if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then + AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS) + +else + +dnl +dnl Don't check for 64 bit fcntl locking if we know that the +dnl glibc2.1 broken check has succeeded. +dnl + + AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[ + AC_TRY_RUN([ #if defined(HAVE_UNISTD_H) #include #endif @@ -921,15 +934,10 @@ exit(1); #endif }], samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)]) -if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then - AC_DEFINE(HAVE_STRUCT_FLOCK64) -fi -AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[ -AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"], - samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)]) -if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then - AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS) + if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_FLOCK64) + fi fi AC_CACHE_CHECK([for sysv ipc],samba_cv_HAVE_SYSV_IPC,[ diff --git a/source/tests/fcntl_lock.c b/source/tests/fcntl_lock.c index 0e292fac99f..6894ebfd661 100644 --- a/source/tests/fcntl_lock.c +++ b/source/tests/fcntl_lock.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) unlink(DATA); #if defined(WIFEXITED) && defined(WEXITSTATUS) - if(WIFEXITED(status) == 0) { + if(WIFEXITED(status)) { status = WEXITSTATUS(status); } else { status = 1; diff --git a/source/tests/fcntl_lock64.c b/source/tests/fcntl_lock64.c index 6fb411aa2a4..b15743cb691 100644 --- a/source/tests/fcntl_lock64.c +++ b/source/tests/fcntl_lock64.c @@ -27,7 +27,7 @@ static int sys_waitpid(pid_t pid,int *status,int options) #endif /* USE_WAITPID */ } -#define DATA "conftest.fcntl" +#define DATA "conftest.fcntl64" /* lock a byte range in a open file */ int main(int argc, char *argv[]) @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) sys_waitpid(pid, &status, 0); #if defined(WIFEXITED) && defined(WEXITSTATUS) - if(WIFEXITED(status) == 0) { + if(WIFEXITED(status)) { status = WEXITSTATUS(status); } else { status = 1; -- cgit v1.2.1