Skip to content

Commit

Permalink
Backport autotools/meson_configure mechanism from jinix
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Jan 1, 2024
1 parent 196d025 commit cc92987
Show file tree
Hide file tree
Showing 84 changed files with 162 additions and 505 deletions.
3 changes: 2 additions & 1 deletion build-support/cross_file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
c = 'x86_64-vinix-gcc'
cpp = 'x86_64-vinix-g++'
ar = 'x86_64-vinix-ar'
nm = 'x86_64-vinix-nm'
strip = 'x86_64-vinix-strip'
pkg-config = 'x86_64-vinix-pkg-config'
# sed adds binaries here.
llvm-config = '/base_dir/build-support/cross-llvm-config'

[host_machine]
system = 'vinix'
Expand Down
35 changes: 35 additions & 0 deletions jinx-config
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,48 @@ post_package_strip() {
done
}

autotools_configure() {
if [ -z "${configure_script_path}" ]; then
configure_script_path="${source_dir}/configure"
fi

${configure_script_path} \
--host=${OS_TRIPLET} \
--with-sysroot=${sysroot_dir} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--bindir=${prefix}/bin \
--sbindir=${prefix}/bin \
--libdir=${prefix}/lib \
--disable-static \
--enable-shared \
"$@"
}

autotools_recursive_regen() {
for f in $(find . -name configure.ac); do
echo "* autotools regen in '$(dirname $f)'..."
( cd "$(dirname "$f")" && autoreconf -fvi "$@" )
done
}

meson_configure() {
if [ -z "${meson_source_dir}" ]; then
meson_source_dir="${source_dir}"
fi

meson setup "${meson_source_dir}" \
--cross-file "${base_dir}/build-support/cross_file.txt" \
--prefix=${prefix} \
--sysconfdir=/etc \
--libdir=lib \
--sbindir=bin \
--buildtype=release \
-Ddefault_library=shared \
"$@"
}

if [ "$in_container" = true ]; then
export VMODULES="/tmp/.vmodules"
mkdir -p "${VMODULES}"/cache
Expand Down
9 changes: 2 additions & 7 deletions recipes/bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs ncurses readline"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--without-bash-malloc \
--disable-nls \
autotools_configure \
--without-bash-malloc \
--with-installed-readline="${sysroot}"/usr/lib

make -j${parallelism}
Expand Down
16 changes: 5 additions & 11 deletions recipes/binutils
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ deps="core-libs zlib gmp"
imagedeps="gcc"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--target=${OS_TRIPLET} \
--with-sysroot=${sysroot_dir} \
--disable-nls \
--disable-werror \
autotools_configure \
--target=${OS_TRIPLET} \
--disable-werror \
--disable-dependency-tracking \
--enable-colored-disassembly \
--with-system-zlib \
--with-gmp=${sysroot_dir}/usr \
--enable-shared \
--enable-host-shared
--with-system-zlib \
--with-gmp=${sysroot_dir}/usr

SFRAME_LIB_PATH="-L$(pwd -P)/libsframe/.libs" \
make -j${parallelism} all
Expand Down
8 changes: 2 additions & 6 deletions recipes/coreutils
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ imagedeps="gcc gperf"
build() {
cp -rp "${source_dir}"/. ./

configure_script_path=./configure \
CFLAGS="-DSLOW_BUT_NO_HACKS $CFLAGS" \
./configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-nls
autotools_configure

make -j${parallelism}
}
Expand Down
7 changes: 2 additions & 5 deletions recipes/cxxshim
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ revision=1
imagedeps="meson ninja git base-devel"

