Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
1de829c3
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1de829c3
编写于
9月 10, 2012
作者:
A
Alexander Smorkalov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
abi-compatibility-check tool configuration script for adnroid added.
上级
7d83db7d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
102 addition
and
0 deletion
+102
-0
android/scripts/ABI_compat_generator.py
android/scripts/ABI_compat_generator.py
+102
-0
未找到文件。
android/scripts/ABI_compat_generator.py
0 → 100755
浏览文件 @
1de829c3
#!/usr/bin/python
import
os
import
sys
ANDROID_SDK_PATH
=
"/opt/android-sdk-linux"
ANDROID_NDK_PATH
=
"/opt/android-ndk-r8"
INSTALL_DIRECTORY
=
"OpenCV-2.4.2-branch"
CLASS_PATH
=
os
.
path
.
join
(
INSTALL_DIRECTORY
,
"sdk/java/bin/classes"
);
TMP_HEADER_PATH
=
"tmp_include"
HEADER_EXTS
=
set
([
'h'
,
'hpp'
])
SYS_INCLUDES
=
[
"platforms/android-8/arch-arm/usr/include"
,
"sources/cxx-stl/gnu-libstdc++/include"
,
"sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"
]
PROJECT_NAME
=
"OpenCV-branch"
TARGET_LIBS
=
[
"libopencv_java.so"
]
ARCH
=
"armeabi"
GCC_OPTIONS
=
"-fpermissive"
EXCLUDE_HEADERS
=
set
([
"hdf5.h"
,
"eigen.hpp"
,
"cxeigen.hpp"
]);
def
FindClasses
(
root
,
prefix
):
classes
=
[]
if
(
""
!=
prefix
):
prefix
=
prefix
+
"."
for
path
in
os
.
listdir
(
root
):
currentPath
=
os
.
path
.
join
(
root
,
path
)
if
(
os
.
path
.
isdir
(
currentPath
)):
classes
+=
FindClasses
(
currentPath
,
prefix
+
path
)
else
:
name
=
str
.
split
(
path
,
"."
)[
0
]
ext
=
str
.
split
(
path
,
"."
)[
1
]
if
(
ext
==
"class"
):
#print("class: %s" % (prefix + name))
classes
.
append
(
prefix
+
name
)
return
classes
def
FindHeaders
(
root
):
headers
=
[]
for
path
in
os
.
listdir
(
root
):
currentPath
=
os
.
path
.
join
(
root
,
path
)
if
(
os
.
path
.
isdir
(
currentPath
)):
headers
+=
FindHeaders
(
currentPath
)
else
:
ext
=
str
.
split
(
path
,
"."
)[
-
1
]
#print("%s: \"%s\"" % (currentPath, ext))
if
(
ext
in
HEADER_EXTS
):
#print("Added as header file")
if
(
path
not
in
EXCLUDE_HEADERS
):
headers
.
append
(
currentPath
)
return
headers
outputFileName
=
PROJECT_NAME
+
".xml"
try
:
outputFile
=
open
(
outputFileName
,
"w"
)
except
:
print
(
"Error: Cannot open output file
\"
%s
\"
for writing"
%
outputFileName
)
allJavaClasses
=
FindClasses
(
CLASS_PATH
,
""
)
if
(
not
allJavaClasses
):
print
(
"Error: No Java classes found :("
)
exit
(
-
1
)
if
(
not
os
.
path
.
exists
(
TMP_HEADER_PATH
)):
os
.
makedirs
(
os
.
path
.
join
(
os
.
getcwd
(),
TMP_HEADER_PATH
))
print
(
"Generating JNI headers for Java API ..."
)
AndroidJavaDeps
=
os
.
path
.
join
(
ANDROID_SDK_PATH
,
"platforms/android-11/android.jar"
)
for
currentClass
in
allJavaClasses
:
os
.
system
(
"javah -d %s -classpath %s:%s %s"
%
(
TMP_HEADER_PATH
,
CLASS_PATH
,
AndroidJavaDeps
,
currentClass
))
print
(
"Building JNI headers list ..."
)
jniHeaders
=
FindHeaders
(
TMP_HEADER_PATH
)
#print(jniHeaders)
print
(
"Building Native OpenCV header list ..."
)
cHeaders
=
FindHeaders
(
os
.
path
.
join
(
INSTALL_DIRECTORY
,
"sdk/native/jni/include/opencv"
))
cppHeaders
=
FindHeaders
(
os
.
path
.
join
(
INSTALL_DIRECTORY
,
"sdk/native/jni/include/opencv2"
))
#print(cHeaders)
#print(cppHeaders)
print
(
"Writing config file ..."
)
outputFile
.
write
(
"<descriptor>
\n\n
<version>
\n\t
%s
\n
</version>
\n\n
<headers>
\n
"
%
PROJECT_NAME
)
outputFile
.
write
(
"
\t
"
+
"
\n\t
"
.
join
(
cHeaders
))
outputFile
.
write
(
"
\n\t
"
+
"
\n\t
"
.
join
(
cppHeaders
))
outputFile
.
write
(
"
\n\t
"
+
"
\n\t
"
.
join
(
jniHeaders
))
outputFile
.
write
(
"
\n
</headers>
\n\n
"
)
includes
=
[]
for
inc
in
SYS_INCLUDES
:
includes
.
append
(
os
.
path
.
join
(
ANDROID_NDK_PATH
,
inc
))
outputFile
.
write
(
"<include_paths>
\n\t
OpenCV-2.4.2-branch/sdk/native/jni/include
\n\t
OpenCV-2.4.2-branch/sdk/native/jni/include/opencv
\n\t
OpenCV-2.4.2-branch/sdk/native/jni/include/opencv2
\n
"
)
outputFile
.
write
(
"
\t
%s
\n
</include_paths>
\n\n
"
%
"
\n\t
"
.
join
(
includes
))
libraries
=
[]
for
lib
in
TARGET_LIBS
:
libraries
.
append
(
os
.
path
.
join
(
INSTALL_DIRECTORY
,
"sdk/native/libs"
,
ARCH
,
lib
))
outputFile
.
write
(
"<libs>
\n\t
%s
\n
</libs>
\n\n
"
%
"
\n\t
"
.
join
(
libraries
))
outputFile
.
write
(
"<gcc_options>
\n\t
%s
\n
</gcc_options>
\n\n
</descriptor>"
%
GCC_OPTIONS
)
print
(
"done!"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录