]> granicus.if.org Git - php/commitdiff
make HAVE_FOPENCOOKIE available for other extensions besides zlib
authorHartmut Holzgraefe <hholzgra@php.net>
Tue, 21 Nov 2000 08:38:20 +0000 (08:38 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Tue, 21 Nov 2000 08:38:20 +0000 (08:38 +0000)
acinclude.m4
ext/zlib/config.m4

index c10e1b8a3cc615a0cf8d03f72304880405078c82..9f68ecf3fe8fcd6c2c8f2754e27178083e5501d3 100644 (file)
@@ -883,3 +883,42 @@ int main(void) {
   fi
 ])
 
+AC_DEFUN(PHP_FOPENCOOKIE,[
+       AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
+
+       if test "$have_glibc_fopencookie" = "yes" ; then
+               dnl this comes in two flavors:
+      dnl newer glibcs (since 2.1.2 ? )
+      dnl have a type called cookie_io_functions_t
+                 AC_TRY_COMPILE([ #define _GNU_SOURCE
+                       #include <stdio.h>
+                                                                          ],
+                          [ cookie_io_functions_t cookie; ],
+                     [ have_cookie_io_functions_t=yes ],
+                                                                                [ ] )
+
+                 if test "$have_cookie_io_functions_t" = "yes" ; then
+        cookie_io_functions_t=cookie_io_functions_t
+             have_fopen_cookie=yes
+      else
+           dnl older glibc versions (up to 2.1.2 ?)
+        dnl call it _IO_cookie_io_functions_t
+                   AC_TRY_COMPILE([ #define _GNU_SOURCE
+                       #include <stdio.h>
+                                                                          ],
+                          [ _IO_cookie_io_functions_t cookie; ],
+                     [ have_IO_cookie_io_functions_t=yes ],
+                                                                                [] )
+                   if test "$have_cookie_io_functions_t" = "yes" ; then
+          cookie_io_functions_t=_IO_cookie_io_functions_t
+               have_fopen_cookie=yes
+                   fi
+                       fi
+
+                 if test "$have_fopen_cookie" = "yes" ; then
+                   AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ])
+                         AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ])
+      fi      
+
+       fi
+])
index 86a7106ebdbf5816fbfb0152427cd7113098b881..5ce12873584ccb5d49677aa5fa1ce6777a36d7ff 100644 (file)
@@ -42,43 +42,5 @@ if test "$PHP_ZLIB" != "no"; then
   
   AC_ADD_INCLUDE($ZLIB_INCDIR)
 
-       dnl check for fopencookie() from glibc
-       AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
-
-       if test "$have_glibc_fopencookie" = "yes" ; then
-               dnl this comes in two flavors:
-      dnl newer glibcs (since 2.1.2 ? )
-      dnl have a type called cookie_io_functions_t
-                 AC_TRY_COMPILE([ #define _GNU_SOURCE
-                       #include <stdio.h>
-                                                                          ],
-                          [ cookie_io_functions_t cookie; ],
-                     [ have_cookie_io_functions_t=yes ],
-                                                                                [ ] )
-
-                 if test "$have_cookie_io_functions_t" = "yes" ; then
-        cookie_io_functions_t=cookie_io_functions_t
-             have_fopen_cookie=yes
-      else
-           dnl older glibc versions (up to 2.1.2 ?)
-        dnl call it _IO_cookie_io_functions_t
-                   AC_TRY_COMPILE([ #define _GNU_SOURCE
-                       #include <stdio.h>
-                                                                          ],
-                          [ _IO_cookie_io_functions_t cookie; ],
-                     [ have_IO_cookie_io_functions_t=yes ],
-                                                                                [] )
-                   if test "$have_cookie_io_functions_t" = "yes" ; then
-          cookie_io_functions_t=_IO_cookie_io_functions_t
-               have_fopen_cookie=yes
-                   fi
-                       fi
-
-                 if test "$have_fopen_cookie" = "yes" ; then
-                   AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ])
-                         AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ])
-      fi      
-
-       fi
-
+  PHP_FOPENCOOKIE
 fi