forked from haojiangwang/tcltk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile-tcltls.sh
executable file
·51 lines (43 loc) · 1.37 KB
/
compile-tcltls.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
#!/bin/bash -e
## module
MODULE=tcltls
## load defaults
. ./common.sh
## check debug switch
if [ -n "$SW_DEBUG" ]; then
CONFIGURE_SWITCH+="--enable-symbols "
fi
## check 64bit platform
if [ "$BARCH" == "x86_64" ]; then
CONFIGURE_SWITCH+="--enable-64bit "
fi
## print
echo "** Compiling $MODULE $CONFIGURE_SWITCH"
## delete whole compile sources and start from new
if [ -n "$SW_CLEANUP" ]; then
echo -n "Deleting old sources ... "
rm -rf $COMPILEDIR/$MODULE
echo done
fi
## copy source to temp compile path
if [ ! -d $COMPILEDIR/$MODULE ] || [ -n "$SW_FORCECOPY" ]; then
echo -n "Copying new sources ... "
rsync -a --exclude "*/.git" --exclude "*.fossil" --exclude "_FOSSIL_" $EXTSRCDIR/$MODULE $COMPILEDIR/
rm -rf $COMPILEDIR/$MODULE/.fossil-settings
echo done
## apply mandatory patches
patch $COMPILEDIR/$MODULE/tlsBIO.c $PATCHDIR/$MODULE/openssl3.patch
export openssl3_minversion=3.0.0
if echo -e "$(openssl version|awk '{print $2}')\n${openssl3_minversion}" | sort -V | head -1 | grep -q ^${openssl3_minversion}$; then
echo "OpenSSl 3, patching gen_dh_params"
cp $PATCHDIR/$MODULE/gen_dh_params $COMPILEDIR/$MODULE
fi
fi
## configure and make
cd $COMPILEDIR/$MODULE
./autogen.sh
./configure --prefix=$INSTALLDIR --mandir=$iSHAREDIR --enable-static-ssl
make
make install
## fini
echo "** Finished compile-$MODULE."