blob: 3bfc16c91ed82d77645bcf49564c7d7d3ce6013e (
plain)
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
|
#!/bin/sh
RPM_SOURCE_DIR="/home/freddy/rpmbuild/SOURCES"
RPM_BUILD_DIR="/home/freddy/rpmbuild/BUILD"
RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic"
RPM_LD_FLAGS="-Wl,-z,relro "
RPM_ARCH="x86_64"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="spice"
RPM_PACKAGE_VERSION="0.12.5"
RPM_PACKAGE_RELEASE="6.fc22"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/home/freddy/rpmbuild/BUILDROOT/spice-0.12.5-6.fc22.x86_64"
export RPM_BUILD_ROOT
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH
CONFIG_SITE=${CONFIG_SITE:-NONE}
export CONFIG_SITE
set -x
umask 022
# cd "/home/freddy/rpmbuild/BUILD"
#cd 'spice-0.12.5'
find server -name \*.gcno -delete
find server -name \*.gcda -delete
if test -r cov/index.html; then
rm -rf cov
fi
CCOV=
LCOV=
## coverage
#CCOV+=" -fprofile-arcs -ftest-coverage" # -fbranch-probabilities"
#LCOV+=" -lgcov"
#CCOV+=" -fbranch-probabilities"
## address sanitizer
# CCOV+=" -fno-omit-frame-pointer"
#CCOV+=" -fsanitize=address -fno-omit-frame-pointer"
#LCOV+=" -fsanitize=address -lasan"
## memory sanitizer
#CCOV+=" -fsanitize=memory -fno-omit-frame-pointer -fPIE -pie"
#LCOV+=" -fsanitize=memory -fPIE -pie"
#CCOV+=" -fno-omit-frame-pointer"
CCOV+=" -DCOMPRESS_STAT"
CCOV+=" -DRED_WORKER_STAT"
#CCOV+=" -DQUEUE_STAT"
#CCOV+=" -DDUMP_BITMAP"
#CCOV+=" -ffunction-sections -fdata-sections"
#CCOV+=" -DGLIB_VERSION_MAX_ALLOWED=0x21c00 -DGLIB_VERSION_MIN_REQUIRED=0x21c00"
if false; then
LCOV+=" -flto"
CCOV+=" -flto"
export AR=gcc-ar
export NM=gcc-nm
export RANLIB=gcc-ranlib
fi
#export CC=clang
#export LD=clang
# CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic $CCOV}" ; export CFLAGS ;
CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Werror=format-security -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic $CCOV}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}" ; export CXXFLAGS ;
FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FFLAGS ;
FCFLAGS="${FCFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FCFLAGS ;
LDFLAGS="${LDFLAGS:--Wl,-z,relro $LCOV}"; export LDFLAGS;
[ "1" = 1 ] && for i in $(find . -name config.guess -o -name config.sub) ; do
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && /usr/bin/rm -f $i && /usr/bin/cp -fv /usr/lib/rpm/redhat/$(basename $i) $i ;
done ;
[ "1" = 1 ] && [ x != "x" ] &&
for i in $(find . -name ltmain.sh) ; do
/usr/bin/sed -i.backup -e 's~compiler_flags=$~compiler_flags=""~' $i
done ;
./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu \
--enable-maintainer-mode \
--enable-smartcard --disable-client \
--disable-static \
--enable-lz4 \
--enable-gstreamer=1.0 \
--enable-valgrind-fixes \
--prefix=$HOME/qemu
echo \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib64 \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info > /dev/null
make -j4 # WARN_CFLAGS='' # V=1
exit 0
|