On Mon, Mar 25, 2013 at 4:11 AM, Stanislav Malyshev <s...@php.net> wrote:

> Commit:    385d0e52cc527393269a48f2fdd01aa1541b4e1f
> Author:    Stanislav Malyshev <s...@php.net>         Sun, 24 Mar 2013
> 20:11:28 -0700
> Parents:   504ef64c7b7c716841f65b5e7415378b2b27526a
> Branches:  PHP-5.5 master
>
> Link:
> http://git.php.net/?p=php-src.git;a=commitdiff;h=385d0e52cc527393269a48f2fdd01aa1541b4e1f
>
> Log:
> add code to check if we know flock definition on this system
>
> In order to configure detect it and not fail the compile.
> Not an ideal solution, suggestions are welcome on how to improve it.
>
> Changed paths:
>   M  ext/opcache/config.m4
>
>
> Diff:
> diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
> index cbf7d5a..70cd4e9 100644
> --- a/ext/opcache/config.m4
> +++ b/ext/opcache/config.m4
> @@ -325,6 +325,39 @@ int main() {
>      AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM
> support])
>      msg=yes,msg=no,msg=no)
>    AC_MSG_RESULT([$msg])
> +
> +  AC_MSG_CHECKING(for known struct flock definition)
> +  dnl Copied from ZendAccelerator.h
> +  AC_TRY_RUN([
> +#include <fcntl.h>
> +#include <stdlib.h>
> +
> +#ifndef ZEND_WIN32
> +extern int lock_file;
> +
> +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ||
> (defined(__APPLE__) && defined(__MACH__)/* Darwin */) ||
> defined(__OpenBSD__) || defined(__NetBSD__)
> +#  define FLOCK_STRUCTURE(name, type, whence, start, len) \
> +                struct flock name = {start, len, -1, type, whence}
> +# elif defined(__svr4__)
> +#  define FLOCK_STRUCTURE(name, type, whence, start, len) \
> +                struct flock name = {type, whence, start, len}
> +# elif defined(__linux__) || defined(__hpux)
> +#  define FLOCK_STRUCTURE(name, type, whence, start, len) \
> +                struct flock name = {type, whence, start, len, 0}
> +# elif defined(_AIX)
> +#  if defined(_LARGE_FILES) || defined(__64BIT__)
> +#   define FLOCK_STRUCTURE(name, type, whence, start, len) \
> +                struct flock name = {type, whence, 0, 0, 0, start, len }
> +#  else
> +#   define FLOCK_STRUCTURE(name, type, whence, start, len) \
> +                struct flock name = {type, whence, start, len}
> +#  endif
> +# else
> +#  error "Don't know how to define struct flock"
> +# endif
> +#endif
> +void main() {}
> +], [], [AC_MSG_ERROR([Don't know how to define struct flock on this
> system[,] set --enable-opcache=no])], [])
>
>    PHP_NEW_EXTENSION(opcache,
>         ZendAccelerator.c \
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
after this commit I was getting
Don't know how to define struct flock on this system, set
--enable-opcache=no
on my ubuntu test vm

replacing
void main() {}
with
int main() {return 0;}
solves the problem for me.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to