-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
52 lines (43 loc) · 1.35 KB
/
config.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
dnl mrloop extension for PHP (c) 2024 Lochemem Bruno Michael
dnl PHP_ARG_ENABLE([mrloop],
dnl [for mrloop support],
dnl [AS_HELP_STRING([--enable-mrloop],
dnl [include mrloop support])])
PHP_ARG_WITH([mrloop],
[for mrloop library],
[AS_HELP_STRING([--with-mrloop],
[specify path to mrloop library])],
[no])
if test "$PHP_MRLOOP" != "no"; then
dnl add PHP version check
PHP_VERSION=$($PHP_CONFIG --vernum)
AC_MSG_CHECKING([PHP version])
if test $PHP_VERSION -lt 80100; then
AC_MSG_ERROR([ext-mrloop requires PHP 8.1+])
else
AC_MSG_RESULT([ok])
fi
HEADER_INSTALL_DIRS="/usr/local/lib /usr/lib"
URING_OBJ="liburing.so"
AC_MSG_CHECKING([for liburing object file])
for iter in $HEADER_INSTALL_DIRS; do
if test -s "$iter/$URING_OBJ"; then
URING_SO="$iter/$URING_OBJ"
AC_MSG_RESULT(found $URING_SO)
fi
done
if test -z "$URING_SO"; then
AC_MSG_RESULT(liburing is not properly installed)
AC_MSG_ERROR(Please install liburing)
fi
AC_MSG_CHECKING([for mrloop package])
if test -s "$PHP_MRLOOP/mrloop.c"; then
AC_MSG_RESULT(found mrloop package)
else
AC_MSG_RESULT(mrloop is not downloaded)
AC_MSG_ERROR(Please download mrloop)
fi
CFLAGS="-g -O3 -luring -I$PHP_MRLOOP/"
AC_DEFINE(HAVE_MRLOOP, 1, [ Have mrloop support ])
PHP_NEW_EXTENSION(mrloop, php_mrloop.c, $ext_shared)
fi