Skip to content

Commit 90ef1dd

Browse files
committed
build: build xz from a submodule
We also install xz to the build directory, for a cleaner setup.
1 parent 9ca41da commit 90ef1dd

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
[submodule "src/submodule_packages/libexpat"]
1313
path = src/submodule_packages/libexpat
1414
url = git@github.com:guyush1/libexpat.git
15+
[submodule "xz"]
16+
path = src/submodule_packages/xz
17+
url = https://github.com/tukaani-project/xz.git

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM ubuntu:24.04
22

33
RUN apt update && apt install -y \
4+
autopoint \
45
binutils-multiarch \
56
bison \
67
file \
@@ -24,7 +25,6 @@ RUN apt update && apt install -y \
2425
patch \
2526
pkg-config \
2627
python3.12 \
27-
python3-pip \
2828
python3-requests \
2929
libpython3-dev \
3030
texinfo \

src/compilation/build.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function build_lzma() {
154154
echo "$lzma_build_dir"
155155
mkdir -p "$lzma_build_dir"
156156

157-
if [[ -f "$lzma_build_dir/usr/local/lib/liblzma.a" ]]; then
157+
if [[ -f "$lzma_build_dir/lib/liblzma.a" ]]; then
158158
>&2 echo "Skipping build: lzma already built for $target_arch"
159159
return 0
160160
fi
@@ -163,8 +163,16 @@ function build_lzma() {
163163

164164
>&2 fancy_title "Building liblzma for $target_arch"
165165

166+
# Make sure configure exists by running autogen.sh
167+
(
168+
cd .. && ./autogen.sh 1>&2
169+
)
170+
171+
# lzma's autoconf contains a bug, it's instal prefix is relative
172+
# to the current build directory.
173+
# Hence, we set the prefix here to "/" instead of realpath . .
166174
../configure --enable-static "CC=$CC" "CXX=$CXX" "--host=$HOST" \
167-
"CFLAGS=$CFLAGS" "CXXFLAGS=$CXXFLAGS" 1>&2
175+
"CFLAGS=$CFLAGS" "CXXFLAGS=$CXXFLAGS" --prefix="/" 1>&2
168176
if [[ $? -ne 0 ]]; then
169177
return 1
170178
fi
@@ -697,7 +705,7 @@ function build_gdb_with_dependencies() {
697705

698706
build_and_install_gdb "$packages_dir/binutils-gdb" \
699707
"$iconv_build_dir" \
700-
"$lzma_build_dir/usr/local/" \
708+
"$lzma_build_dir" \
701709
"$gmp_build_dir" \
702710
"$mpfr_build_dir" \
703711
"$with_python" \

src/compilation/download_packages.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ SOURCE_URLS=(
1010
"https://ftp.gnu.org/pub/gnu/gmp/gmp-6.3.0.tar.xz"
1111
"https://ftp.gnu.org/pub/gnu/mpfr/mpfr-4.2.1.tar.xz"
1212
"https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz"
13-
"https://github.com/tukaani-project/xz/releases/download/v5.8.1/xz-5.8.1.tar.xz"
1413
)
1514

1615
function unpack_tarball() {

src/submodule_packages/xz

Submodule xz added at 56aa9a0

0 commit comments

Comments
 (0)