Edit extension compile by c++

Esse commit está contido em:
hihozhou
2017-05-08 15:07:45 +08:00
commit c6cc354399
5 arquivos alterados com 43 adições e 12 exclusões
+25
Ver Arquivo
@@ -0,0 +1,25 @@
## 安装和使用
### 下载
```bash
git clone https://github.com/hihozhou/php-opencv.git
```
### 编译安装
```bash
cd php-opencv
phpize
./configure --with-php-config=your php-config path
make
make install
```
### 修改php.ini
```
extension="opencv.so路径"
```
##开发计划
+4 -2
Ver Arquivo
@@ -57,7 +57,9 @@ if test "$PHP_OPENCV" != "no"; then
dnl -L$OPENCV_DIR/$PHP_LIBDIR -lm
dnl ])
dnl
dnl PHP_SUBST(OPENCV_SHARED_LIBADD)
PHP_NEW_EXTENSION(opencv, opencv.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_REQUIRE_CXX()
PHP_SUBST(OPENCV_SHARED_LIBADD)
PHP_ADD_LIBRARY(stdc++, 1, OPENCV_SHARED_LIBADD)
PHP_NEW_EXTENSION(opencv, opencv.cc, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi
+1 -1
Ver Arquivo
@@ -8,6 +8,6 @@
// ARG_ENABLE("opencv", "enable opencv support", "no");
if (PHP_OPENCV != "no") {
EXTENSION("opencv", "opencv.c", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION("opencv", "opencv.cc", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
}
+2
Ver Arquivo
@@ -18,6 +18,7 @@
/* $Id$ */
extern "C" {
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -25,6 +26,7 @@
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
}
#include "php_opencv.h"
/* If you declare any globals in php_opencv.h uncomment this:
+2
Ver Arquivo
@@ -34,9 +34,11 @@ extern zend_module_entry opencv_module_entry;
# define PHP_OPENCV_API
#endif
extern "C" {
#ifdef ZTS
#include "TSRM.h"
#endif
}
/*
Declare any global variables you may need between the BEGIN