@@ -326,38 +326,42 @@ int main() {
326
326
msg=yes ,msg=no ,msg=no )
327
327
AC_MSG_RESULT ( [ $msg] )
328
328
329
- AC_MSG_CHECKING ( for known struct flock definition )
330
- dnl Copied from ZendAccelerator.h
331
- AC_TRY_RUN ( [
332
- #include <fcntl.h>
333
- #include <stdlib.h>
334
-
335
- #ifndef ZEND_WIN32
336
- extern int lock_file;
337
-
338
- # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (defined(__APPLE__) && defined(__MACH__)/* Darwin */) || defined(__OpenBSD__) || defined(__NetBSD__)
339
- # define FLOCK_STRUCTURE(name, type, whence, start, len) \
340
- struct flock name = {start, len, -1, type, whence}
341
- # elif defined(__svr4__)
342
- # define FLOCK_STRUCTURE(name, type, whence, start, len) \
343
- struct flock name = {type, whence, start, len}
344
- # elif defined(__linux__) || defined(__hpux)
345
- # define FLOCK_STRUCTURE(name, type, whence, start, len) \
346
- struct flock name = {type, whence, start, len, 0}
347
- # elif defined(_AIX)
348
- # if defined(_LARGE_FILES) || defined(__64BIT__)
349
- # define FLOCK_STRUCTURE(name, type, whence, start, len) \
350
- struct flock name = {type, whence, 0, 0, 0, start, len }
351
- # else
352
- # define FLOCK_STRUCTURE(name, type, whence, start, len) \
353
- struct flock name = {type, whence, start, len}
354
- # endif
355
- # else
356
- # error "Don't know how to define struct flock"
357
- # endif
358
- #endif
359
- int main() { return 0; }
360
- ] , [ ] , [ AC_MSG_ERROR ( [ Don't know how to define struct flock on this system[ ,] set --enable-opcache=no] ) ] , [ ] )
329
+ flock_type=unknown
330
+ AC_MSG_CHECKING ( "whether flock struct is linux ordered" )
331
+ AC_TRY_RUN ( [
332
+ #include <fcntl.h>
333
+ struct flock lock = { 1, 2, 3, 4, 5 };
334
+ int main() {
335
+ if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
336
+ return 0;
337
+ }
338
+ return 1;
339
+ }
340
+ ] , [
341
+ flock_type=linux
342
+ AC_DEFINE ( [ HAVE_FLOCK_LINUX] , [ ] , [ Struct flock is Linux-type] )
343
+ AC_MSG_RESULT ( "yes" )
344
+ ] , AC_MSG_RESULT ( "no" ) )
345
+
346
+ AC_MSG_CHECKING ( "whether flock struct is BSD ordered" )
347
+ AC_TRY_RUN ( [
348
+ #include <fcntl.h>
349
+ struct flock lock = { 1, 2, 3, 4, 5 };
350
+ int main() {
351
+ if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
352
+ return 0;
353
+ }
354
+ return 1;
355
+ }
356
+ ] , [
357
+ flock_type=bsd
358
+ AC_DEFINE ( [ HAVE_FLOCK_BSD] , [ ] , [ Struct flock is BSD-type] )
359
+ AC_MSG_RESULT ( "yes" )
360
+ ] , AC_MSG_RESULT ( "no" ) )
361
+
362
+ if test "$flock_type" == "unknown"; then
363
+ AC_MSG_ERROR ( [ Don't know how to define struct flock on this system[ ,] set --enable-opcache=no] )
364
+ fi
361
365
362
366
PHP_NEW_EXTENSION(opcache,
363
367
ZendAccelerator.c \
0 commit comments