This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·109 lines (94 loc) · 2.66 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
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
#!/bin/sh
##
# Jabberd Configuration File
##
PREFIX="."
JABBERD_BIN='jabberd'
WPJ_BIN=''
# remove comment if you need own sys_epoll library
#OWN_SYS_EPOLL='1'
CONFIG_FILE='jabber.xml'
DEFINES='-I. -I../jabberd -DWPJABBER'
for x in $@; do
parname=`echo $x | sed "s/\([^=]*\).*$/\1/"`
parvalu=`echo $x | sed "s/[^=]*=\(.*\)$/\1/"`
case x$parname in
x--prefix)
PREFIX=$parvalu;;
x--nodebug)
DEFINES="$DEFINES -DNODEBUG"
echo "*** no debug ...";;
x--forwp)
DEFINES="$DEFINES -DFORWP"
echo "*** compile for WP ...";;
x--optimize)
DEFINES="$DEFINES -O2"
echo "*** compile wth optimizations ...";;
x--arch686)
DEFINES="$DEFINES -march=i686"
echo "*** compile for 686 ...";;
x--nowpj)
DEFINES="$DEFINES -DNOWPJ"
echo "*** compile without safe restart for WPJ ...";;
x--help)
echo "Possible flags/switches:"
echo " --prefix=[DIR] default=./"
echo " --nodebug - compile without debug logs, up to 10% faster"
echo " --optimize - compile with code optimization , not tested :("
exit;;
esac;
done;
if [ -n "$CC" ]; then
CC="$CC";
else
CC="gcc";
fi;
CFLAGS="-g -Wall $DEFINES"
LIBS="$LIBS"
if [ "$OWN_SYS_EPOLL" = "1" ]; then
printf "Using own sys epoll lib\n"
SYS_EPOLL_LIB='epoll_lib'
WPJ_CFLAGS="-g -Wall -I../jabberd/lib -DHAVE_SSL -I epoll-lib/include -DOWN_SYS_EPOLL $DEFINES"
WPJ_LIBS="$LIBS -Lepoll-lib/lib -lepoll"
else
printf "Using system sys epoll\n"
WPJ_CFLAGS="-g -Wall -I../jabberd/lib -DHAVE_SSL $DEFINES"
WPJ_LIBS="$LIBS -lepoll"
fi
printf "Setting Build Parameters..."
hosttype=`uname -s`
case $hosttype in
Linux)
WPJ_BIN=wpj
WPJ_CFLAGS="$WPJ_CFLAGS"
WPJ_LIBS="$WPJ_LIBS -lpthread -lcrypto -lssl -lexpat"
CFLAGS="$CFLAGS -fPIC"
LIBS="$LIBS -ldl -lpthread -lresolv -lexpat";;
FreeBSD)
CFLAGS="$CFLAGS -I/usr/src/contrib/libstdc++ -D_THREAD_SAFE -DSUNOS"
LIBS="$LIBS -pthread -lcompat -lc_r -L/usr/local/lib -liconv -lexpat";;
OpenBSD)
CFLAGS="$CFLAGS -I/usr/src/contrib/libstdc++ -D_THREAD_SAFE -DSUNOS"
LIBS="$LIBS -pthread -lcompat -lc_r -L/usr/local/lib -liconv -lexpat";;
SunOS)
CFLAGS="$CFLAGS -DSUNOS -D_REENTRANT -fPIC"
LIBS="$LIBS -ldl -lsocket -lnsl -lpthread -lresolv -lexpat";;
esac
printf " Done.\n"
printf "Generating JIT Settings Script..."
cat << EOF > platform-settings
#!/bin/sh
CC=$CC
MCFLAGS=-shared
COMMON_CFLAGS=$CFLAGS
COMMON_LIBS=$LIBS
PREFIX=$PREFIX
CONFIG_FILE=$CONFIG_FILE
OUT_FILE=$JABBERD_BIN
WPJ_CFLAGS=$WPJ_CFLAGS
WPJ_LIBS=$WPJ_LIBS
WPJ_BIN=$WPJ_BIN
WPJ_BUILD=$SYS_EPOLL_LIB $WPJ_BIN
EOF
chmod 0600 platform-settings
printf " Done.\n\n"