-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·50 lines (45 loc) · 1.27 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
#!/bin/bash
if [ -z "${CC}" ]; then
if [ -x "$(command -v gcc)" ]; then
export CC=$(which gcc)
elif [ -x "$(command -v clang)" ]; then
export CC=$(which clang)
else
read -p "CC: " cc
if ! [ -x "$(command -v ${cc})" ]; then
echo "C compailer '${cc}' was not found." >&2
exit 1
fi
export CC=$cc
fi
fi
echo CC=$CC
if [ -z "${AR}" ]; then
if [ -x "$(command -v ar)" ]; then
export AR=$(which ar)
else
read -p "AR: " ar
if [ -z "${ar}" ]; then
echo "Warning: Archiver was not specified. Static library can't be created without it."
elif [ -x "$(command -v ${ar})" ]; then
echo "Archiver '${ar}' was not found." >&2
exit 1
fi
export AR=$ar
fi
fi
echo AR=$AR
prefix=$PREFIX
PREFIX_DEFAULT="/usr"
if [ -z "${prefix}" ]; then read -p "PREFIX: ($PREFIX_DEFAULT) " prefix; fi
if [ -z "${prefix}" ]; then prefix=$PREFIX_DEFAULT; fi
export PREFIX=$prefix
echo PREFIX=$PREFIX
if [ -z "${LD_LIBRARY_PATH}" ]; then
export LD_LIBRARY_PATH=$PWD
elif ! [[ "$LD_LIBRARY_PATH" =~ (^|:)"$PWD"(:|$) ]]; then
LD_LIBRARY_PATH="$PWD:$LD_LIBRARY_PATH"
fi
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
echo Starting new bash session...
bash