allow to override libxdc/capstone repo locations
Fetch submodules only if either LIBXDC_ROOT or CAPSTONE_ROOT are empty.
This commit is contained in:
parent
ec36a3551f
commit
02d6e1545c
@ -40,17 +40,17 @@ error()
|
|||||||
compile_libraries()
|
compile_libraries()
|
||||||
{
|
{
|
||||||
echo "[!] Compiling capstone4..."
|
echo "[!] Compiling capstone4..."
|
||||||
make -C capstone_v4 -j $(nproc)
|
make -C $CAPSTONE_ROOT -j $(nproc)
|
||||||
|
|
||||||
echo "[!] Compiling libxdc..."
|
echo "[!] Compiling libxdc..."
|
||||||
LDFLAGS="-L$PWD/capstone_v4 -L$PWD/libxdc" CFLAGS="-I$PWD/capstone_v4/include/" make -C libxdc -j $(nproc)
|
LDFLAGS="-L$CAPSTONE_ROOT -L$LIBXDC_ROOT" CFLAGS="-I$CAPSTONE_ROOT/include/" make -C $LIBXDC_ROOT -j $(nproc)
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
"dynamic"|"debug")
|
"dynamic"|"debug")
|
||||||
echo "[!] Installing capstone4..."
|
echo "[!] Installing capstone4..."
|
||||||
sudo make -C capstone_v4 install
|
sudo make -C $CAPSTONE_ROOT install
|
||||||
echo "[!] Installing libxdc..."
|
echo "[!] Installing libxdc..."
|
||||||
sudo make -C libxdc install
|
sudo make -C $LIBXDC_ROOT install
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -61,8 +61,8 @@ configure_qemu()
|
|||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
"debug_static"|"static"|"lto")
|
"debug_static"|"static"|"lto")
|
||||||
export LIBS="-L$PWD/capstone_v4/ -L$PWD/libxdc/ $LIBS"
|
export LIBS="-L$CAPSTONE_ROOT -L$LIBXDC_ROOT/ $LIBS"
|
||||||
export QEMU_CFLAGS="-I$PWD/capstone_v4/include/ -I$PWD/libxdc/ $QEMU_CFLAGS"
|
export QEMU_CFLAGS="-I$CAPSTONE_ROOT/include/ -I$LIBXDC_ROOT/ $QEMU_CFLAGS"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error
|
error
|
||||||
@ -102,9 +102,14 @@ if [ "$#" -ne 1 ] ; then
|
|||||||
error
|
error
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git submodule init
|
if [ -z "$LIBXDC_ROOT" -o -z "$CAPSTONE_ROOT" ]; then
|
||||||
git submodule update libxdc
|
git submodule init
|
||||||
git submodule update capstone_v4
|
git submodule update libxdc
|
||||||
|
git submodule update capstone_v4
|
||||||
|
|
||||||
|
LIBXDC_ROOT="$PWD/libxdc"
|
||||||
|
CAPSTONE_ROOT="$PWD/capstone_v4"
|
||||||
|
fi
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
compile_libraries $1
|
compile_libraries $1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user