build() {
meson setup \
--prefix=${prefix} \
--libdir=lib \
meson_configure \
--includedir=share/cxxshim/include \
-Dinstall_headers=true \
${source_dir}
-Dinstall_headers=true

ninja -j${parallelism}
}
Expand Down
8 changes: 2 additions & 6 deletions recipes/diffutils
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ deps="core-libs"
build() {
cp -rp "${source_dir}"/. ./

./configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-nls
configure_script_path=./configure
autotools_configure

make -j${parallelism}
}
Expand Down
8 changes: 2 additions & 6 deletions recipes/findutils
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ imagedeps="python"
build() {
cp -rp "${source_dir}"/. ./

./configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-nls \
configure_script_path=./configure \
autotools_configure \
--without-selinux

make -j${parallelism}
Expand Down
9 changes: 1 addition & 8 deletions recipes/fontconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ deps="core-libs freetype libexpat libxml"
imagedeps="python gperf"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static \
--disable-docs \
--disable-nls \
autotools_configure \
--enable-libxml2

make -j${parallelism}
Expand Down
7 changes: 1 addition & 6 deletions recipes/freetype
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ deps="core-libs bzip2 libpng zlib"
imagedeps="gcc"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static \
autotools_configure \
--with-harfbuzz=no

make -j${parallelism}
Expand Down
7 changes: 2 additions & 5 deletions recipes/frigg
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ revision=1
imagedeps="meson ninja git base-devel"

build() {
meson setup \
--prefix=${prefix} \
--libdir=lib \
meson_configure \
--includedir=share/frigg/include \
--buildtype=debugoptimized \
-Dbuild_tests=disabled \
${source_dir}
-Dbuild_tests=disabled

ninja -j${parallelism}
}
Expand Down
8 changes: 2 additions & 6 deletions recipes/gawk
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ deps="core-libs mpfr gmp readline"
build() {
cp -rp "${source_dir}"/. ./

./configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-nls
configure_script_path=./configure \
autotools_configure

make -j${parallelism}
}
Expand Down
20 changes: 7 additions & 13 deletions recipes/gcc
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ imagedeps="gcc"
build() {
CXXFLAGS_FOR_TARGET="$CFLAGS" \
CFLAGS_FOR_TARGET="$CFLAGS" \
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--target=${OS_TRIPLET} \
--with-sysroot=/ \
autotools_configure \
--target=${OS_TRIPLET} \
--with-sysroot=/ \
--with-build-sysroot=${sysroot_dir} \
--enable-languages=c,c++,lto \
--enable-initfini-array \
--disable-multilib \
--disable-nls \
--with-system-zlib \
--enable-shared \
--enable-languages=c,c++,lto \
--enable-initfini-array \
--disable-multilib \
--with-system-zlib \
--enable-host-shared

make -j${parallelism} all-gcc
Expand Down
10 changes: 2 additions & 8 deletions recipes/gmp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-cxx \
--disable-static \
--with-sysroot=${sysroot_dir}
autotools_configure \
--enable-cxx

make -j${parallelism}
}
Expand Down
8 changes: 2 additions & 6 deletions recipes/grep
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ imagedeps="gperf"
build() {
cp -rp "${source_dir}"/. ./

./configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-nls
configure_script_path=./configure \
autotools_configure

make -j${parallelism}
}
Expand Down
8 changes: 2 additions & 6 deletions recipes/gzip
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ deps="core-libs"
build() {
cp -rp "${source_dir}"/. ./

./configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static
configure_script_path=./configure \
autotools_configure

make -j${parallelism}
}
Expand Down
6 changes: 1 addition & 5 deletions recipes/less
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs ncurses"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix="${prefix}" \
--sysconfdir=/etc \
--localstatedir=/var
autotools_configure

make -j${parallelism}
}
Expand Down
8 changes: 2 additions & 6 deletions recipes/libepoxy
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ deps="core-libs mesa xorg-proto libx11"
imagedeps="meson ninja"

build() {
meson setup \
--cross-file ${base_dir}/build-support/cross_file.txt \
--prefix=${prefix} \
--buildtype=release \
meson_configure \
-Degl=no \
-Dtests=false \
${source_dir}
-Dtests=false

ninja -j${parallelism}
}
Expand Down
7 changes: 1 addition & 6 deletions recipes/libexpat
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static \
autotools_configure \
--without-xmlwf

make -j${parallelism}
Expand Down
7 changes: 1 addition & 6 deletions recipes/libffi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static
autotools_configure

make -j${parallelism}
}
Expand Down
7 changes: 1 addition & 6 deletions recipes/libfontenc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs xorg-proto zlib"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static
autotools_configure

make -j${parallelism}
}
Expand Down
7 changes: 1 addition & 6 deletions recipes/libice
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs xorg-util-macros xorg-proto libx11 libxtrans"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static
autotools_configure

make -j${parallelism}
}
Expand Down
9 changes: 1 addition & 8 deletions recipes/libiconv
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ deps="mlibc libgcc libstdc++"
imagedeps="binutils"

build() {
${source_dir}/configure \
--host=${OS_TRIPLET} \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static \
--enable-shared \
--disable-nls
autotools_configure

make -j${parallelism}
}
Expand Down
Loading

0 comments on commit cc92987

Please sign in to comment.