2024-03-01 19:02:00 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
|
|
|
cd "$DEPS_DIR"
|
|
|
|
. common
|
|
|
|
|
|
|
|
VERSION=1.0.27
|
2024-03-30 10:23:41 +00:00
|
|
|
FILENAME=libusb-$VERSION.tar.gz
|
2024-03-01 19:02:00 +00:00
|
|
|
PROJECT_DIR=libusb-$VERSION
|
2024-03-30 10:23:41 +00:00
|
|
|
SHA256SUM=e8f18a7a36ecbb11fb820bd71540350d8f61bcd9db0d2e8c18a6fb80b214a3de
|
2024-03-01 19:02:00 +00:00
|
|
|
|
|
|
|
cd "$SOURCES_DIR"
|
|
|
|
|
|
|
|
if [[ -d "$PROJECT_DIR" ]]
|
|
|
|
then
|
|
|
|
echo "$PWD/$PROJECT_DIR" found
|
|
|
|
else
|
2024-03-30 10:23:41 +00:00
|
|
|
get_file "https://github.com/libusb/libusb/archive/refs/tags/v$VERSION.tar.gz" "$FILENAME" "$SHA256SUM"
|
2024-03-01 19:02:00 +00:00
|
|
|
tar xf "$FILENAME" # First level directory is "$PROJECT_DIR"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$BUILD_DIR/$PROJECT_DIR"
|
|
|
|
cd "$BUILD_DIR/$PROJECT_DIR"
|
|
|
|
|
|
|
|
export CFLAGS='-O2'
|
|
|
|
export CXXFLAGS="$CFLAGS"
|
|
|
|
|
|
|
|
if [[ -d "$HOST" ]]
|
|
|
|
then
|
|
|
|
echo "'$PWD/$HOST' already exists, not reconfigured"
|
|
|
|
cd "$HOST"
|
|
|
|
else
|
|
|
|
mkdir "$HOST"
|
|
|
|
cd "$HOST"
|
|
|
|
|
2024-03-30 10:23:41 +00:00
|
|
|
"$SOURCES_DIR/$PROJECT_DIR"/bootstrap.sh
|
2024-03-01 19:02:00 +00:00
|
|
|
"$SOURCES_DIR/$PROJECT_DIR"/configure \
|
|
|
|
--prefix="$INSTALL_DIR/$HOST" \
|
|
|
|
--host="$HOST_TRIPLET" \
|
|
|
|
--enable-shared \
|
|
|
|
--disable-static
|
|
|
|
fi
|
|
|
|
|
|
|
|
make -j
|
|
|
|
make install-strip
|