forked from niw/iphone_opencv_test
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfigure_opencv
More file actions
executable file
·96 lines (92 loc) · 2.99 KB
/
configure_opencv
File metadata and controls
executable file
·96 lines (92 loc) · 2.99 KB
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
89
90
91
92
93
94
95
96
#!/bin/sh
if [ "$1" = "--help" -o "$1" = "-h" ]; then
echo "Usage: $0 [Options | Configure Options] [Enviroment Variables]"
echo ""
echo "OPTIONS"
echo " -h, --help Show this guide"
echo " -c, --configure-help Show configure help for configure options"
echo ""
echo "ENVIROMENT VARIABLES"
echo " SDK_VERION Select iPhone SDK Version (2.0, 2.1, 2.2, 2.2.1, 3.0, 3.1, 3.1.2 and more)"
echo " Default = 3.1.2"
echo " GCC_VERSION Select GCC Version (4.0 for SDK 2.x, 3.x, 4.2 for SDK 3.x and more)"
echo " Default = 4.0 for SDK 2.x, 4.2 for SDK 3.x"
echo " ARCH Select target architecture (device or simulator)"
echo " Default = simulator"
echo " CONFIGURE Path to configure script"
echo " Default = ../configure"
echo ""
echo "EXAMPLES"
echo " % $0 Making OpenCV with SDK3.1.2 using GCC4.2 for iPhone simulator"
echo " % $0 GCC_VERISON=4.0 ARCH=device Making OpenCV with SDK3.1.2 using GCC4.0 for iPhone device"
echo " % $0 SDK_VERISON=3.0 ARCH=device Making OpenCV with SDK3.0 using GCC4.2 for iPhone device"
echo " % $0 SDK_VERSION=2.2.1 Making OpenCV with SDK2.2.1 using GCC4.0 for iPhone simulator"
exit
fi
if [ -z "${CONFIGURE}" ]; then
CONFIGURE=../configure
fi
if [ ! -e "${CONFIGURE}" ]; then
echo "Missing '${CONFIGURE}', please set the path to configure by CONFIGURE enviroment variable."
exit 1
fi
if [ "$1" = "--configure-help" -o "$1" = "-c" ]; then
${CONFIGURE} --help
exit
fi
if [ -z "${SDK_VERSION}" ]; then
SDK_VERSION=3.1.2
fi
if [ -z "${GCC_VERSION}" ]; then
if [ `expr ${SDK_VERSION} \\>= 3.0` = '1' ]; then
GCC_VERSION=4.2
else
GCC_VERSION=4.0
fi
fi
if [ -z "${ARCH}" ]; then
ARCH=simulator
fi
if [ "${ARCH}" = "simulator" ]; then
ARCH_SDKNAME=Simulator
ARCH_FLAG="-arch i686 -mmacosx-version-min=10.5"
ARCH_HOST=i686-apple-darwin9
elif [ "${ARCH}" = "device" ]; then
ARCH_SDKNAME=OS
ARCH_FLAG="-arch armv6 -miphoneos-version-min=${SDK_VERSION}"
ARCH_HOST=arm-apple-darwin9
else
echo "Please select target architecture with ARCH enviroment variable (simulator or device)."
exit 1
fi
echo "Use iPhone SDK ${SDK_VERSION}(gcc ${GCC_VERSION}) for ${ARCH}"
PLATFORM=/Developer/Platforms/iPhone${ARCH_SDKNAME}.platform
BIN=${PLATFORM}/Developer/usr/bin
SDK=${PLATFORM}/Developer/SDKs/iPhone${ARCH_SDKNAME}${SDK_VERSION}.sdk
PREFIX=`pwd`/`dirname $0`/opencv_${ARCH}
PATH=/bin:/sbin:/usr/bin:/usr/sbin:${BIN}
${CONFIGURE} \
--prefix=${PREFIX} \
--build=i686-apple-darwin \
--host=${ARCH_HOST} \
--enable-static \
--disable-shared \
--disable-sse \
--disable-apps \
--without-python \
--without-ffmpeg \
--without-1394libs \
--without-v4l \
--without-imageio \
--without-quicktime \
--without-carbon \
--without-gtk \
--without-gthread \
$* \
CC=${BIN}/gcc-${GCC_VERSION} \
CXX=${BIN}/g++-${GCC_VERSION} \
CFLAGS="${ARCH_FLAG} -isysroot ${SDK}" \
CXXFLAGS="${ARCH_FLAG} -isysroot ${SDK}" \
CPP=${BIN}/cpp \
CXXCPP=${BIN}/cpp \
AR=${BIN}/ar