-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathconfigure
executable file
·75 lines (60 loc) · 2.14 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
#!/usr/bin/env bash
set -e
set -o pipefail
set -u
if [ `uname -s` = 'Darwin' ]; then
MASON_PLATFORM=${MASON_PLATFORM:-osx}
else
MASON_PLATFORM=${MASON_PLATFORM:-linux}
fi
function finish {
>&2 echo -en "\033[0m";
}
trap finish EXIT
# Install mason
if [ ! -f .mason/mason ] ; then
if [ ! -d .git ] ; then curl -L https://github.com/mapbox/mason/archive/master.tar.gz | tar -xzf- && mv mason-master .mason
else git submodule update --init .mason ; fi
fi
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
function quote_flags {
python -c "import sys, re; print filter(None, re.split('(?<!-framework)\s+', ' '.join(sys.argv[1:])))" "$@"
}
LN=$'\n'
CONFIG="# Do not edit. Generated by the configure script.
{
'target_defaults': {
'cflags%': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []
},
'variables': {
"
CONFIG+=" 'install_prefix%': '${INSTALL_PREFIX:-/usr/local}',"$LN
RAPIDJSON_VERSION=1.0.2
mason install rapidjson ${RAPIDJSON_VERSION}
CONFIG+=" 'rapidjson_cflags%': $(quote_flags $(mason cflags rapidjson ${RAPIDJSON_VERSION})),"$LN
VARIANT_VERSION=1.0
mason install variant ${VARIANT_VERSION}
CONFIG+=" 'variant_cflags%': $(quote_flags $(mason cflags variant ${VARIANT_VERSION})),"$LN
if [[ ${MASON_PLATFORM:-} == 'osx' || ${MASON_PLATFORM:-} == 'linux' ]] ; then
GTEST_VERSION=1.7.0
mason install gtest ${GTEST_VERSION}
CONFIG+=" 'gtest%': 1,"$LN
CONFIG+=" 'gtest_static_libs%': $(quote_flags $(mason static_libs gtest ${GTEST_VERSION})),"$LN
CONFIG+=" 'gtest_cflags%': $(quote_flags $(mason cflags gtest ${GTEST_VERSION})),"$LN
CONFIG+=" 'gtest_ldflags%': $(quote_flags $(mason ldflags gtest ${GTEST_VERSION})),"$LN
GLFW_VERSION=3.1
mason install glfw ${GLFW_VERSION}
CONFIG+=" 'glfw%': 1,"$LN
CONFIG+=" 'glfw_static_libs%': $(quote_flags $(mason static_libs glfw ${GLFW_VERSION})),"$LN
CONFIG+=" 'glfw_cflags%': $(quote_flags $(mason cflags glfw ${GLFW_VERSION})),"$LN
CONFIG+=" 'glfw_ldflags%': $(quote_flags $(mason ldflags glfw ${GLFW_VERSION})),"$LN
fi
CONFIG+=" }
}
"
echo "${CONFIG}" > config.gypi
cat config.gypi