-
Notifications
You must be signed in to change notification settings - Fork 50
/
autogen.sh
executable file
·57 lines (48 loc) · 1.27 KB
/
autogen.sh
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
#! /bin/bash
script=$0
srcdir=$(dirname ${script})
debug='-g -O1 -D_FORTIFY_SOURCE=2'
werror=''
args=()
while test $# -gt 0 ; do
case $1 in
-debug0) debug='-g -O0' ;;
-Werror) werror='-Werror' ;;
*) args+=("$1") ;;
esac
shift
done
test -f "${srcdir}/configure.ac" || exit 1
pushd "${srcdir}" >/dev/null
autoreconf --force --install || exit 1
popd >/dev/null
localstatedir=$(rpm -E '%_localstatedir')
if [ "$(rpm -E '%{defined _rundir}')" -eq 1 ]; then
rundir="$(rpm -E '%{_rundir}')";
else
rundir="$localstatedir/run"
fi
if [ "$(rpm -E '%{defined _fillupdir}')" -eq 1 ]; then
fillupdir="$(rpm -E '%{_fillupdir}')";
else
fillupdir="$localstatedir/adm/fillup-templates"
fi
_lib=$(rpm -E '%_lib' 2>/dev/null)
test -n "$_lib" || case "$(uname -m)" in
x86_64|s390x|ppc64|powerpc64) _lib=lib64 ;;
*) _lib=lib ;;
esac
export CFLAGS="${CFLAGS:--std=gnu89 ${debug} -fstack-protector -Wall -Wextra -Wno-unused-parameter ${werror}}"
prefix=/usr
defaults=(
--enable-silent-rules
--sysconfdir=/etc
--prefix="${prefix}"
--libdir="${prefix}/${_lib}"
--libexecdir="${prefix}/lib"
--datadir="${prefix}/share"
--localstatedir="$localstatedir"
--with-statedir="${rundir}/wicked"
--with-fillup-templatesdir="$fillupdir"
)
"${srcdir}/configure" "${defaults[@]}" "${args[@]}"