forked from php-extension-research/study
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
88 lines (74 loc) · 2.6 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
PHP_ARG_ENABLE(study, whether to enable study support,
Make sure that the comment is aligned:
[ --enable-study Enable study support])
# AC_CANONICAL_HOST
if test "$PHP_STUDY" != "no"; then
# PHP_ADD_LIBRARY_WITH_PATH(uv, /usr/local/lib/, STUDY_SHARED_LIBADD)
# PHP_SUBST(STUDY_SHARED_LIBADD)
PHP_ADD_LIBRARY(pthread)
STUDY_ASM_DIR="thirdparty/boost/asm/"
CFLAGS="-Wall -pthread $CFLAGS"
AS_CASE([$host_os],
[linux*], [STUDY_OS="LINUX"],
[]
)
AS_CASE([$host_cpu],
[x86_64*], [STUDY_CPU="x86_64"],
[x86*], [STUDY_CPU="x86"],
[i?86*], [STUDY_CPU="x86"],
[arm*], [STUDY_CPU="arm"],
[aarch64*], [STUDY_CPU="arm64"],
[arm64*], [STUDY_CPU="arm64"],
[]
)
if test "$STUDY_CPU" = "x86_64"; then
if test "$STUDY_OS" = "LINUX"; then
STUDY_CONTEXT_ASM_FILE="x86_64_sysv_elf_gas.S"
fi
elif test "$STUDY_CPU" = "x86"; then
if test "$STUDY_OS" = "LINUX"; then
STUDY_CONTEXT_ASM_FILE="i386_sysv_elf_gas.S"
fi
elif test "$STUDY_CPU" = "arm"; then
if test "$STUDY_OS" = "LINUX"; then
STUDY_CONTEXT_ASM_FILE="arm_aapcs_elf_gas.S"
fi
elif test "$STUDY_CPU" = "arm64"; then
if test "$STUDY_OS" = "LINUX"; then
STUDY_CONTEXT_ASM_FILE="arm64_aapcs_elf_gas.S"
fi
elif test "$STUDY_CPU" = "mips32"; then
if test "$STUDY_OS" = "LINUX"; then
STUDY_CONTEXT_ASM_FILE="mips32_o32_elf_gas.S"
fi
fi
study_source_file="\
study.cc \
study_coroutine.cc \
study_coroutine_util.cc \
src/coroutine/coroutine.cc \
src/coroutine/context.cc \
${STUDY_ASM_DIR}make_${STUDY_CONTEXT_ASM_FILE} \
${STUDY_ASM_DIR}jump_${STUDY_CONTEXT_ASM_FILE} \
src/socket.cc \
src/log.cc \
src/error.cc \
src/core/base.cc \
src/coroutine/socket.cc \
src/timer.cc \
study_coroutine_channel.cc \
src/coroutine/channel.cc \
study_coroutine_socket.cc \
study_coroutine_server.cc \
study_runtime.cc
"
PHP_NEW_EXTENSION(study, $study_source_file, $ext_shared, ,, cxx)
PHP_ADD_INCLUDE([$ext_srcdir])
PHP_ADD_INCLUDE([$ext_srcdir/include])
PHP_INSTALL_HEADERS([ext/study], [*.h config.h include/*.h thirdparty/*.h])
PHP_REQUIRE_CXX()
CXXFLAGS="$CXXFLAGS -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations"
CXXFLAGS="$CXXFLAGS -std=c++11"
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/boost)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/boost/asm)
fi