forked from vim/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure_vimenv
executable file
·124 lines (114 loc) · 2.99 KB
/
configure_vimenv
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env bash
PYTHON="--enable-python3interp"
OPTS="--enable-rubyinterp=dynamic \
--enable-tclinterp \
--enable-multibyte \
--enable-cscope"
DEBUG_FLAGS="-g -gdwarf-4 -DDEBUG -O0 -fno-omit-frame-pointer"
SAFETY_FLAGS='-DABORT_ON_INTERNAL_ERROR -DEXITFREE'
SANITISER_FLAGS='-fsanitize=address -fsanitize=undefined -fsanitize-recover=all'
LD=lld
export CFLAGS="${CFLAGS} -isystem /usr/local/include"
BREW_TCL=1
BREW_PYTHON=1
ENV_SUFFIX=""
PYTHON_TYPE=""
while [[ -n "$1" ]]; do
OPT=$1
shift
case "$OPT" in
"--help")
echo "Usage: $0 <options> -- <configure opts>"
echo ""
echo "Options:"
echo " --debug"
echo " --relwithdebinfo"
echo " --asan"
echo " --ubsan"
echo " --no-brew-python"
echo " --no-brew-tcl"
echo " --debug-python"
echo " --python2"
echo " --python3"
echo " --python2-python3"
echo " --python-type <auto/dynamic/static>"
echo " --no-python"
echo " --env3 - use vim-env3 (else use vim-env)"
echo ""
exit 0
;;
"--env3")
ENV_SUFFIX=3
;;
"--debug")
export CFLAGS="${CFLAGS} ${DEBUG_FLAGS}"
;;
"--relwithdebinfo")
export CFLAGS="${CFLAGS} -g -Og"
;;
"--develop")
export CFLAGS="${CFLAGS} ${DEBUG_FLAGS} ${SAFETY_FLAGS} ${SANITISER_FLAGS}"
export LIBS="${LIBS} ${DEBUG_FLAGS} ${SAFETY_FLAGS} ${SANITISER_FLAGS}"
;;
"--asan")
export CFLAGS="${CFLAGS} ${DEBUG_FLAGS} ${SAFETY_FLAGS} -fsanitize=address"
export LIBS="${DEBUG_FLAGS} ${SAFETY_FLAGS} -fsanitize=address"
;;
"--ubsan")
export CFLAGS="${CFLAGS} ${DEBUG_FLAGS} -${SAFETY_FLAGS} -fsanitize=undefined"
export LIBS="${DEBUG_FLAGS} ${SAFETY_FLAGS} -fsanitize=undefined"
;;
"--no-brew-python")
BREW_PYTHON=0
;;
"--no-brew-python")
BREW_TCL=0
;;
"--debug-python")
export CFLAGS="${CFLAGS} -DPy_DEBUG -DPy_DEBUG_NO_PYMALLOC"
BREW_PYTHON=0
OPTS="--enable-python3interp"
;;
"--python2")
PYTHON="--enable-pythoninterp"
;;
"--python3")
PYTHON="--enable-python3interp"
;;
"--python2-python3")
PYTHON="--enable-pythoninterp --enable-python3interp"
;;
"--python-type")
PYTHON_TYPE="=$1"
shift
;;
"--no-python")
PYTHON=""
;;
"--")
break
;;
*)
echo "Unknown option $OPT"
exit 1
;;
esac
done
echo "Additional args: "$@""
if [[ $BREW_PYTHON == 1 ]]; then
echo "Using homebrew python"
export PATH=$(brew --prefix python)/bin:${PATH}
fi
if [[ $BREW_TCL -eq 1 ]]; then
echo "Using homebrew TCL"
export PATH=$(brew --prefix tcl-tk)/bin:${PATH}
OPTS="${OPTS} --with-tclsh=tclsh"
fi
make distclean
./configure --prefix=/Users/ben/Development/vim-env${ENV_SUFFIX} \
--with-features=huge \
--enable-terminal \
${PYTHON}${PYTHON_TYPE} \
${OPTS} \
--enable-fail-if-missing \
"$@"