aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcore/bearssl/build4
-rwxr-xr-xcore/binutils/build18
-rwxr-xr-xcore/busybox/build14
-rwxr-xr-xcore/byacc/build3
-rwxr-xr-xcore/bzip2/build15
-rwxr-xr-xcore/carbs-init/build4
-rwxr-xr-xcore/cpt/build5
-rw-r--r--core/cpt/checksums1
-rw-r--r--core/cpt/sources2
-rw-r--r--core/cpt/version2
-rwxr-xr-xcore/curl/build3
-rwxr-xr-xcore/flex/build4
-rwxr-xr-xcore/git/build5
-rwxr-xr-xcore/gzip/build2
-rwxr-xr-xcore/libelf/build3
-rwxr-xr-xcore/m4/build3
-rwxr-xr-xcore/make/build3
-rwxr-xr-xcore/musl/build26
-rwxr-xr-xcore/pkgconf/build6
-rwxr-xr-xcore/redo/build9
-rwxr-xr-xcore/rsync/build4
-rwxr-xr-xcore/sbase/build10
-rwxr-xr-xcore/xz/build3
-rwxr-xr-xcore/zlib/build3
-rwxr-xr-xextra/coreutils/build3
-rwxr-xr-xextra/dash/build3
-rwxr-xr-xextra/nano/build4
-rwxr-xr-xextra/ncurses/build4
28 files changed, 84 insertions, 82 deletions
diff --git a/core/bearssl/build b/core/bearssl/build
index c0e5e7f2..2faf0498 100755
--- a/core/bearssl/build
+++ b/core/bearssl/build
@@ -9,7 +9,9 @@ kinstall() {
chmod "$1" "$3"
}
-make "CC=${CC:=cc}" "AR=${AR:=ar}" LD=$CC
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc AR=$CPT_CROSS_TRIPLET-ar
+
+make "CC=${CC:=cc}" "AR=${AR:=ar}" LD=$CC LDDLL=$CC
# Build static binary for bearssl, word splitting on CFLAGS is intentional.
# shellcheck disable=2086
diff --git a/core/binutils/build b/core/binutils/build
index 67a1af16..f7e86098 100755
--- a/core/binutils/build
+++ b/core/binutils/build
@@ -1,27 +1,22 @@
#!/bin/sh -e
# Architecture specific build options
-case ${3:-$(uname -m)} in
- i*86) archopts="--build=i686-pc-linux-musl \
- --host=i686-pc-linux-musl \
- --enable-64-bit-bfd" ;;
- x86_64) archopts="--build=x86_64-pc-linux-musl \
- --host=x86_64-pc-linux-musl"
+case "$3" in
+ i?86) archopts="--enable-64-bit-bfd"
esac
-cat > makeinfo <<EOF
+command -v makeinfo >/dev/null || { cat > makeinfo <<EOF
#!/bin/sh
printf 'makeinfo (GNU texinfo) 5.2\n'
EOF
chmod +x makeinfo
export PATH=$PATH:$PWD
+}
# Word splitting is intentional here.
# shellcheck disable=2086
-./configure \
- --prefix=/usr \
- $archopts \
+cpt-configure \
--enable-targets=x86_64-pep \
--disable-multilib \
--disable-werror \
@@ -30,7 +25,8 @@ export PATH=$PATH:$PWD
--disable-readline \
--disable-gprof \
--with-mmap \
- --with-system-zlib
+ --with-system-zlib \
+ "$archopts"
make
make DESTDIR="$1" install
diff --git a/core/busybox/build b/core/busybox/build
index df00282d..a34e5e3c 100755
--- a/core/busybox/build
+++ b/core/busybox/build
@@ -10,10 +10,16 @@ for patch in *.patch; do
patch -p1 < "$patch"
done
+if [ "$CPT_CROSS_TRIPLET" ]; then
+ mk() { make "ARCH=${CPT_CROSS_TRIPLET%%-*}" "CROSS_COMPILE=$CPT_CROSS_TRIPLET-" "$@" ;}
+else
+ mk() { make "$@" ;}
+fi
+
# Build and install regular busybox.
# This excludes utilities which require 'suid' to function.
-make CC="${CC:-gcc}"
-make CONFIG_PREFIX="$1/usr" install
+mk
+mk CONFIG_PREFIX="$1/usr" install
# Rename the binary temporarily.
mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-nosuid"
@@ -21,8 +27,8 @@ mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-nosuid"
# Build and install suid busybox.
# This _only_ includes utlities which require 'suid' to function.
cp -f .config-suid .config
-make CC="${CC:-gcc}"
-make CONFIG_PREFIX="$1/usr" install
+mk
+mk CONFIG_PREFIX="$1/usr" install
# Aptly name the busybox binaries.
mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-suid"
diff --git a/core/byacc/build b/core/byacc/build
index cc21d9ed..f3cc6001 100755
--- a/core/byacc/build
+++ b/core/byacc/build
@@ -2,8 +2,7 @@
export LDFLAGS="$LDFLAGS -static"
-./configure \
- --prefix=/usr \
+cpt-configure \
--program-transform='s/^/b/'
make
diff --git a/core/bzip2/build b/core/bzip2/build
index ac1055b2..4145c782 100755
--- a/core/bzip2/build
+++ b/core/bzip2/build
@@ -1,10 +1,17 @@
#!/bin/sh -e
-make CC="${CC:-cc} $CFLAGS -fPIC $LDFLAGS" -f Makefile-libbz2_so
-make CC="${CC:-cc} $CFLAGS -fPIC $LDFLAGS" bzip2recover libbz2.a
+[ "$CPT_CROSS_TRIPLET" ] &&
+ CC=$CPT_CROSS_TRIPLET-cc AR=$CPT_CROSS_TRIPLET-ar RANLIB=$CPT_CROSS_TRIPLET-ranlib
-for bin in bzip2-shared bzdiff bzgrep bzip2recover bzmore; do
- install -Dm755 "$bin" "$1/usr/bin/${bin%%-shared}"
+LD=${CC:=cc}
+CC="$CC $CFLAGS -fPIC $LDFLAGS"
+
+make CC="$CC" LD="$LD" -f Makefile-libbz2_so
+make CC="$CC" AR="${AR:-ar}" RANLIB="${RANLIB:-ranlib}" LD="$LD" \
+ bzip2 bzip2recover libbz2.a
+
+for bin in bzip2 bzdiff bzgrep bzip2recover bzmore; do
+ install -Dm755 "$bin" "$1/usr/bin/$bin"
done
install -Dm755 libbz2.so.1.0.8 "$1/usr/lib/libbz2.so.1.0.8"
diff --git a/core/carbs-init/build b/core/carbs-init/build
index c46dc3e2..4fa04cb5 100755
--- a/core/carbs-init/build
+++ b/core/carbs-init/build
@@ -2,4 +2,6 @@
patch -p1 < respawn-fix.patch
-make DESTDIR="$1" install
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc
+
+make CC="${CC:-cc}" DESTDIR="$1" install
diff --git a/core/cpt/build b/core/cpt/build
index 11f03c51..0a4b365c 100755
--- a/core/cpt/build
+++ b/core/cpt/build
@@ -1,9 +1,8 @@
#!/bin/sh -e
-make PREFIX=/usr DESTDIR="$1" install
+REDO=$(command -v redo) || REDO=./tools/do
+DESTDIR=$1 PREFIX=/usr "$REDO" install
install -Dm644 cpt-base "$1/etc/cpt-base"
install -Dm755 news "$1/usr/bin/cpt-news"
-# TODO Remove this on the next release
-rm -f "$1/usr/bin/Makefile"
diff --git a/core/cpt/checksums b/core/cpt/checksums
index 22920f68..9dc41d0d 100644
--- a/core/cpt/checksums
+++ b/core/cpt/checksums
@@ -1,2 +1 @@
-04228de4e637b2437101af72b841bf153ecad7ae3e9a2b7a9dce83017d2b0740 cpt-5.1.1.tar.gz
6813f2db74869f07eceb79421670d6a5ad51c54070f8d19ff1b6fd739297b02c news
diff --git a/core/cpt/sources b/core/cpt/sources
index 18ac3d39..a269caed 100644
--- a/core/cpt/sources
+++ b/core/cpt/sources
@@ -1,2 +1,2 @@
-https://git.carbslinux.org/archive/cpt/cpt-5.1.1.tar.gz
+git+git://git.carbslinux.org/cpt@helpers
files/news
diff --git a/core/cpt/version b/core/cpt/version
index 3963d30a..a383ea1a 100644
--- a/core/cpt/version
+++ b/core/cpt/version
@@ -1 +1 @@
-5.1.1 1
+git 1
diff --git a/core/curl/build b/core/curl/build
index f27b1522..f5630ab3 100755
--- a/core/curl/build
+++ b/core/curl/build
@@ -1,7 +1,6 @@
#!/bin/sh -e
-./configure \
- --prefix=/usr \
+cpt-configure \
--enable-ipv6 \
--enable-unix-sockets \
--enable-hidden-symbols \
diff --git a/core/flex/build b/core/flex/build
index c0aa1260..e0305c7c 100755
--- a/core/flex/build
+++ b/core/flex/build
@@ -1,8 +1,6 @@
#!/bin/sh -e
-./configure \
- --prefix=/usr \
- --disable-static \
+cpt-configure \
--enable-shared \
ac_cv_func_malloc_0_nonnull=yes \
ac_cv_func_realloc_0_nonnull=yes
diff --git a/core/git/build b/core/git/build
index a0228ee5..eb336bb3 100755
--- a/core/git/build
+++ b/core/git/build
@@ -2,6 +2,8 @@
sed -i '/^\#include.*openssl.*\.h/d' git-compat-util.h
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc
+
cat > config.mak <<EOF
NO_GETTEXT=YesPlease
NO_SVN_TESTS=YesPlease
@@ -18,8 +20,7 @@ EOF
export LDFLAGS="$LDFLAGS -static"
-./configure \
- --prefix=/usr \
+cpt-configure \
--with-curl \
ac_cv_snprintf_returns_bogus=no \
ac_cv_fread_reads_directories=yes
diff --git a/core/gzip/build b/core/gzip/build
index 8d190a07..c9a82357 100755
--- a/core/gzip/build
+++ b/core/gzip/build
@@ -1,5 +1,7 @@
#!/bin/sh -e
+[ "$CPT_CROSS_TRIPLET" ] &&
+ CC="$CPT_CROSS_TRIPLET-cc -L$CPT_ROOT/usr/lib -isystem $CPT_ROOT/usr/include"
make CC="${CC:-cc} -static"
install -Dm755 pigz "$1/usr/bin/pigz"
diff --git a/core/libelf/build b/core/libelf/build
index 7bade69a..003b171e 100755
--- a/core/libelf/build
+++ b/core/libelf/build
@@ -9,8 +9,7 @@ sed -i 's/as_fn_error.*libargp/: "/g' configure
# Don't compile two unrelated C files which require argp.
sed -i 's/color.*printversion../#/g' lib/Makefile.in
-./configure \
- --prefix=/usr \
+cpt-configure \
--disable-symbol-versioning \
--disable-debuginfod \
--disable-nls
diff --git a/core/m4/build b/core/m4/build
index bbd53ee2..adbcf2ea 100755
--- a/core/m4/build
+++ b/core/m4/build
@@ -2,8 +2,7 @@
export LDFLAGS="$LDFLAGS -static"
-./configure \
- --prefix=/usr
+cpt-configure
make
make DESTDIR="$1" install
diff --git a/core/make/build b/core/make/build
index 265eeb2d..ffb942a7 100755
--- a/core/make/build
+++ b/core/make/build
@@ -2,8 +2,7 @@
export LDFLAGS="$LDFLAGS -static"
-./configure \
- --prefix=/usr \
+cpt-configure \
--disable-nls \
--without-guile \
"$(cpt l --check make -- '' --disable-dependency-tracking)"
diff --git a/core/musl/build b/core/musl/build
index 44b80ec1..93396adc 100755
--- a/core/musl/build
+++ b/core/musl/build
@@ -1,10 +1,5 @@
#!/bin/sh -e
-# Set the variable sys_arch so that we can change the
-# build procedure depending on the host arch. Currently,
-# we are only supporting i686 and x86_64.
-sys_arch="$(uname -m)"
-
kinstall_t() {
# install -Dm* -t alternative
# usage: kinstall_t 755 /usr/bin file file2 file3
@@ -18,8 +13,9 @@ kinstall_t() {
patch -p0 < CVE-2020-28928.patch
-./configure \
- --prefix=/usr \
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc AR=$CPT_CROSS_TRIPLET-ar
+
+cpt-configure \
--syslibdir=/usr/lib
make
@@ -27,13 +23,9 @@ make DESTDIR="$1" install
mkdir -p "$1/usr/bin"
-case "$sys_arch" in
- x86_64) ln -s /usr/lib/ld-musl-x86_64.so.1 "$1/usr/bin/ldd" ;;
- i*86)
- ln -s libc.so "$1/usr/lib/libc.musl-x86.so"
- ln -s ../lib/ld-musl-i386.so.1 "$1/usr/bin/ldd"
- ;;
-esac
+ARCH=$(sed -n '/^ARCH =/s/.* //p' config.mak)
+ln -sf libc.so "$1/usr/lib/ld-musl-$ARCH.so.1"
+ln -s "../lib/ld-musl-$ARCH.so.1" "$1/usr/bin/ldd"
# Install BSD compatibility headers.
kinstall_t 755 "$1/usr/include/sys" cdefs.h queue.h tree.h
@@ -41,10 +33,8 @@ kinstall_t 755 "$1/usr/include/sys" cdefs.h queue.h tree.h
# Install getconf.
"${CC:=cc}" --static getconf.c -o "$1/usr/bin/getconf"
-case $sys_arch in i*86)
- "$CC" -c __stack_chk_fail_local.c -o __stack_chk_fail_local.o
- ar r "$1/usr/lib/libssp_nonshared.a" __stack_chk_fail_local.o
-esac
+"$CC" -c __stack_chk_fail_local.c -o __stack_chk_fail_local.o
+"${AR:-ar}" r "$1/usr/lib/libssp_nonshared.a" __stack_chk_fail_local.o
# Install getent
kinstall_t 755 "$1/usr/bin" getent
diff --git a/core/pkgconf/build b/core/pkgconf/build
index 6e976679..40e72d85 100755
--- a/core/pkgconf/build
+++ b/core/pkgconf/build
@@ -1,8 +1,8 @@
#!/bin/sh -e
-./configure \
- --prefix=/usr \
- --sysconfdir=/etc
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc
+
+cpt-configure
make CCLD="${CC:-cc} -all-static"
make DESTDIR="$1" install
diff --git a/core/redo/build b/core/redo/build
index cfc0450a..c27b9c0b 100755
--- a/core/redo/build
+++ b/core/redo/build
@@ -1,9 +1,12 @@
#!/bin/sh -e
-"${CC:=cc}" -Os -Wall -Wextra -Wwrite-strings -c -o redo.o redo.c
-"$CC" -static -o redo redo.c
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc
-for file in redo redo-sources redo-targets; do
+mkdir -p "$1/usr/bin"
+
+"${CC:=cc}" -static -Os -Wall -Wextra -Wwrite-strings -o "$1/usr/bin/redo" redo.c
+
+for file in redo-sources redo-targets; do
install -Dm755 "$file" "$1/usr/bin/$file"
done
diff --git a/core/rsync/build b/core/rsync/build
index ca967731..afdf2b98 100755
--- a/core/rsync/build
+++ b/core/rsync/build
@@ -7,10 +7,10 @@ cat _ > Makefile.in; rm -f _
export CFLAGS="-static $CFLAGS"
-./configure \
- --prefix=/usr \
+cpt-configure \
--with-included-popt \
--disable-xxhash \
+ --disable-asm \
--disable-lz4 \
--disable-zstd \
--disable-openssl \
diff --git a/core/sbase/build b/core/sbase/build
index 6781199d..437ffb66 100755
--- a/core/sbase/build
+++ b/core/sbase/build
@@ -1,7 +1,13 @@
#!/bin/sh -e
-make LDFLAGS="$LDFLAGS -static" sbase-box
-make PREFIX=/usr DESTDIR="$1" sbase-box-install
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc \
+ AR=$CPT_CROSS_TRIPLET-ar \
+ RANLIB=$CPT_CROSS_TRIPLET-ranlib
+
+: "${CC:=cc}" "${AR:=ar}" "${RANLIB:=ranlib}"
+
+make CC=$CC AR=$AR RANLIB=$RANLIB LDFLAGS="$LDFLAGS -static" sbase-box
+make PREFIX=/usr DESTDIR="$1" sbase-box-install
unlink "$1/usr/bin/tar"
unlink "$1/usr/bin/sed"
diff --git a/core/xz/build b/core/xz/build
index 6daf22f8..ba56b362 100755
--- a/core/xz/build
+++ b/core/xz/build
@@ -1,7 +1,6 @@
#!/bin/sh -e
-./configure \
- --prefix=/usr
+cpt-configure
make
make DESTDIR="$1" install
diff --git a/core/zlib/build b/core/zlib/build
index 01090e82..c14fa524 100755
--- a/core/zlib/build
+++ b/core/zlib/build
@@ -1,5 +1,8 @@
#!/bin/sh -e
+[ "$CPT_CROSS_TRIPLET" ] && CC=$CPT_CROSS_TRIPLET-cc
+export CC
+
./configure \
--prefix=/usr \
--libdir=/usr/lib \
diff --git a/extra/coreutils/build b/extra/coreutils/build
index 206a476a..cf4e974a 100755
--- a/extra/coreutils/build
+++ b/extra/coreutils/build
@@ -2,8 +2,7 @@
export CFLAGS="$CFLAGS -static"
-./configure \
- --prefix=/usr
+cpt-configure
make
make DESTDIR="$1" install
diff --git a/extra/dash/build b/extra/dash/build
index 704d598e..cef83d13 100755
--- a/extra/dash/build
+++ b/extra/dash/build
@@ -2,8 +2,7 @@
export CFLAGS="$CFLAGS -static"
-./configure \
- --prefix=/usr
+cpt-configure
make
make DESTDIR="$1" install
diff --git a/extra/nano/build b/extra/nano/build
index ba2adac0..adbcf2ea 100755
--- a/extra/nano/build
+++ b/extra/nano/build
@@ -2,9 +2,7 @@
export LDFLAGS="$LDFLAGS -static"
-./configure \
- --prefix=/usr \
- --sysconfdir=/etc
+cpt-configure
make
make DESTDIR="$1" install
diff --git a/extra/ncurses/build b/extra/ncurses/build
index f8be7ab5..27fc49b1 100755
--- a/extra/ncurses/build
+++ b/extra/ncurses/build
@@ -1,8 +1,6 @@
#!/bin/sh -e
-./configure \
- --prefix=/usr \
- --mandir=/usr/share/man \
+cpt-configure \
--enable-pc-files \
--disable-rpath-hack \
--with-pkg-config-libdir=/usr/lib/pkgconfig \