-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·101 lines (74 loc) · 1.29 KB
/
configure
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
97
98
99
100
101
#!/bin/sh
set -e
build_dir=$PWD
cd $(dirname $0)
prefix=$HOME
CMAKE_BUILD_TYPE=DEBUG
VERBOSE=0
usage()
{
echo "
usage : $0 [options]
--prefix=/path/to/install ( default: ${HOME} )
-d|--debug ( default )
-r|--release
-v|--verbose
-rs|--minsize_release
-ru|--release_unstripped
--ekopath
--clang
--check_memory
" >&2
}
CMAKE_DEFINES=""
while [ $# -gt 0 ]
do
echo checking $1 option
case $1 in
--help)
usage
exit 0
;;
--prefix=*) prefix=${1#--prefix=}
if [ -z $prefix ] ; then echo "prefix is missing"; exit 1 ; fi
;;
--prefix)
shift
if [ -z $1 ] ; then echo "prefix is missing"; exit 1 ; fi
prefix=$1
;;
-d|--debug)
CMAKE_BUILD_TYPE=DEBUG
;;
-r|--release)
CMAKE_BUILD_TYPE=RELEASE
;;
-ru|--release_unstripped)
CMAKE_BUILD_TYPE=RELWITHDEBINFO
;;
-rs|--minsize_release)
CMAKE_BUILD_TYPE=MINSIZEREL
;;
-v|--verbose)
VERBOSE=1
;;
--ekopath)
export CC=pathcc
export CXX=pathCC
;;
--clang)
export CC=clang
export CXX=clang++
;;
--check_memory)
CMAKE_DEFINES="${CMAKE_DEFINES} -DEW_CHECK_MEMORY=1"
;;
*)
echo "warning unknow option $1" >&2
;;
esac
shift
done
src_dir=$PWD
cd $build_dir
cmake -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DCMAKE_VERBOSE_MAKEFILE="${VERBOSE}" -DCMAKE_INSTALL_PREFIX=$prefix ${CMAKE_DEFINES} $src_dir