forked from SrainApp/srain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·81 lines (69 loc) · 2.09 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
#!/bin/sh
for arg in "$@"; do
case "$arg" in
--builddir=*)
builddir=`echo $arg | sed 's/--builddir=//'`
echo "$builddir" | grep " " &&
echo "Whitespace is not allowed in build directory" &&
exit 1
;;
--prefix=*)
prefix=`echo $arg | sed 's/--prefix=//'`
;;
--config-dir=*)
echo "Option --config-dir is deprecated, use --sysconfdir instead."
sysconfdir=`echo $arg | sed 's/--config-dir=//'`
;;
--sysconfdir=*)
sysconfdir=`echo $arg | sed 's/--sysconfdir=//'`
;;
--datadir=*)
datadir=`echo $arg | sed 's/--datadir=//'`
;;
--enable-debug)
debugsym=true;;
--disable-debug)
debugsym=false;;
--help)
echo 'Usage: ./configure [options]'
echo 'Options:'
echo ' --builddir=<path>: Build output directory'
echo ' MUST be an absolute path and CANNOT contain'
echo ' whitespace'
echo ' --prefix=<path>: Installation prefix'
echo ' --config-dir=<path>: Deprecated, use --sysconfdir instead'
echo ' --sysconfdir=<path>: System wide configure file location'
echo ' --datadir=<path>: Application data location'
echo ' --enable-debug: Include debug symbols'
echo ' --disable-debug: Do not include debug symbols'
echo 'All invalid options are silently ignored'
exit 0
;;
esac
done
if [ -z $builddir ]; then
builddir=$PWD/build
fi
if [ -z $prefix ]; then
prefix=/usr/local
fi
if [ -z $sysconfdir ]; then
sysconfdir=$prefix/etc
fi
if [ -z $datadir ]; then
datadir=$prefix/share
fi
if [ -z $debugsym ]; then
debugsym=true
fi
echo 'Generating makefile ...'
echo '' > Makefile
echo "BUILDDIR = $builddir" | tee -a Makefile
echo "PREFIX = $prefix" | tee -a Makefile
echo "SYSCONFDIR = $sysconfdir" | tee -a Makefile
echo "DATADIR = $datadir" | tee -a Makefile
if $debugsym; then
echo 'DBGFLAGS = -ggdb' | tee -a Makefile
fi
cat Makefile.in >> Makefile
echo 'Configuration complete, type make to build.'