Skip to content

Commit ed5046d

Browse files
committed
scripts: update build-alsa-tools.sh for testing [DNM]
Signed-off-by: Christopher Turner <christopher.g.turner@intel.com>
1 parent c2930bd commit ed5046d

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

scripts/build-alsa-tools.sh

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
# fail immediately on any errors
66
set -e
77

8-
# Array of ALSA Git repository URLs. Add or remove repositories as needed.
8+
# Array of ALSA Git repository URLs. Add or remove repositories as needed.
99
declare -a REPOS=(
1010
"https://github.com/thesofproject/alsa-lib.git"
1111
"https://github.com/thesofproject/alsa-utils.git"
12-
# Add more repositories here...
1312
)
1413

1514
# Commit ID to check for (optional). If specified, the script will update
16-
# the repository if this commit ID is not found. Leave empty to skip.
15+
# the repository if this commit ID is not found. Leave empty to skip.
1716
declare -a COMMIT_ID=(
1817
"df8f1cc1ec9d9ee15be5e2c23ad25b9389fd8766"
1918
"09550cd393b1a7d307ee6f26637b1ed7bd275e38"
@@ -28,21 +27,25 @@ else
2827
BASE_DIR="$SOF_WORKSPACE"
2928
fi
3029

31-
# Arguments to pass to ./configure for each repository. Add or remove
30+
# Unified installation paths (same as Dockerfile)
31+
INSTALL_PREFIX="/usr"
32+
LIB_DIR="/usr/lib/x86_64-linux-gnu"
33+
34+
# Arguments to pass to ./configure for each repository
3235
declare -a CONFIGURE_ARGS=(
33-
"--prefix=${BASE_DIR}/tools"
34-
"--prefix=${BASE_DIR}/tools \
35-
--with-alsa-prefix=${BASE_DIR}/tools \
36-
--with-alsa-inc-prefix=${BASE_DIR}/tools/include \
37-
--with-sysroot=${BASE_DIR}/tools \
38-
--with-udev-rules-dir=${BASE_DIR}/tools \
39-
PKG_CONFIG_PATH=${BASE_DIR}/tools \
40-
LDFLAGS=-L${BASE_DIR}/tools/lib \
41-
--with-asound-state-dir=${BASE_DIR}/tools/var/lib/alsa \
42-
--with-systemdsystemunitdir=${BASE_DIR}/tools/lib/systemd/system"
36+
"--prefix=$INSTALL_PREFIX --libdir=$LIB_DIR"
37+
"--prefix=$INSTALL_PREFIX --libdir=$LIB_DIR \
38+
--with-alsa-prefix=$INSTALL_PREFIX \
39+
--with-alsa-inc-prefix=$INSTALL_PREFIX/include \
40+
--with-sysroot=$INSTALL_PREFIX \
41+
--with-udev-rules-dir=$INSTALL_PREFIX/lib/udev/rules.d \
42+
PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig \
43+
LDFLAGS=-L$LIB_DIR \
44+
--with-asound-state-dir=$INSTALL_PREFIX/var/lib/alsa \
45+
--with-systemdsystemunitdir=$INSTALL_PREFIX/lib/systemd/system"
4346
)
4447

45-
# Arguments to pass to make for each repository. Add or remove arguments as needed.
48+
# Arguments to pass to make for each repository
4649
declare -a TARGET_ARGS=(
4750
"--disable-old-symbols"
4851
"--enable-alsatopology"
@@ -64,7 +67,6 @@ check_commit() {
6467
fi
6568
}
6669

67-
6870
# Function to update the repository
6971
update_repo() {
7072
local repo_dir="$1"
@@ -82,11 +84,11 @@ build_and_install() {
8284
echo "Building and installing: $repo_dir $configure_args $target_args"
8385

8486
if [ ! -f "$repo_dir/gitcompile" ]; then
85-
echo "Error: gitcompile not found in $repo_dir" >&2
86-
exit 1
87+
echo "Error: gitcompile not found in $repo_dir" >&2
88+
exit 1
8789
fi
8890

89-
# if Makefile exists then we can just run make
91+
# If Makefile exists, we can just run make
9092
if [ ! -f "$repo_dir/Makefile" ]; then
9193
(cd "$repo_dir" && ./gitcompile $configure_args $target_args) || \
9294
{ echo "configure failed in $repo_dir"; exit 1; }
@@ -103,7 +105,7 @@ build_and_install() {
103105
mkdir -p "$BASE_DIR"
104106

105107
for ((i = 0; i < ${#REPOS[@]}; i++)); do
106-
echo "Counter: $i, Value: ${REPOS[i]}"
108+
echo "Processing repository: ${REPOS[i]}"
107109
repo_url=${REPOS[i]}
108110

109111
repo_name=$(basename "$repo_url" .git) # Extract repo name
@@ -118,8 +120,7 @@ for ((i = 0; i < ${#REPOS[@]}; i++)); do
118120
echo "Repository $repo_name is up to date."
119121
fi
120122

121-
build_and_install "$repo_dir" "${CONFIGURE_ARGS[i]}"
122-
123+
build_and_install "$repo_dir" "${CONFIGURE_ARGS[i]}" "${TARGET_ARGS[i]}"
123124
done
124125

125-
echo "All repositories processed."
126+
echo "All repositories processed."

0 commit comments

Comments
 (0)