]> granicus.if.org Git - python/commitdiff
Configuration test for working getc_unlocked() (and flockfile() and
authorGuido van Rossum <guido@python.org>
Fri, 5 Jan 2001 14:45:49 +0000 (14:45 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 5 Jan 2001 14:45:49 +0000 (14:45 +0000)
funlockfile()).

acconfig.h
config.h.in
configure
configure.in

index 7b34041a26e303212f8d7ddb8be6c21d28bae5b2..1a75fe285368e2d341121687989d18ccb19569b6 100644 (file)
@@ -32,6 +32,9 @@
 /* Define this if your time.h defines altzone */
 #undef HAVE_ALTZONE
 
+/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
+#undef HAVE_GETC_UNLOCKED
+
 /* Define this if you have gethostbyname() */
 #undef HAVE_GETHOSTBYNAME
 
index 6b503febca80933121064dff2b94734fcd1efd1f..f7f886b2843e5c53216db0149013e1dbfc94207d 100644 (file)
@@ -97,6 +97,9 @@
 /* Define this if your time.h defines altzone */
 #undef HAVE_ALTZONE
 
+/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
+#undef HAVE_GETC_UNLOCKED
+
 /* Define this if you have some version of gethostbyname_r() */
 #undef HAVE_GETHOSTBYNAME_R
 
index ea54b75afa2f7c6ccc62c6624e54e31d86f914b6..4256bc42079173919f5b40904dbf21e9252663fe 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# From configure.in Revision: 1.180 
+# From configure.in Revision: 1.182 
 
 # Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version 2.13 
@@ -5948,6 +5948,46 @@ EOF
 
 fi
 
+# check for getc_unlocked and related locking functions
+echo $ac_n "checking for getc_unlocked() and friends""... $ac_c" 1>&6
+echo "configure:5954: checking for getc_unlocked() and friends" >&5
+if eval "test \"`echo '$''{'ac_cv_have_getc_unlocked'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 5960 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+
+       FILE *f = fopen("/dev/null", "r");
+       flockfile(f);
+       getc_unlocked(f);
+       funlockfile(f);
+
+; return 0; }
+EOF
+if { (eval echo configure:5972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_have_getc_unlocked=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_have_getc_unlocked=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_have_getc_unlocked" 1>&6
+if test "$ac_cv_have_getc_unlocked" = yes
+then
+  cat >> confdefs.h <<\EOF
+#define HAVE_GETC_UNLOCKED 1
+EOF
+
+fi
 
 # THIS MUST BE LAST, IT CAN BREAK OTHER TESTS!
 # Add sys/socket.h to confdefs.h
@@ -5957,12 +5997,12 @@ cat >> confdefs.h <<\EOF
 #endif
 EOF
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:5961: checking for socklen_t" >&5
+echo "configure:6001: checking for socklen_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5966 "configure"
+#line 6006 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -5991,7 +6031,7 @@ fi
 
 
 echo $ac_n "checking for Modules/Setup""... $ac_c" 1>&6
-echo "configure:5995: checking for Modules/Setup" >&5
+echo "configure:6035: checking for Modules/Setup" >&5
 if test ! -f Modules/Setup ; then
     if test ! -d Modules ; then
         mkdir Modules
index 07072c504b7a4e57dc5ac75351dfcc061f90673b..77ab0a3a88f0b6997d28c047a7d1df079c3ce99c 100644 (file)
@@ -1291,6 +1291,20 @@ then
   AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS)
 fi
 
+# check for getc_unlocked and related locking functions
+AC_MSG_CHECKING(for getc_unlocked() and friends)
+AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
+AC_TRY_LINK([#include <stdio.h>],[
+       FILE *f = fopen("/dev/null", "r");
+       flockfile(f);
+       getc_unlocked(f);
+       funlockfile(f);
+], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)])
+AC_MSG_RESULT($ac_cv_have_getc_unlocked)
+if test "$ac_cv_have_getc_unlocked" = yes
+then
+  AC_DEFINE(HAVE_GETC_UNLOCKED)
+fi
 
 # THIS MUST BE LAST, IT CAN BREAK OTHER TESTS!
 # Add sys/socket.h to confdefs.h