5 Star 58 Fork 4

swoole / phpy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.m4 2.30 KB
一键复制 编辑 原始数据 按行查看 历史
Rango 提交于 2024-01-23 20:04 . Fix #40
dnl $Id$
dnl config.m4 for extension phpy
PHP_ARG_WITH([python_dir],
[dir of python],
[AS_HELP_STRING([[--with-python-dir[=DIR]]],
[Specify python installation dir, default is /opt/anaconda3])], [no], [no])
PHP_ARG_WITH([python_version],
[version of python],
[AS_HELP_STRING([[--with-python-version[=VERSION]]],
[Specify version of python, default is 3.11])], [no], [no])
PHP_ARG_WITH([python_config],
[path of python_config],
[AS_HELP_STRING([[--with-python-config[=PATH]]],
[Specify path of python_config])], [no], [no])
PHP_ARG_ENABLE([phpy],
[whether to enable phpy support],
[AS_HELP_STRING([--enable-phpy],
[Enable phpy support])],
[no])
if test "$PHP_PHPY" != "no"; then
if test "$PHP_PYTHON_CONFIG" != "no"; then
INCLUDES="$INCLUDES $($PHP_PYTHON_CONFIG --includes)"
LDFLAGS="$LDFLAGS $($PHP_PYTHON_CONFIG --embed --ldflags)"
else
if test "$PHP_PYTHON_DIR" = "no"; then
PHP_PYTHON_DIR="/opt/anaconda3"
fi
if test "$PHP_PYTHON_VERSION" = "no"; then
if test -f "${PHP_PYTHON_DIR}/bin/python"; then
PHP_PYTHON_VERSION=$("${PHP_PYTHON_DIR}/bin/python" -c "import sys; print('%d.%d'%(sys.version_info.major, sys.version_info.minor))")
elif test -f "${PHP_PYTHON_DIR}/python"; then
PHP_PYTHON_VERSION=$("${PHP_PYTHON_DIR}/python" -c "import sys; print('%d.%d'%(sys.version_info.major, sys.version_info.minor))")
else
PHP_PYTHON_VERSION="3.11"
fi
fi
AC_MSG_RESULT([PYTHON_DIR=${PHP_PYTHON_DIR}])
AC_MSG_RESULT([PYTHON_VERSION=${PHP_PYTHON_VERSION}])
PHP_ADD_INCLUDE("${PHP_PYTHON_DIR}/include/python${PHP_PYTHON_VERSION}")
PHP_ADD_LIBRARY_WITH_PATH("python${PHP_PYTHON_VERSION}", "${PHP_PYTHON_DIR}/lib", PHPY_SHARED_LIBADD)
fi
PHP_REQUIRE_CXX()
PHP_ADD_LIBRARY(stdc++, 1, PHPY_SHARED_LIBADD)
PHP_SUBST(PHPY_SHARED_LIBADD)
AC_DEFINE(HAVE_PHPY, 1, [ Have phpy support ])
CXXFLAGS="$CXXFLAGS -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -z now"
CXXFLAGS="$CXXFLAGS -std=c++14"
if test -f "phpy.cc"; then
phpy_source_dir=$(pwd)
else
phpy_source_dir="ext/phpy"
fi
phpy_source_files=$(cd $phpy_source_dir && find src -type f -name "*.cc")
phpy_source_files="phpy.cc $phpy_source_files"
PHP_NEW_EXTENSION(phpy, $phpy_source_files , $ext_shared)
fi
1
https://gitee.com/swoole/phpy.git
git@gitee.com:swoole/phpy.git
swoole
phpy
phpy
main

搜索帮助