Use zig for cross compilation
This commit is contained in:
parent
98668355af
commit
0c9d83aecf
14
Dockerfile
14
Dockerfile
@ -1,20 +1,16 @@
|
||||
# Despite convention, Ubuntu's "latest" tag points to the latest LTS release.
|
||||
FROM ubuntu:latest
|
||||
|
||||
LABEL org.opencontainers.image.authors="llamasoft@rm-rf.email"
|
||||
LABEL org.opencontainers.image.url="https://github.com/llamasoft/static-builder"
|
||||
FROM docker.io/library/alpine:latest
|
||||
|
||||
# This is all that's required for the build process.
|
||||
# Some packages are already installed but are included for completeness.
|
||||
RUN apt-get update && apt-get upgrade -y \
|
||||
&& apt-get install -y \
|
||||
gcc g++ \
|
||||
RUN apk add install -y \
|
||||
zig llvm \
|
||||
make autoconf automake libtool patch \
|
||||
flex bison \
|
||||
curl \
|
||||
tar gzip bzip2 xz-utils cmake build-essential pkg-config linux-headers-generic
|
||||
tar zstd gzip bzip2 xz-utils cmake build-essential pkg-config linux-headers-generic
|
||||
|
||||
RUN mkdir -p "/build" && chown 1000:1000 /build
|
||||
RUN install -d -o 1000 -g 1000 "/build"
|
||||
COPY "Makefile" "/build/"
|
||||
COPY "include" "/build/include"
|
||||
VOLUME "/build"
|
||||
|
56
Makefile
56
Makefile
@ -52,7 +52,7 @@ endif
|
||||
SHELL := /bin/bash
|
||||
|
||||
CFLAGS = -g0 -Os
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
CXXFLAGS = -g0 -Os
|
||||
|
||||
# Just in case the user forgets that we're doing static builds.
|
||||
override LDFLAGS += -static
|
||||
@ -95,7 +95,7 @@ endif
|
||||
OPENSSL := libressl
|
||||
# OPENSSL := openssl
|
||||
|
||||
BUILD_TRIPLE := $(shell $(CC) -dumpmachine 2>/dev/null)
|
||||
BUILD_TRIPLE := $(shell $(filter-out --target%,$(CC)) -dumpmachine 2>/dev/null)
|
||||
CONFIGURE_DEFAULTS = --build="$(BUILD_TRIPLE)" --host="$(TARGET)" --prefix="$(SYSROOT)"
|
||||
|
||||
|
||||
@ -136,27 +136,29 @@ endef
|
||||
|
||||
define activate_toolchain
|
||||
$(call activate_paths,$(1))
|
||||
$(1): export AR=$(SYSROOT)/bin/$(TARGET)-ar
|
||||
$(1): export AS=$(SYSROOT)/bin/$(TARGET)-as
|
||||
$(1): export CC=$(SYSROOT)/bin/$(TARGET)-cc
|
||||
$(1): export CXX=$(SYSROOT)/bin/$(TARGET)-g++
|
||||
$(1): export LD=$(SYSROOT)/bin/$(TARGET)-ld
|
||||
$(1): export NM=$(SYSROOT)/bin/$(TARGET)-nm
|
||||
$(1): export OBJCOPY=$(SYSROOT)/bin/$(TARGET)-objcopy
|
||||
$(1): export OBJDUMP=$(SYSROOT)/bin/$(TARGET)-objdump
|
||||
$(1): export RANLIB=$(SYSROOT)/bin/$(TARGET)-ranlib
|
||||
$(1): export READELF=$(SYSROOT)/bin/$(TARGET)-readelf
|
||||
$(1): export STRIP=$(SYSROOT)/bin/$(TARGET)-strip
|
||||
$(1): export HOSTCC=zig cc
|
||||
$(1): export HOSTCXX=zig c++
|
||||
$(1): export AR=/opt/homebrew/bin/zig ar
|
||||
$(1): export AS=llvm-as
|
||||
$(1): export CC=/opt/homebrew/bin/zig cc --target=$(TARGET)
|
||||
$(1): export CXX=/opt/homebrew/bin/zig c++ --target=$(TARGET)
|
||||
# $(1): export LD=llvm-ld
|
||||
$(1): export NM=llvm-nm
|
||||
$(1): export OBJCOPY=/opt/homebrew/bin/zig objcopy
|
||||
$(1): export OBJDUMP=llvm-objdump
|
||||
$(1): export RANLIB=/opt/homebrew/bin/zig ranlib
|
||||
$(1): export READELF=llvm-readelf
|
||||
$(1): export STRIP=llvm-strip
|
||||
endef
|
||||
|
||||
# Downloads and unpacks a tar file.
|
||||
define untar_to_dir
|
||||
define tar_to_tar_zstd
|
||||
mkdir -p "$(dir $(2))"
|
||||
$(DOWNLOAD) "$(2).tgz" "$(1)"
|
||||
$(DOWNLOAD) "$(2).download" "$(1)"
|
||||
mkdir -p "$(2).tmp"
|
||||
tar xf "$(2).tgz" --strip-components=1 -C "$(2).tmp"
|
||||
$(RM) "$(2).tgz"
|
||||
mv "$(2).tmp" "$(2)"
|
||||
tar --strip-components=1 -C "$(2).tmp" -xf "$(2).download"
|
||||
tar --zstd -C "$(2).tmp" -cf "$(2)" "." || ($(RM) "$(2)" ; exit 1)
|
||||
$(RM) -rf "$(2).download" "$(2).tmp"
|
||||
endef
|
||||
|
||||
# Creates variables based on library names.
|
||||
@ -194,7 +196,7 @@ else
|
||||
all_recipes += $$(name)
|
||||
endif
|
||||
|
||||
orig_src := $$(SOURCE_ROOT)/$$(name)-$$(version)
|
||||
orig_src := $$(SOURCE_ROOT)/$$(name)-$$(version).tar.zstd
|
||||
work_src := $$(WORK_ROOT)/$$(name)-$$(version)
|
||||
src := $$(work_src)
|
||||
bin_paths := $$(addprefix $$(OUTPUT)/bin/,$$(bin_names))
|
||||
@ -224,32 +226,33 @@ BUILD_FLAG := $$(SYSROOT)/$$(name).built
|
||||
|
||||
ifneq (,$$(bin_paths))
|
||||
# Binaries need to be copied from SYSROOT/bin/ to OUTPUT/bin/.
|
||||
$$(bin_paths): $$(BUILD_FLAG) | $$$$(MUSL)
|
||||
$$(bin_paths): $$(BUILD_FLAG)
|
||||
$$(eval $$(call activate_toolchain,$$@))
|
||||
mkdir -p "$$(@D)"
|
||||
mv "$$(SYSROOT)/bin/$$(@F)" "$$@"
|
||||
install "$$(SYSROOT)/bin/$$(@F)" "$$@"
|
||||
- $$(STRIP) --strip-unneeded "$$@"
|
||||
ls -al "$$@"
|
||||
endif
|
||||
|
||||
ifneq (,$$(lib_paths))
|
||||
# Libraries are already in their final location.
|
||||
$$(lib_paths): $$(BUILD_FLAG) | $$$$(MUSL) ;
|
||||
$$(lib_paths): $$(BUILD_FLAG) ;
|
||||
endif
|
||||
|
||||
# This is main build recipe that the package's makefile must provide.
|
||||
# It should take the source code and output the built programs
|
||||
# and libraries into the SYSROOT directory tree.
|
||||
# Here we merely provide the recipe definition and base dependencies.
|
||||
$$(BUILD_FLAG): $$(src) | $$$$(MUSL)
|
||||
$$(BUILD_FLAG): $$(src)
|
||||
|
||||
$$(orig_src):
|
||||
echo orig $$(ORIG_SRC)
|
||||
$$(call untar_to_dir,$$(URL),$$@)
|
||||
$$(call tar_to_tar_zstd,$$(URL),$$@)
|
||||
|
||||
$$(work_src): $$(orig_src)
|
||||
rm -rf $$(SRC)
|
||||
cp -a $$(ORIG_SRC) $$(SRC)
|
||||
mkdir -p $$(SRC)
|
||||
tar -C $$(SRC) -xf $$(ORIG_SRC)
|
||||
endef
|
||||
|
||||
# Never implicitly pass this makefile's command-line variables
|
||||
@ -303,7 +306,7 @@ help usage:
|
||||
|
||||
# Apparently the help output varies between toolchains so we'll try both.
|
||||
.PHONY: archlist
|
||||
archlist: | $$(MUSL)
|
||||
archlist:
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
-@ "$(CC)" -march="x" 2>&1 | grep -F "valid arguments" || true
|
||||
-@ "$(CC)" --target-help 2>&1 | sed -n '/Known.*-march/,/^$$/p' || true
|
||||
@ -312,7 +315,6 @@ archlist: | $$(MUSL)
|
||||
.PHONY: mostlyclean
|
||||
mostlyclean:
|
||||
- $(RM) -r \
|
||||
$(filter-out $(MUSL_SRC),$(wildcard $(SOURCE_ROOT)/*-*)) \
|
||||
"$(SOURCE_ROOT)/"*.tgz \
|
||||
"$(SOURCE_ROOT)/"*.tmp
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := bash
|
||||
BASH_VERSION := 5.2.32
|
||||
BASH_VERSION := 5.2.37
|
||||
BASH_URL := https://ftp.gnu.org/gnu/bash/bash-$(BASH_VERSION).tar.gz
|
||||
BASH_PROGRAMS := bash
|
||||
BASH_LIBRARIES :=
|
||||
@ -20,11 +20,11 @@ $(BASH_MUSL_PATCH): $(src)
|
||||
cd "$(SRC)" && patch -p1 < $(MAKEFILE_DIR)/include/bash-musl.patch
|
||||
touch $(BASH_MUSL_PATCH)
|
||||
|
||||
$(BUILD_FLAG):
|
||||
$(BUILD_FLAG): $$(libncurses) $$(libreadline)
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
cd "$(SRC)" && ./configure \
|
||||
$(CONFIGURE_DEFAULTS) --without-bash-malloc \
|
||||
--enable-static-link \
|
||||
--enable-static-link --with-curses --with-readline \
|
||||
$(BASH_CONFIG) \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
|
@ -1,10 +1,10 @@
|
||||
NAME := curl
|
||||
CURL_VERSION := 8.9.1
|
||||
CURL_VERSION := 8.12.1
|
||||
CURL_URL := https://github.com/curl/curl/releases/download/curl-$(subst .,_,$(CURL_VERSION))/curl-$(CURL_VERSION).tar.gz
|
||||
CURL_PROGRAMS := curl
|
||||
CURL_LIBRARIES := libcurl.a
|
||||
|
||||
CURL_CONFIG = --with-ca-bundle=/etc/ssl/ca-bundle.pem
|
||||
CURL_CONFIG = --with-ca-bundle=/etc/ssl/ca-bundle.pem --with-ca-embed=/etc/ssl/ca-bundle.pem
|
||||
|
||||
# WolfSSL results in a much smaller binary (around 1MB).
|
||||
# The only reason you'd use OpenSSL here is if you already
|
||||
@ -25,13 +25,14 @@ $(eval $(call create_recipes, \
|
||||
# configure script doesn't use libtool, so the flag must be injected
|
||||
# at built-time only, otherwise the configure will fail.
|
||||
# See https://stackoverflow.com/a/54168321/477563
|
||||
$(BUILD_FLAG): $$(libz)
|
||||
$(BUILD_FLAG): $$(libz) $$(libpsl) $$(libzstd)
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
cd "$(SRC)" && ./configure \
|
||||
$(CONFIGURE_DEFAULTS) \
|
||||
--disable-shared --enable-static --with-$(LIB_SSL) \
|
||||
--with-zlib="$(SYSROOT)" \
|
||||
--disable-shared --enable-static --with-$(LIB_SSL) --without-libpsl \
|
||||
$(CURL_CONFIG) \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(filter -L%,$(LDFLAGS))"
|
||||
CFLAGS="$(filter-out -I%,$(CFLAGS))" CPPFLAGS="$(CXXFLAGS)" LDFLAGS="$(filter -L%,$(LDFLAGS))" CC="$(CC)"
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
$(MAKE) -C "$(SRC)" LDFLAGS="$(LDFLAGS) -all-static"
|
||||
$(MAKE) -C "$(SRC)" install
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := dropbear
|
||||
DROPBEAR_VERSION := 2022.83
|
||||
DROPBEAR_VERSION := 2024.86
|
||||
DROPBEAR_URL := https://github.com/mkj/dropbear/archive/refs/tags/DROPBEAR_$(DROPBEAR_VERSION).tar.gz
|
||||
DROPBEAR_PROGRAMS := dropbear dbclient dropbearkey dropbearconvert scp
|
||||
DROPBEAR_LIBRARIES :=
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := libexpat
|
||||
EXPAT_VERSION := 2.6.2
|
||||
EXPAT_VERSION := 2.6.4
|
||||
|
||||
# The download URL should point to a tar archive of some sort.
|
||||
# On most systems, tar will handle most compression formats, so
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := git
|
||||
GIT_VERSION := 2.46.0
|
||||
GIT_VERSION := 2.48.1
|
||||
|
||||
# The download URL should point to a tar archive of some sort.
|
||||
# On most systems, tar will handle most compression formats, so
|
||||
@ -10,7 +10,7 @@ GIT_URL := https://github.com/git/git/archive/refs/tags/v$(GIT_VERSION).tar.gz
|
||||
# The list of all programs that the package builds.
|
||||
# These targets can be called and built from the command line.
|
||||
# If the package provides no programs, leave this list empty.
|
||||
GIT_PROGRAMS := git git.tar.gz
|
||||
GIT_PROGRAMS := git git.tar.zstd
|
||||
|
||||
|
||||
# The list of library names that the package builds.
|
||||
@ -22,6 +22,7 @@ GIT_PROGRAMS := git git.tar.gz
|
||||
# Allow the user to add any make, autoconf, or configure options that they want.
|
||||
# Feel free to put any reasonable default values here.
|
||||
GIT_CONFIG = INSTALL_SYMLINKS=1
|
||||
LIB_SSL := wolfssl
|
||||
|
||||
# This creates the recipe chain that downloads, extracts, builds, and strips
|
||||
# the binaries created by this package. This makes it so that only the main
|
||||
@ -33,7 +34,7 @@ $(eval $(call create_recipes, \
|
||||
$(GIT_PROGRAMS), \
|
||||
$(GIT_LIBRARIES), \
|
||||
))
|
||||
GIT_WOLFSSL_PATCH := $(src)/.wolfssl
|
||||
GIT_WOLFSSL_PATCH := $(src)/.github/wolfssl
|
||||
|
||||
# This is the main build recipe!
|
||||
# Using $(BUILD_FLAG) as a target, it must compile the sources in $(SRC) and
|
||||
@ -41,13 +42,10 @@ GIT_WOLFSSL_PATCH := $(src)/.wolfssl
|
||||
# depends on any libraries, add their variable representations to this target's
|
||||
# dependency list. For example, if the package depends on libsomething.a,
|
||||
# add $$(libsomething) to $(BUILD_FLAG)'s dependencies.
|
||||
$(GIT_WOLFSSL_PATCH): $(src)
|
||||
cd "$(SRC)" && patch -N -p1 < $(MAKEFILE_DIR)/include/git-wolfssl.patch
|
||||
touch $(GIT_WOLFSSL_PATCH)
|
||||
|
||||
TOOLS = AR=$(SYSROOT)/bin/$(TARGET)-ar AS=$(SYSROOT)/bin/$(TARGET)-as CC=$(SYSROOT)/bin/$(TARGET)-cc CXX=$(SYSROOT)/bin/$(TARGET)-g++ LD=$(SYSROOT)/bin/$(TARGET)-ld NM=$(SYSROOT)/bin/$(TARGET)-nm OBJCOPY=$(SYSROOT)/bin/$(TARGET)-objcopy OBJDUMP=$(SYSROOT)/bin/$(TARGET)-objdump RANLIB=$(SYSROOT)/bin/$(TARGET)-ranlib READELF=$(SYSROOT)/bin/$(TARGET)-readelf STRIP=$(SYSROOT)/bin/$(TARGET)-strip prefix="$(SYSROOT)"
|
||||
TOOLS = "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" "OBJDUMP=$(OBJDUMP)" "RANLIB=$(RANLIB)" "READELF=$(READELF)" "STRIP=$(STRIP)" prefix="$(SYSROOT)"
|
||||
|
||||
$(BUILD_FLAG): $$(libz) $$(libcurl) $$(libssl) $$(openssl) $$(curl) $(libexpat) $(GIT_WOLFSSL_PATCH)
|
||||
$(BUILD_FLAG): $$(libz) $$(libcurl) $$(wolfssl) $$(curl) $(libexpat)
|
||||
# This activates the cross-compiler toolchain by setting/exporting a lot of variables.
|
||||
# Without this, builds would default to the system's compilers and libraries.
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
@ -56,31 +54,25 @@ $(BUILD_FLAG): $$(libz) $$(libcurl) $$(libssl) $$(openssl) $$(curl) $(libexpat)
|
||||
# Try to only hard-code the flags that are critical to a successful static build.
|
||||
# Optional flags should be put in GIT_CONFIG so the user can override them.
|
||||
|
||||
bash -c "cd \"$(SRC)\" && test -f $(GIT_WOLFSSL_PATCH) || patch -N -p1 < $(MAKEFILE_DIR)/include/git-wolfssl.patch; true"
|
||||
touch $(GIT_WOLFSSL_PATCH)
|
||||
gsed -i '/LINK_FUZZ_PROGRAMS/d' "$(SRC)/config.mak.uname"
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
- $(RM) -rf /tmp/git
|
||||
- $(RM) -rf $(SYSROOT)/tmp/git
|
||||
$(MAKE) -C "$(SRC)" V=1 $(TOOLS) \
|
||||
NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) \
|
||||
CURL_LDFLAGS="-L/build/sysroot/aarch64-linux-musl/lib -lcurl $(SSL_CURL_FLAGS) -lm -lz" \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(GIT_CONFIG)
|
||||
NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) CURL_CONFIG="$(SYSROOT)/bin/curl-config" \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(GIT_CONFIG) uname_S=Linux
|
||||
$(MAKE) -C "$(SRC)" $(TOOLS) prefix="$(SYSROOT)" \
|
||||
NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) \
|
||||
CURL_LDFLAGS="-L/build/sysroot/aarch64-linux-musl/lib -lcurl $(SSL_CURL_FLAGS) -lm -lz" \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(GIT_CONFIG) install
|
||||
NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) CURL_CONFIG="$(SYSROOT)/bin/curl-config" \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(GIT_CONFIG) uname_S=Linux install
|
||||
$(MAKE) -C "$(SRC)" $(TOOLS) prefix="/" \
|
||||
NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) \
|
||||
CURL_LDFLAGS="-L/build/sysroot/aarch64-linux-musl/lib -lcurl $(SSL_CURL_FLAGS) -lm -lz" \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(GIT_CONFIG) DESTDIR=/tmp/git install
|
||||
cd /tmp/git && tar czf $(SYSROOT)/bin/git.tar.gz *
|
||||
cd "$(SRC)" && patch -R -p1 < $(MAKEFILE_DIR)/include/git-wolfssl.patch
|
||||
NO_REGEX=YesPlease NO_ICONV=YesPlease NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=1 $(SSL_FLAGS) CURL_CONFIG="$(SYSROOT)/bin/curl-config" \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(GIT_CONFIG) uname_S=Linux DESTDIR=$(SYSROOT)/tmp/git bindir="/usr/bin" install
|
||||
cd $(SYSROOT)/tmp/git && tar czf $(SYSROOT)/bin/git.tar.zstd *
|
||||
|
||||
SSL_FLAGS :=
|
||||
SSL_CURL_FLAGS := -lssl -lcrypto
|
||||
ifeq (wolfssl,$(LIB_SSL))
|
||||
SSL_FLAGS := USE_WOLFSSL=1 OPENSSL_SHA1=1 OPENSSL_SHA256=1 WOLFSSSLDIR="$(SYSROOT)"
|
||||
SSL_CURL_FLAGS := -lwolfssl
|
||||
|
||||
else ifeq (wolfssl,$(CURL_SSL))
|
||||
SSL_CURL_FLAGS := $(SSL_CURL_FLAGS) -lwolfssl
|
||||
endif
|
||||
|
||||
# All programs should add themselves to the ALL_PROGRAMS list.
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := iproute2
|
||||
IPROUTE2_VERSION := 6.10.0
|
||||
IPROUTE2_VERSION := 6.13.0
|
||||
|
||||
# The download URL should point to a tar archive of some sort.
|
||||
# On most systems, tar will handle most compression formats, so
|
||||
@ -10,7 +10,7 @@ IPROUTE2_URL := https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/ipr
|
||||
# The list of all programs that the package builds.
|
||||
# These targets can be called and built from the command line.
|
||||
# If the package provides no programs, leave this list empty.
|
||||
IPROUTE2_PROGRAMS := ip iproute2.tar.gz
|
||||
IPROUTE2_PROGRAMS := ip iproute2.tar.zstd
|
||||
|
||||
# The list of library names that the package builds.
|
||||
# If the package provides no libraries, leave this list empty.
|
||||
@ -47,12 +47,12 @@ $(BUILD_FLAG): $$(libmnl)
|
||||
# If available, the --host and --prefix values should always be the values below.
|
||||
# Try to only hard-code the flags that are critical to a successful static build.
|
||||
# Optional flags should be put in IPROUTE2_CONFIG so the user can override them.
|
||||
cd "$(SRC)" && PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(SYSROOT)/lib/pkgconfig" ./configure
|
||||
$(MAKE) -C "$(SRC)" clean EXTRA_CFLAGS="$(CFLAGS)" PREFIX="" LDFLAGS="$(LDFLAGS)" DESTDIR=/tmp/iproute2
|
||||
$(MAKE) -C "$(SRC)" HOSTCC=gcc EXTRA_CFLAGS="$(CFLAGS)" PREFIX="" LDFLAGS="$(LDFLAGS)" DESTDIR=/tmp/iproute2
|
||||
$(MAKE) -C "$(SRC)" install EXTRA_CFLAGS="$(CFLAGS)" PREFIX="" LDFLAGS="$(LDFLAGS)" DESTDIR=/tmp/iproute2 SUBDIRS="ip misc tc netem"
|
||||
cd /tmp/iproute2 && rm -rf share/bash-completion/ share/bash include && tar czf $(SYSROOT)/bin/iproute2.tar.gz *
|
||||
cp -a /tmp/iproute2/sbin/ip $(SYSROOT)/bin/
|
||||
cd "$(SRC)" && ./configure --prefix "/"
|
||||
$(MAKE) -C "$(SRC)" clean EXTRA_CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" DESTDIR=$(SYSROOT)/tmp/iproute2
|
||||
$(MAKE) -C "$(SRC)" EXTRA_CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" DESTDIR=$(SYSROOT)/tmp/iproute2
|
||||
$(MAKE) -C "$(SRC)" install EXTRA_CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" DESTDIR=$(SYSROOT)/tmp/iproute2
|
||||
cd $(SYSROOT)/tmp/iproute2 && rm -rf share/bash-completion/ share/bash include && tar czf $(SYSROOT)/bin/iproute2.tar.zstd *
|
||||
cp -a $(SYSROOT)/tmp/iproute2/sbin/ip $(SYSROOT)/bin/
|
||||
|
||||
# All programs should add themselves to the ALL_PROGRAMS list.
|
||||
ALL_PROGRAMS += $(IPROUTE2_PROGRAMS)
|
||||
|
@ -50,9 +50,8 @@ $(BUILD_FLAG): $$(libz)
|
||||
cd "$(SRC)" && ./configure \
|
||||
$(CONFIGURE_DEFAULTS) \
|
||||
--enable-static --disable-shared \
|
||||
--with-zlib="$(SYSROOT)" \
|
||||
$(LIBMNL_CONFIG) \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)"
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
$(MAKE) -C "$(SRC)"
|
||||
$(MAKE) -C "$(SRC)" install
|
||||
|
@ -1,7 +1,7 @@
|
||||
ifeq (libressl,$(OPENSSL))
|
||||
|
||||
NAME := libressl
|
||||
LIBRESSL_VERSION := 3.9.2
|
||||
LIBRESSL_VERSION := 4.0.0
|
||||
LIBRESSL_URL := https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$(LIBRESSL_VERSION).tar.gz
|
||||
LIBRESSL_PROGRAMS := openssl
|
||||
LIBRESSL_LIBRARIES := libssl.a libcrypto.a libtls.a
|
||||
|
@ -1,30 +0,0 @@
|
||||
# musl-cross-make hasn't had an official release since 2020 but has had many
|
||||
# updates and bigfixes since then. Instead, we'll download a commit directly.
|
||||
NAME := musl-cross-make
|
||||
MUSL_VERSION := fd6be58
|
||||
MUSL_URL := https://github.com/richfelker/musl-cross-make/tarball/$(MUSL_VERSION)
|
||||
MUSL_SRC := $(SOURCE_ROOT)/$(NAME)-$(MUSL_VERSION)
|
||||
MUSL := $(SYSROOT)/bin/$(TARGET)-cc
|
||||
|
||||
MUSL_CONFIG =
|
||||
|
||||
# NOTE: we can't use create_recipes otherwise musl will depend on itself.
|
||||
|
||||
.PHONY: musl
|
||||
musl: | $(MUSL)
|
||||
|
||||
$(MUSL): | $(MUSL_SRC)
|
||||
$(eval $(call activate_paths,$@))
|
||||
# Remove tar verbose flag as it results in over 120k lines of output.
|
||||
sed -i".bak" "s/xvf/xf/" "$(MUSL_SRC)/Makefile"
|
||||
$(MAKE) -C "$(MUSL_SRC)" \
|
||||
TARGET="$(TARGET)" \
|
||||
COMMON_CONFIG='CFLAGS="-g0 -Os" CXXFLAGS="-g0 -Os" LDFLAGS="-s"' \
|
||||
DL_CMD="$(DOWNLOAD)" \
|
||||
$(MUSL_CONFIG)
|
||||
$(MAKE) -C "$(MUSL_SRC)" install \
|
||||
TARGET="$(TARGET)" \
|
||||
OUTPUT="$(SYSROOT)"
|
||||
|
||||
$(MUSL_SRC):
|
||||
$(call untar_to_dir,$(MUSL_URL),$@)
|
@ -22,10 +22,10 @@ $(BUILD_FLAG):
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
cd "$(SRC)" && ./configure \
|
||||
$(CONFIGURE_DEFAULTS) \
|
||||
--without-manpages --without-progs --disable-ext-funcs \
|
||||
--without-tack --without-tests --without-debug \
|
||||
--without-manpages --without-progs --disable-lib-suffixes --disable-ext-funcs \
|
||||
--without-tack --without-tests --with-termlib --enable-termcap --without-debug \
|
||||
$(NCURSES_CONFIG) \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
$(MAKE) -C "$(SRC)" libs
|
||||
$(MAKE) -C "$(SRC)" install.libs
|
||||
$(MAKE) -C "$(SRC)" V=1 install.libs
|
||||
|
@ -30,4 +30,4 @@ $(BUILD_FLAG):
|
||||
$(MAKE) -C "$(SRC)" install-exec
|
||||
|
||||
ALL_PROGRAMS += $(NETCAT_PROGRAMS)
|
||||
DEFAULT_PROGRAMS += $(NETCAT_PROGRAMS)
|
||||
DEFAULT_PROGRAMS += $(NETCAT_PROGRAMS)
|
||||
|
@ -1,7 +1,7 @@
|
||||
ifeq (openssl,$(OPENSSL))
|
||||
|
||||
NAME := openssl
|
||||
OPENSSL_VERSION := 3.3.1
|
||||
OPENSSL_VERSION := 3.4.1
|
||||
OPENSSL_URL := https://github.com/openssl/openssl/archive/refs/tags/openssl-$(OPENSSL_VERSION).tar.gz
|
||||
OPENSSL_PROGRAMS := openssl
|
||||
OPENSSL_LIBRARIES := libssl.a libcrypto.a
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := pcap
|
||||
PCAP_VERSION := 1.10.4
|
||||
PCAP_VERSION := 1.10.5
|
||||
PCAP_URL := https://www.tcpdump.org/release/libpcap-$(PCAP_VERSION).tar.gz
|
||||
PCAP_PROGRAMS :=
|
||||
PCAP_LIBRARIES := libpcap.a
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := readline
|
||||
READLINE_VERSION := 8.3
|
||||
READLINE_VERSION := 8.2
|
||||
READLINE_URL := https://ftp.gnu.org/gnu/readline/readline-$(READLINE_VERSION).tar.gz
|
||||
READLINE_PROGRAMS :=
|
||||
READLINE_LIBRARIES := libreadline.a libhistory.a
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := socat
|
||||
SOCAT_VERSION := 1.8.0.0
|
||||
SOCAT_VERSION := 1.8.0.3
|
||||
SOCAT_URL := http://www.dest-unreach.org/socat/download/socat-$(SOCAT_VERSION).tar.gz
|
||||
SOCAT_PROGRAMS := socat procan filan
|
||||
SOCAT_LIBRARIES :=
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := strace
|
||||
STRACE_VERSION := 6.10
|
||||
STRACE_VERSION := 6.13
|
||||
STRACE_URL := https://github.com/strace/strace/releases/download/v$(STRACE_VERSION)/strace-$(STRACE_VERSION).tar.xz
|
||||
STRACE_PROGRAMS := strace
|
||||
STRACE_LIBRARIES :=
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := tcpdump
|
||||
TCPDUMP_VERSION := 4.99.4
|
||||
TCPDUMP_VERSION := 4.99.5
|
||||
TCPDUMP_URL := https://www.tcpdump.org/release/tcpdump-$(TCPDUMP_VERSION).tar.gz
|
||||
TCPDUMP_PROGRAMS := tcpdump
|
||||
TCPDUMP_LIBRARIES :=
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := wolfssl
|
||||
WOLFSSL_VERSION := 5.7.2
|
||||
WOLFSSL_VERSION := 5.7.6
|
||||
WOLFSSL_URL := https://github.com/wolfSSL/wolfssl/archive/refs/tags/v$(WOLFSSL_VERSION)-stable.tar.gz
|
||||
WOLFSSL_PROGRAMS :=
|
||||
WOLFSSL_LIBRARIES := libwolfssl.a
|
||||
@ -12,14 +12,14 @@ $(eval $(call create_recipes, \
|
||||
$(WOLFSSL_LIBRARIES), \
|
||||
))
|
||||
|
||||
$(BUILD_FLAG):
|
||||
$(BUILD_FLAG): $$(libz)
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
cd "$(SRC)" && sed -i 's@cut >/dev/null 2>&1 </dev/null@which cut >/dev/null 2>\&1 </dev/null@g' configure*
|
||||
cd "$(SRC)" && sed -i -e 's@cut >/dev/null 2>&1 </dev/null@which cut >/dev/null 2>\&1 </dev/null@g' configure*
|
||||
cd "$(SRC)" && autoreconf -i
|
||||
cd "$(SRC)" && ./configure \
|
||||
$(CONFIGURE_DEFAULTS) \
|
||||
--disable-shared --enable-static \
|
||||
--enable-opensslall --enable-opensslextra --enable-curl \
|
||||
--enable-opensslall --enable-oldnames --enable-opensslextra --enable-curl \
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
$(MAKE) -C "$(SRC)"
|
||||
|
@ -18,7 +18,7 @@ $(eval $(call create_recipes, \
|
||||
$(BUILD_FLAG):
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
cd "$(SRC)" && ./configure \
|
||||
--prefix="$(SYSROOT)" --static
|
||||
--prefix="$(SYSROOT)" --static -u=Linux
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
$(MAKE) -C "$(SRC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
|
||||
$(MAKE) -C "$(SRC)" install
|
||||
|
@ -1,5 +1,5 @@
|
||||
NAME := zstd
|
||||
ZSTD_VERSION := 1.5.6
|
||||
ZSTD_VERSION := 1.5.7
|
||||
ZSTD_URL := https://github.com/facebook/zstd/releases/download/v$(ZSTD_VERSION)/zstd-$(ZSTD_VERSION).tar.gz
|
||||
ZSTD_PROGRAMS := zstd
|
||||
ZSTD_LIBRARIES := libzstd.a
|
||||
@ -22,8 +22,8 @@ $(BUILD_FLAG): $$(libz)
|
||||
$(eval $(call activate_toolchain,$@))
|
||||
$(MAKE) -C "$(SRC)" clean
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
$(MAKE) -C "$(SRC)" UNAME="Linux"
|
||||
$(MAKE) -C "$(SRC)" install UNAME="Linux" PREFIX="$(SYSROOT)"
|
||||
$(MAKE) -C "$(SRC)"
|
||||
$(MAKE) -C "$(SRC)" install PREFIX="$(SYSROOT)"
|
||||
|
||||
ALL_PROGRAMS += $(ZSTD_PROGRAMS)
|
||||
DEFAULT_PROGRAMS += $(ZSTD_PROGRAMS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user