summaryrefslogtreecommitdiffstats
path: root/contrib/build-scripts/build-glog-linux.sh
blob: 6fa5d7867f0d36b9a0c19b4df9fdfa6598201f6a (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
#!/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 src/glog/log_severity.h ]; then
	echo
	echo "Cannot find src/glog/log_severity.h"
	echo "Run script from within glog directory"
	echo
	exit
fi

if [ -f Makefile ]; then
  make clean
fi

./configure \
CFLAGS="-g" \
CXXFLAGS="-g" \
LDFLAGS="-g" \
--disable-rtti \
--enable-static \
--with-pic \
--prefix=${DEST_DIR}

make
make install # once for headers
rm ${DEST_DIR}/lib/libglog*
cp ./.libs/libglog.a ${DEST_DIR}/lib/libglog_d.a
make clean

./configure \
CFLAGS="-g" \
CXXFLAGS="-g" \
LDFLAGS="-g" \
--disable-rtti \
--enable-static \
--with-pic

make
cp ./.libs/libglog.a ${DEST_DIR}/lib/libglog.a