forked from simsong/bulk_extractor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCONFIGURE_UBUNTU16LTS.bash
More file actions
executable file
·154 lines (127 loc) · 4.1 KB
/
Copy pathCONFIGURE_UBUNTU16LTS.bash
File metadata and controls
executable file
·154 lines (127 loc) · 4.1 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
cat <<EOF
*******************************************************************
Configuring Debian 9 to compile bulk_extractor.
*******************************************************************
Install Ubuntu 16.04 LTS and follow these commands:
# apt-get install git
# git clone --recursive git@github.com:simsong/bulk_extractor.git
# cd bulk_extractor
# bash etc/CONFIGURE_UBUNTU16LTS.bash
# bash bootstrap.sh
# ./configure
# make && sudo make install
press any key to continue...
EOF
read
# cd to the directory where the script is
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$PWD" != "$DIR" ]; then
changed_dir="true"
else
changed_dir="false"
fi
cd $DIR
#MPKGS="autoconf automake flex gcc git libtool "
#MPKGS+="openssl patch wget bison g++ libssl-dev zlib1g-dev libxml2-dev"
MKPGS="autoconf automake flex gcc g++ libssl-dev zlib1g-dev libxml2-dev dpkg-dev openssl patch wget bison"
if [ ! -r /etc/os-release ]; then
echo This requires Debian Linux.
exit 1
fi
source /etc/os-release
if [ x$ID != xubuntu ]; then
echo This really requires ubuntu. You have $ID
exit 1
fi
MAJOR_VERSION=`echo $VERSION_ID|sed s/[.].*//`
if [ $MAJOR_VERSION -ne 16 ]; then
echo This requires Ubuntu 16 LTS Linux.
exit 1
fi
echo Will now try to install
# I use emacs. Installing it may install requiremnts
sudo apt update -y
sudo apt install -y emacs
sudo apt autoremove -y autoremove
# Now install what is required
echo apt install -y $MKPGS
sudo apt install -y $MKPGS
exit 1
if [ $? != 0 ]; then
echo "Could not install some of the packages. Will not proceed."
exit 1
fi
exit 0
# ICU requires patching and a special build sequence
#
echo "Building and installing ICU for mingw"
ICUVER=53_1
ICUFILE=icu4c-$ICUVER-src.tgz
ICUDIR=icu
ICUURL=http://download.icu-project.org/files/icu4c/53.1/$ICUFILE
if is_installed libicuuc
then
echo ICU is already installed
else
if [ ! -r $ICUFILE ]; then
wget $ICUURL
fi
tar xf $ICUFILE
# patch ICU for MinGW cross-compilation
pushd icu
patch -p0 <../icu4c-53_1-simpler-crossbuild.patch
patch -p0 <../icu4c-53_1-mingw-w64-mkdir-compatibility.patch
popd
ICUDIR=`tar tf $ICUFILE|head -1`
ICU_DEFINES="-DU_USING_ICU_NAMESPACE=0 -DU_CHARSET_IS_UTF8=1 -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNSTR_FROM_STRING_EXPLICIT=explicit"
ICU_FLAGS="--disable-extras --disable-icuio --disable-layout --disable-samples --disable-tests"
# build ICU for Linux to get packaging tools used by MinGW builds
echo
echo icu linux
rm -rf icu-linux
mkdir icu-linux
pushd icu-linux
CC=gcc CXX=g++ CFLAGS=-O3 CXXFLAGS=-O3 CPPFLAGS="$ICU_DEFINES" ../icu/source/runConfigureICU Linux --enable-shared $ICU_FLAGS
make VERBOSE=1
popd
# build 64-bit ICU for MinGW
echo
echo icu mingw64
rm -rf icu-mingw64
mkdir icu-mingw64
pushd icu-mingw64
eval MINGW=\$MINGW64
eval MINGW_DIR=\$MINGW64_DIR
../icu/source/configure CC=$MINGW-gcc CXX=$MINGW-g++ CFLAGS=-O3 CXXFLAGS=-O3 CPPFLAGS="$ICU_DEFINES" --enable-static --disable-shared --prefix=$MINGW_DIR --host=$MINGW --with-cross-build=`realpath ../icu-linux` $ICU_FLAGS --disable-tools --disable-dyload --with-data-packaging=static
make VERBOSE=1
sudo make install
make clean
popd
rm -rf icu-mingw64
rm -rf $ICUDIR icu-linux
echo "ICU mingw installation complete."
fi
#
# build liblightgrep
#
build_mingw liblightgrep https://github.com/LightboxTech/liblightgrep/archive/v1.3.0.tar.gz liblightgrep-1.3.0.tar.gz
#
#
#
echo ...
echo 'Now running ../bootstrap.sh and configure'
pushd ..
sh bootstrap.sh
sh configure
popd
echo ================================================================
echo ================================================================
echo 'You are now ready to cross-compile for win64.'
echo 'To make bulk_extractor64.exe: cd ..; make win64'
echo 'To make ZIP file with both: cd ..; make windist'
echo 'To make the Nulsoft installer with both and the Java GUI: make'
if [ "$changed_dir" == "true" ]; then
echo "NOTE: paths are relative to the directory $0 is in"
fi