Skip to content

Commit

Permalink
moved to correct configure script
Browse files Browse the repository at this point in the history
  • Loading branch information
simsong committed Jan 17, 2024
1 parent cfd51b9 commit e790682
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: "Ubuntu: run CONFIGURE_UBUNTU22_win64.bash"
if: startsWith(matrix.os, 'ubuntu')
run: |
echo "" | bash etc/CONFIGURE_UBUNTU22_win64.bash
echo "" | bash etc/CONFIGURE_UBUNTU22LTS.bash
- name: C++ checks with address-sanitizer (Mac and Linux)
run: |
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: |
bash bootstrap.sh
./configure -q --disable-opt --enable-silent-rules CFLAGS='-g -O0 -fprofile-arcs -ftest-coverage' CXXFLAGS='-g -O0 -fprofile-arcs -ftest-coverage' LIBS='-lgcov'
./configure --disable-opt CFLAGS='-g -O0 -fprofile-arcs -ftest-coverage' CXXFLAGS='-g -O0 -fprofile-arcs -ftest-coverage' LIBS='-lgcov -lre2'
make clean
make all
cd src
Expand Down
2 changes: 1 addition & 1 deletion etc/CONFIGURE_UBUNTU20LTS.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RELEASE=20
CONFIGURE="./configure -q --enable-silent-rules"
AUTOCONF_DIST=https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz
AUTOMAKE_DIST=https://ftp.gnu.org/gnu/automake/automake-1.16.3.tar.gz
MKPGS="build-essential flex libexpat1-dev libxml2-utils libssl-dev libtool make pkg-config zlib1g-dev"
MKPGS="build-essential flex libabsl-dev libexpat1-dev libre2-dev libssl-dev libtool libxml2-utils make pkg-config zlib1g-dev"
# libxml2-utils needed for xmllint
WGET="wget -nv --no-check-certificate"
CONFIGURE="./configure -q --enable-silent-rules"
Expand Down
83 changes: 83 additions & 0 deletions etc/CONFIGURE_UBUNTU22LTS.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/bash
source paths.bash
RELEASE=22
CONFIGURE="./configure -q --enable-silent-rules"
AUTOCONF_DIST=https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz
AUTOMAKE_DIST=https://ftp.gnu.org/gnu/automake/automake-1.16.3.tar.gz
MKPGS="build-essential flex libabsl-dev libexpat1-dev libre2-dev libssl-dev libtool libxml2-utils make pkg-config zlib1g-dev"
WGET="wget -nv --no-check-certificate"
CONFIGURE="./configure -q --enable-silent-rules"
MAKE="make -j4"
trap "exit 1" TERM
export TOP_PID=$$
cat <<EOF
*******************************************************************
Configuring Ubuntu $RELEASE.04 LTS to compile bulk_extractor.
*******************************************************************
Install Ubuntu $RELEASE.04 and follow these commands:
# sudo apt-get install git
# git clone --recursive https://github.com/simsong/bulk_extractor.git
# bash bulk_extractor/etc/CONFIGURE_UBUNTU20LTS.bash
# (cd bulk_extractor; sudo make install)
press any key to continue...
EOF
read IGNORE

function fail() {
echo FAIL: $@
kill -s TERM $TOP_PID
}

# cd to the directory where the script is
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
DIR="$(readlink -f $(dirname "${BASH_SOURCE[0]}"))"
cd /tmp
/bin/rm -rf src
mkdir src
cd src

if [ ! -r /etc/os-release ]; then
echo == This requires an /etc/os-release file.
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 -lt $RELEASE ]; then
echo == This requires at least Ubuntu $RELEASE Linux.
exit 1
fi

echo == Will now try apt update
sudo apt update --fix-missing -y || fail could not apt update

echo == Will now try to install
echo == MKPGS: $MKPGS

sudo apt install -y $MKPGS || fail could not apt install $MKPGS

echo == manually installing a modern libewf
$WGET $LIBEWF_URL || (echo could not download $LIBEWF_URL; exit 1)
tar xfz libewf*gz && (cd libewf*/ && $CONFIGURE && $MAKE >/dev/null && sudo make install)
ls -l /etc/ld.so.conf.d/
sudo ldconfig
ewfinfo -h >/dev/null || (echo could not install libewf; exit 1)

echo == updating autoconf
$WGET $AUTOCONF_DIST || (echo could not download $AUTOCONF_DIST; exit 1)
tar xfz autoconf*gz && (cd autoconf*/ && $CONFIGURE && $MAKE >/dev/null && sudo make install)
autoconf --version

echo == updating automake
$WGET $AUTOMAKE_DIST || (echo could not download $AUTOMAKE_DIST; exit 1)
tar xfz automake*gz && (cd automake*/ && $CONFIGURE && $MAKE >/dev/null && sudo make install)
automake --version
8 changes: 4 additions & 4 deletions etc/CONFIGURE_UBUNTU22_win64.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ OS_NAME=ubuntu
OS_VERSION=22
MAKE_CONCURRENCY=-j2
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MPKGS="autoconf automake flex g++ gcc git libtool libabsl-dev libre2-dev libxml2-utils libz-mingw-w64-dev libgcrypt-mingw-w64-dev libsqlite3-dev make mingw-w64 wine "
cd $SCRIPT_DIR

. ./paths.bash


if [ ! -r /etc/os-release ]; then
if [[ ! -r /etc/os-release ]]; then
echo This requires /etc/os-release
exit 1
fi
. /etc/os-release
if [ $ID != $OS_NAME ]; then
if [[ $ID != $OS_NAME ]]; then
echo This requires $OS_NAME Linux. You have $ID.
exit 1
fi

if [ $VERSION_ID -ne $OS_VERSION ]; then
if [[ $VERSION_ID != $OS_VERSION ]]; then
echo This requires $OS_NAME version $OS_VERSION. You have $ID $VERSION_ID.
exit 1
fi
Expand All @@ -34,7 +35,6 @@ press any key to continue...
EOF
read

MPKGS="autoconf automake flex g++ gcc git libtool libabsl-dev libre2-dev libxml2-utils libz-mingw-w64-dev libgcrypt-mingw-w64-dev libsqlite3-dev make mingw-w64 wine "

sudo apt update -y
sudo apt install -y $MPKGS
Expand Down
2 changes: 1 addition & 1 deletion src/scan_find.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "be20_api/dfxml_cpp/src/dfxml_writer.h"

// We need the defaults for page scan and margin. We really should get the current ones...
#import "phase1.h"
#include "phase1.h"

// anonymous namespace hides symbols from other cpp files (like "static" applied to functions)
// TODO: make this not a global variable
Expand Down

0 comments on commit e790682

Please sign in to comment.