summaryrefslogtreecommitdiffstats
path: root/contrib/build-scripts/build-libevent-linux.sh
blob: 401e16d1fece6c3ac54b77c1c16b983026a149ec (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
#!/bin/bash

#
# build libevent for linux
#

# exit on error
set -e

ME=`basename $0`
DIR="$( cd "$( dirname "$0" )" && pwd )" 
CPUARCH=`uname -m`
PLATFORM_ID=`${DIR}/platform-id-linux.sh`
DEST_DIR="${DIR}/../prebuilt/${PLATFORM_ID}"

if [ ! -f event.c ]; then
	echo
	echo "Cannot find event.c"
	echo "Run script from within libevent directory"
	echo
	exit
fi

#rm lib*.a

if [ -f Makefile ]; then
  make clean
fi

./configure \
CFLAGS="-g" \
CXXFLAGS="-g" \
LDFLAGS="-g" \
--enable-gcc-hardening \
--with-pic \
--prefix=${DEST_DIR}

make
cp ./.libs/libevent.a ./libevent_d.a
cp ./.libs/libevent_core.a ./libevent_core_d.a
cp ./.libs/libevent_extra.a ./libevent_extra_d.a
cp ./.libs/libevent_openssl.a ./libevent_openssl_d.a
cp ./.libs/libevent_pthreads.a ./libevent_pthreads_d.a
make install # once for headers
rm ${DEST_DIR}/lib/libevent*
make clean


./configure \
--enable-gcc-hardening \
--with-pic \
--disable-debug-mode \
--disable-libevent-install

make
cp ./.libs/libevent.a ./libevent.a
cp ./.libs/libevent_core.a ./libevent_core.a
cp ./.libs/libevent_extra.a ./libevent_extra.a
cp ./.libs/libevent_openssl.a ./libevent_openssl.a
cp ./.libs/libevent_pthreads.a ./libevent_pthreads.a
make clean

cp ./*.a ${DEST_DIR}/lib