Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 16:07:44 +02:00
commit 6d0099d1a1
9195 changed files with 1607273 additions and 0 deletions

37
tools/7z/Makefile Normal file
View File

@@ -0,0 +1,37 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=7z
PKG_VERSION:=22.01
PKG_SOURCE_VERSION:=2201
PKG_SOURCE:=$(PKG_NAME)$(PKG_SOURCE_VERSION)-src.tar.xz
PKG_SOURCE_URL:=https://7-zip.org/a/
PKG_HASH:=393098730c70042392af808917e765945dc2437dee7aae3cfcc4966eb920fbc5
PKG_CPE_ID:=cpe:/a:7-zip:7zip
# This builds the 7zr variant which supports only 7z, so no non-LGPL code should be included
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=DOC/License.txt DOC/copying.txt
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/host-build.mk
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
ALONE_DIR=$(HOST_BUILD_DIR)/CPP/7zip/Bundles/Alone7z
define Host/Compile
$(MAKE) -C $(ALONE_DIR) -f makefile.gcc
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(INSTALL_BIN) $(ALONE_DIR)/_o/7zr $(STAGING_DIR_HOST)/bin/7zr
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/7zr
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,27 @@
--- a/CPP/7zip/7zip_gcc.mak
+++ b/CPP/7zip/7zip_gcc.mak
@@ -18,13 +18,13 @@ PROGPATH_STATIC = $(O)/$(PROG)s
ifneq ($(CC), xlc)
-CFLAGS_WARN_WALL = -Wall -Werror -Wextra
+CFLAGS_WARN_WALL = -Wall -Wextra
endif
# for object file
CFLAGS_BASE_LIST = -c
# CFLAGS_BASE_LIST = -S
-CFLAGS_BASE = -O2 $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
+CFLAGS_BASE = $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) -D_GNU_SOURCE \
-DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-fPIC
@@ -192,7 +192,7 @@ all: $(O) $(PROGPATH) $(STATIC_TARGET)
$(O):
$(MY_MKDIR) $(O)
-LFLAGS_ALL = -s $(MY_ARCH_2) $(LDFLAGS) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2)
+LFLAGS_ALL = $(MY_ARCH_2) $(LDFLAGS) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2)
$(PROGPATH): $(OBJS)
$(CXX) -o $(PROGPATH) $(LFLAGS_ALL)

View File

@@ -0,0 +1,59 @@
--- a/C/CpuArch.c
+++ b/C/CpuArch.c
@@ -421,8 +421,6 @@ BoolInt CPU_IsSupported_AES (void) { ret
#ifdef USE_HWCAP
-#include <asm/hwcap.h>
-
#define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; }
--- a/C/Threads.c
+++ b/C/Threads.c
@@ -257,7 +257,7 @@ WRes Thread_Create_With_CpuSet(CThread *
*/
// ret2 =
- pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet);
+ //pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet);
// if (ret2) ret = ret2;
#endif
}
@@ -267,14 +267,12 @@ WRes Thread_Create_With_CpuSet(CThread *
if (!ret)
{
p->_created = 1;
- /*
if (cpuSet)
{
// ret2 =
pthread_setaffinity_np(p->_tid, sizeof(*cpuSet), cpuSet);
// if (ret2) ret = ret2;
}
- */
}
}
// ret2 =
--- a/C/Threads.h
+++ b/C/Threads.h
@@ -19,6 +19,7 @@
#endif
#include <pthread.h>
+#include <sched.h>
#endif
--- a/CPP/Windows/SystemInfo.cpp
+++ b/CPP/Windows/SystemInfo.cpp
@@ -36,9 +36,6 @@
#endif
*/
-#ifdef MY_CPU_ARM_OR_ARM64
-#include <asm/hwcap.h>
-#endif
#endif
#ifdef __linux__

225
tools/Makefile Normal file
View File

@@ -0,0 +1,225 @@
#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Main makefile for the host tools
#
curdir:=tools
# subdirectories to descend into
tools-y :=
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
BUILD_TOOLCHAIN := y
ifdef CONFIG_GCC_USE_GRAPHITE
BUILD_ISL = y
endif
endif
ifneq ($(CONFIG_SDK)$(CONFIG_PACKAGE_kmod-b43)$(CONFIG_BRCMSMAC_USE_FW_FROM_WL),)
BUILD_B43_TOOLS = y
endif
ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),)
BUILD_BZIP2_TOOLS = y
endif
ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
BUILD_LZ4_TOOLS = y
endif
ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
BUILD_LZO_TOOLS = y
endif
tools-y += autoconf
tools-y += autoconf-archive
tools-y += automake
tools-y += bc
tools-y += bison
tools-y += cmake
tools-y += cpio
tools-y += dosfstools
tools-y += e2fsprogs
tools-y += expat
tools-y += fakeroot
tools-y += findutils
tools-y += firmware-utils
tools-y += flex
tools-y += gengetopt
tools-y += gnulib
tools-y += libressl
tools-y += libtool
tools-y += lzma
tools-y += m4
tools-y += make-ext4fs
tools-y += meson
tools-y += missing-macros
tools-y += mkimage
tools-y += mklibs
tools-y += mtd-utils
tools-y += mtools
tools-y += ninja
tools-y += padjffs2
tools-y += patch-image
tools-y += patchelf
tools-y += pkgconf
tools-y += quilt
tools-y += squashfs4
tools-y += sstrip
tools-y += zip
tools-y += zlib
tools-y += zstd
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS),y) += liblzo
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_B43_TOOLS),y) += b43-tools
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_BZIP2_TOOLS),y) += bzip2
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_ISL),y) += isl
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZ4_TOOLS),y) += lz4
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZO_TOOLS),y) += lzop
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_TOOLCHAIN),y) += gmp mpc mpfr
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini),y) += genext2fs
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs3-lzma
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_mxs),y) += elftosb sdimage
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_realtek),y) += 7z
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_tegra),y) += cbootimage cbootimage-configs
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += kernel2minor
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_SPARSE),y) += sparse
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_LLVM_BUILD),y) += llvm-bpf
# builddir dependencies
$(curdir)/autoconf/compile := $(curdir)/m4/compile
$(curdir)/automake/compile := $(curdir)/autoconf/compile $(curdir)/pkgconf/compile $(curdir)/xz/compile
$(curdir)/b43-tools/compile := $(curdir)/bison/compile
$(curdir)/bc/compile := $(curdir)/bison/compile $(curdir)/libtool/compile
$(curdir)/bison/compile := $(curdir)/flex/compile
$(curdir)/bzip2/compile := $(curdir)/cmake/compile
$(curdir)/cbootimage/compile += $(curdir)/automake/compile
$(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile $(curdir)/expat/compile $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zstd/compile
$(curdir)/dosfstools/compile := $(curdir)/automake/compile
$(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile
$(curdir)/fakeroot/compile := $(curdir)/libtool/compile
$(curdir)/findutils/compile := $(curdir)/bison/compile
$(curdir)/firmware-utils/compile += $(curdir)/cmake/compile
$(curdir)/flex/compile := $(curdir)/libtool/compile
$(curdir)/genext2fs/compile := $(curdir)/libtool/compile
$(curdir)/gengetopt/compile := $(curdir)/libtool/compile
$(curdir)/gmp/compile := $(curdir)/libtool/compile
$(curdir)/isl/compile := $(curdir)/gmp/compile
$(curdir)/liblzo/compile := $(curdir)/cmake/compile
$(curdir)/libressl/compile := $(curdir)/pkgconf/compile
$(curdir)/libtool/compile := $(curdir)/automake/compile $(curdir)/gnulib/compile $(curdir)/missing-macros/compile
$(curdir)/lz4/compile := $(curdir)/meson/compile
$(curdir)/lzma-old/compile := $(curdir)/zlib/compile
$(curdir)/lzop/compile := $(curdir)/cmake/compile $(curdir)/liblzo/compile
$(curdir)/llvm-bpf/compile := $(curdir)/cmake/compile
$(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
$(curdir)/meson/compile := $(curdir)/ninja/compile
$(curdir)/missing-macros/compile := $(curdir)/autoconf/compile
$(curdir)/mkimage/compile += $(curdir)/bison/compile $(curdir)/libressl/compile
$(curdir)/mklibs/compile := $(curdir)/libtool/compile
$(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile
$(curdir)/mpfr/compile := $(curdir)/gmp/compile
$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile
$(curdir)/padjffs2/compile := $(curdir)/findutils/compile
$(curdir)/patchelf/compile := $(curdir)/libtool/compile
$(curdir)/pkgconf/compile := $(curdir)/meson/compile
$(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
$(curdir)/sdcc/compile := $(curdir)/bison/compile
$(curdir)/squashfs3-lzma/compile := $(curdir)/lzma-old/compile
$(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
$(curdir)/zstd/compile := $(curdir)/meson/compile
ifneq ($(HOST_OS),Linux)
$(curdir)/coreutils/compile += $(curdir)/automake/compile $(curdir)/bison/compile $(curdir)/gnulib/compile
$(curdir)/squashfs4/compile += $(curdir)/coreutils/compile
tools-y += coreutils
endif
ifeq ($(HOST_OS),Darwin)
tools-y += bash
else
$(curdir)/dwarves/compile += $(curdir)/elfutils/compile
$(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_DWARVES),y) += dwarves
tools-y += elfutils
endif
ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
$(foreach tool, $(filter-out zstd zlib xz pkgconf patch ninja meson libressl expat cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile))
tools-y += ccache
$(curdir)/ccache/compile := $(curdir)/cmake/compile
endif
# in case there is no patch tool on the host we need to make patch tool a
# dependency for tools which have patches directory
$(foreach tool, $(tools-y), $(if $(wildcard $(curdir)/$(tool)/patches),$(eval $(curdir)/$(tool)/compile += $(curdir)/patch/compile)))
$(foreach tool, $(filter-out xz,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/xz/compile))
# make any tool depend on the following to ensure that archives can be unpacked and patched properly
tools-core += libdeflate
tools-core += patch
tools-core += tar
tools-core += xz
$(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(patsubst %,$(curdir)/%/compile,$(tools-core))))
tools-y += $(tools-core)
# make core tools depend on sed and flock
$(foreach tool, $(filter-out xz,$(tools-core)), $(eval $(curdir)/$(tool)/compile += $(curdir)/sed/compile))
$(curdir)/xz/compile += $(curdir)/flock/compile
$(curdir)/sed/compile := $(curdir)/flock/compile $(curdir)/xz/compile
tools-y += flock sed
$(curdir)/autoremove := 1
$(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
$(curdir)/builddirs-default := $(tools-y)
ifdef CHECK_ALL
$(curdir)/builddirs-check:=$($(curdir)/builddirs)
$(curdir)/builddirs-download:=$($(curdir)/builddirs)
endif
ifndef DUMP_TARGET_DB
define PrepareStaging
@for dir in $(1); do ( \
$(if $(QUIET),,set -x;) \
mkdir -p "$$dir"; \
cd "$$dir"; \
mkdir -p bin lib stamp usr/include usr/lib; \
); done
endef
$(BIN_DIR):
mkdir -p $@
# preparatory work
$(STAGING_DIR)/.prepared: $(TMP_DIR)/.build
$(call PrepareStaging,$(STAGING_DIR))
mkdir -p $(BUILD_DIR)/stamp
touch $@
$(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
$(call PrepareStaging,$(STAGING_DIR_HOST))
mkdir -p $(BUILD_DIR_HOST)/stamp $(STAGING_DIR_HOST)/include/sys
$(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/
$(INSTALL_DATA) $(TOPDIR)/tools/include/sys/*.h $(STAGING_DIR_HOST)/include/sys/
ifneq ($(HOST_OS),Linux)
mkdir -p $(STAGING_DIR_HOST)/include/asm
$(INSTALL_DATA) $(TOPDIR)/tools/include/asm/*.h $(STAGING_DIR_HOST)/include/asm/
endif
ln -snf lib $(STAGING_DIR_HOST)/lib64
touch $@
endif
$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $(BIN_DIR)
$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $(BIN_DIR)
# prerequisites for the individual targets
$(curdir)/ := .config prereq
$(curdir)/install: $(curdir)/compile
tools_enabled = $(foreach tool,$(sort $(tools-y) $(tools-)),$(if $(filter $(tool),$(tools-y)),y,n))
$(eval $(call stampfile,$(curdir),tools,compile,,_$(subst $(space),,$(tools_enabled)),$(STAGING_DIR_HOST)))
$(eval $(call stampfile,$(curdir),tools,check,$(TMP_DIR)/.build,,$(STAGING_DIR_HOST)))
$(eval $(call subdir,$(curdir)))

View File

@@ -0,0 +1,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf-archive
PKG_VERSION:=2023.02.20
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/autoconf-archive
PKG_HASH:=71d4048479ae28f1f5794619c3d72df9c01df49b1c628ef85fde37596dc31a33
include $(INCLUDE_DIR)/host-build.mk
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

31
tools/autoconf/Makefile Normal file
View File

@@ -0,0 +1,31 @@
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf
PKG_VERSION:=2.71
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/autoconf
PKG_HASH:=f14c83cfebcc9427f2c3cea7258bd90df972d92eb26752da4ddad81c87a0faa4
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_VARS += \
EMACS="no" \
PERL="/usr/bin/env perl"
define Host/Compile
-$(call Host/Compile/Default,--touch install-man1) # disable building of man pages
$(call Host/Compile/Default)
endef
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,195 @@
--- a/bin/autoheader.in
+++ b/bin/autoheader.in
@@ -30,9 +30,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
unshift @INC, "$pkgdatadir";
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -54,7 +57,7 @@ use Autom4te::XFile;
our ($config_h, %symbol, %verbatim);
# Lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
my $config_h_in;
my @prepend_include;
my @include;
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -26,9 +26,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -48,7 +51,8 @@ use Autom4te::General;
use Autom4te::XFile;
# Data directory.
-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
+my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
# $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
my %language;
@@ -91,7 +95,7 @@ my @include;
my $freeze = 0;
# $M4.
-my $m4 = $ENV{"M4"} || '@M4@';
+my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@');
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
fatal "need GNU m4 1.4 or later: $m4"
if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
@@ -272,6 +276,12 @@ sub load_configuration ($)
my @words = shellwords ($_);
my $type = shift @words;
+
+ if ($ENV{'STAGING_DIR_HOST'})
+ {
+ @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR_HOST'}/share/autoconf!; $_ } @words;
+ }
+
if ($type eq 'begin-language:')
{
fatal "$file:$.: end-language missing for: $lang"
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -29,10 +29,13 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
my $buildauxdir;
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
$buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux';
@@ -117,9 +120,9 @@ Written by David J. MacKenzie and Akim D
";
# Lib files.
-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
+my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
my $automake = $ENV{'AUTOMAKE'} || 'automake';
my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
--- a/bin/autoscan.in
+++ b/bin/autoscan.in
@@ -28,9 +28,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -95,10 +98,10 @@ my %needed_macros =
my $log;
# Autoconf and lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
my $autoconf = "$autom4te --language=autoconf";
my @prepend_include;
-my @include = ('@pkgdatadir@');
+my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
# $help
# -----
--- a/bin/autoupdate.in
+++ b/bin/autoupdate.in
@@ -29,9 +29,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -55,10 +58,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
my $autoconf = "$autom4te --language=autoconf";
# We need to find m4sugar.
my @prepend_include;
-my @include = ('@pkgdatadir@');
+my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
my $force = 0;
# m4.
-my $m4 = $ENV{"M4"} || '@M4@';
+my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@');
# $HELP
--- a/bin/ifnames.in
+++ b/bin/ifnames.in
@@ -33,9 +33,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
--- a/bin/autoconf.as
+++ b/bin/autoconf.as
@@ -89,8 +89,13 @@ exit_missing_arg='
# restore font-lock: '
# Variables.
-: ${AUTOM4TE='@bindir@/@autom4te-name@'}
-: ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
+if test -n "$STAGING_DIR_HOST"; then
+ : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"}
+ : ${trailer_m4="$STAGING_DIR_HOST/share/autoconf/autoconf/trailer.m4"}
+else
+ : ${AUTOM4TE='@bindir@/@autom4te-name@'}
+ : ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
+fi
autom4te_options=
outfile=
verbose=false

53
tools/automake/Makefile Normal file
View File

@@ -0,0 +1,53 @@
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=automake
PKG_CPE_ID:=cpe:/a:gnu:automake
PKG_VERSION:=1.16.5
PKG_API_VERSION:=$(word 2,$(subst ., ,$(PKG_VERSION)))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/automake
PKG_HASH:=f01d58cd6d9d77fbdca9eb4bbd5ead1988228fdb73d6f7a201f5f8d6b118b469
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
--disable-silent-rules
HOST_CONFIGURE_VARS += \
PERL="/usr/bin/env perl" \
am_cv_prog_PERL_ithreads=no
define Host/Configure
(cd $(HOST_BUILD_DIR); $(AM_TOOL_PATHS) STAGING_DIR_HOST="" ./bootstrap)
$(call Host/Configure/Default)
endef
define Host/Install
# remove old automake resources to avoid version conflicts
$(call Host/Uninstall)
$(call Host/Compile/Default,install)
mv $(STAGING_DIR_HOST)/bin/aclocal $(STAGING_DIR_HOST)/bin/aclocal.real
$(INSTALL_BIN) ./files/aclocal $(STAGING_DIR_HOST)/bin
( \
api=$(PKG_API_VERSION); \
while [ "$$$$api" -ge 11 ]; do \
ln -sf aclocal "$(STAGING_DIR_HOST)/bin/aclocal-1.$$$$api"; \
api=$$$$(($$$$api - 1)); \
done; \
)
endef
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
rm -rf $(STAGING_DIR_HOST)/share/aclocal-[0-9]*
rm -rf $(STAGING_DIR_HOST)/share/automake-[0-9]*
endef
$(eval $(call HostBuild))

2
tools/automake/files/aclocal Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env sh
${STAGING_DIR_HOST}/bin/aclocal.real $ACLOCAL_INCLUDE $@

View File

@@ -0,0 +1,52 @@
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -34,7 +34,7 @@ our $PACKAGE = '@PACKAGE@';
our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
our $VERSION = '@VERSION@';
our $RELEASE_YEAR = '@RELEASE_YEAR@';
-our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@';
+our $libdir = $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@';
our $perl_threads = 0;
# We need at least this version for CLONE support.
--- a/bin/aclocal.in
+++ b/bin/aclocal.in
@@ -23,9 +23,11 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@')
+ unshift (@INC, ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@'))
unless $ENV{AUTOMAKE_UNINSTALLED};
}
@@ -65,8 +67,8 @@ $perl_threads = 0;
# ACLOCAL_PATH environment variable, and reset with the '--system-acdir'
# option.
my @user_includes = ();
-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION);
-my @system_includes = ('@datadir@/aclocal');
+my @automake_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . "/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
+my @system_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/aclocal' : '@datadir@/aclocal');
# Whether we should copy M4 file in $user_includes[0].
my $install = 0;
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -26,9 +26,11 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
+$^W = 1;
+
BEGIN
{
- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@')
+ unshift (@INC, ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@'))
unless $ENV{AUTOMAKE_UNINSTALLED};
# Override SHELL. This is required on DJGPP so that system() uses

View File

@@ -0,0 +1,15 @@
--- a/bin/aclocal.in
+++ b/bin/aclocal.in
@@ -371,6 +371,12 @@ sub scan_m4_dirs ($$@)
foreach my $m4dir (@dirlist)
{
+ if (! -d $m4dir)
+ {
+ msg ('override', "warning: skipping not existing directory `$m4dir'");
+ next;
+ }
+
if (! opendir (DIR, $m4dir))
{
# TODO: maybe avoid complaining only if errno == ENONENT?

View File

@@ -0,0 +1,29 @@
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -4513,7 +4513,7 @@ sub handle_gettext ()
&& grep ($_ eq 'intl', @subdirs));
}
- require_file ($ac_gettext_location, GNU, 'ABOUT-NLS');
+ require_file ($ac_gettext_location, GNITS, 'ABOUT-NLS');
}
# Emit makefile footer.
@@ -5641,7 +5641,7 @@ sub check_gnu_standards ()
# otherwise require non-.md.
my $required
= (! -f $file && -f "$file.md") ? "$file.md" : $file;
- require_file ("$am_file.am", GNU, $required);
+ require_file ("$am_file.am", GNITS, $required);
}
# Accept one of these three licenses; default to COPYING.
@@ -5655,7 +5655,7 @@ sub check_gnu_standards ()
last;
}
}
- require_file ("$am_file.am", GNU, 'COPYING')
+ require_file ("$am_file.am", GNITS, 'COPYING')
unless $license;
}

View File

@@ -0,0 +1,59 @@
From: Bogdan Drozdowski <bogdandr AT op.pl>
Date: Sat, 31 Dec 2022 20:17:35 +0100
Subject: [PATCH] Allow other V values for verbosity
---
m4/silent.m4 | 2 +-
t/silent-gen.sh | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
--- a/m4/silent.m4
+++ b/m4/silent.m4
@@ -43,7 +43,7 @@ else
fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
- AM_V='$(V)'
+ AM_V='$(shell if ( test "x$(V)" = "x0" ); then echo 0; elif ( test "x$(V)" = "x" ); then echo $(AM_DEFAULT_VERBOSITY); else echo 1; fi)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
--- a/t/silent-gen.sh
+++ b/t/silent-gen.sh
@@ -54,6 +54,18 @@ grep 'cp ' stdout
grep 'echo ' stdout
$MAKE clean
+run_make -O V=99
+grep 'GEN ' stdout && exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+$MAKE clean
+run_make -O V=vvv
+grep 'GEN ' stdout && exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+$MAKE clean
run_make -O V=0
grep 'GEN .*foo' stdout
grep 'cp ' stdout && exit 1
@@ -78,5 +90,17 @@ run_make -O V=1
grep 'GEN ' stdout && exit 1
grep 'cp ' stdout
grep 'echo ' stdout
+
+$MAKE clean
+run_make -O V=99
+grep 'GEN ' stdout && exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+$MAKE clean
+run_make -O V=v
+grep 'GEN ' stdout && exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
:

47
tools/b43-tools/Makefile Normal file
View File

@@ -0,0 +1,47 @@
#
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=b43-tools
PKG_DATE:=2025-05-04
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/mbuesch/b43-tools.git
PKG_SOURCE_VERSION:=cc352349153eeda9c164ecd0d06c161a59ec8753
PKG_MIRROR_HASH:=fcacb8a07ea425b2824a2d810b5a1e70b1b0bf16adcc62d1cdf96ffa75465dcf
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/fwcutter \
CFLAGS="$(HOST_CFLAGS) -include endian.h" \
$(HOST_MAKE_FLAGS) \
$(1) QUIET_SPARSE=:
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/assembler \
CFLAGS="$(HOST_CFLAGS) -include endian.h -Wno-error=int-conversion" \
$(HOST_MAKE_FLAGS) \
LDFLAGS= \
$(1) QUIET_SPARSE=:
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/fwcutter/b43-fwcutter $(STAGING_DIR_HOST)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm $(STAGING_DIR_HOST)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm.bin $(STAGING_DIR_HOST)/bin/
$(INSTALL_BIN) ./files/b43-fwsquash.py $(STAGING_DIR_HOST)/bin/
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/b43-fwcutter
rm -f $(STAGING_DIR_HOST)/bin/b43-asm
rm -f $(STAGING_DIR_HOST)/bin/b43-asm.bin
rm -f $(STAGING_DIR_HOST)/bin/b43-fwsquash.py
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,149 @@
#!/usr/bin/env python3
#
# b43 firmware file squasher
# Removes unnecessary firmware files
#
# Copyright (c) 2009 Michael Buesch <mb@bu3sch.de>
#
# Licensed under the GNU/GPL version 2 or (at your option) any later version.
#
import sys
import os
def usage():
print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firmware" % sys.argv[0])
print("")
print("PHYTYPES is a comma separated list of:")
print("A => A-PHY")
print("AG => Dual A-PHY G-PHY")
print("G => G-PHY")
print("LP => LP-PHY")
print("N => N-PHY")
print("HT => HT-PHY")
print("LCN => LCN-PHY")
print("LCN40 => LCN40-PHY")
print("AC => AC-PHY")
print("")
print("COREREVS is a comma separated list of core revision numbers.")
if len(sys.argv) != 4:
usage()
sys.exit(1)
phytypes = sys.argv[1]
corerevs = sys.argv[2]
fwpath = sys.argv[3]
phytypes = phytypes.split(',')
try:
corerevs = [int(r) for r in corerevs.split(',')]
except ValueError:
print("ERROR: \"%s\" is not a valid COREREVS string\n" % corerevs)
usage()
sys.exit(1)
fwfiles = os.listdir(fwpath)
fwfiles = [str for str in fwfiles if str.endswith(".fw")]
if not fwfiles:
print("ERROR: No firmware files found in %s" % fwpath)
sys.exit(1)
required_fwfiles = []
def revs_match(revs_a, revs_b):
for rev in revs_a:
if rev in revs_b:
return True
return False
def phytypes_match(types_a, types_b):
for type in types_a:
type = type.strip().upper()
if type in types_b:
return True
return False
revmapping = {
"ucode2.fw" : ( (2,3,), ("G",), ),
"ucode4.fw" : ( (4,), ("G",), ),
"ucode5.fw" : ( (5,6,7,8,9,10,), ("G","A","AG",), ),
"ucode11.fw" : ( (11,12,), ("N",), ),
"ucode13.fw" : ( (13,), ("LP","G",), ),
"ucode14.fw" : ( (14,), ("LP",), ),
"ucode15.fw" : ( (15,), ("LP",), ),
"ucode16_mimo.fw" : ( (16,17,18,19,23,), ("N",), ),
# "ucode16_lp.fw" : ( (16,17,18,19,), ("LP",), ),
"ucode24_lcn.fw" : ( (24,), ("LCN",), ),
"ucode25_mimo.fw" : ( (25,28,), ("N",), ),
"ucode25_lcn.fw" : ( (25,28,), ("LCN",), ),
"ucode26_mimo.fw" : ( (26,), ("HT",), ),
"ucode29_mimo.fw" : ( (29,), ("HT",), ),
"ucode30_mimo.fw" : ( (30,), ("N",), ),
"ucode33_lcn40.fw" : ( (33,), ("LCN40",), ),
"ucode40.fw" : ( (40,), ("AC",), ),
"ucode42.fw" : ( (42,), ("AC",), ),
"pcm4.fw" : ( (1,2,3,4,), ("G",), ),
"pcm5.fw" : ( (5,6,7,8,9,10,), ("G","A","AG",), ),
}
initvalmapping = {
"a0g1initvals5.fw" : ( (5,6,7,8,9,10,), ("AG",), ),
"a0g0initvals5.fw" : ( (5,6,7,8,9,10,), ("A", "AG",), ),
"b0g0initvals2.fw" : ( (2,4,), ("G",), ),
"b0g0initvals5.fw" : ( (5,6,7,8,9,10,), ("G",), ),
"b0g0initvals13.fw" : ( (13,), ("G",), ),
"n0initvals11.fw" : ( (11,12,), ("N",), ),
"n0initvals16.fw" : ( (16,17,18,23,), ("N",), ),
"n0initvals24.fw" : ( (24,), ("N",), ),
"n0initvals25.fw" : ( (25,28,), ("N",), ),
"n16initvals30.fw" : ( (30,), ("N",), ),
"lp0initvals13.fw" : ( (13,), ("LP",), ),
"lp0initvals14.fw" : ( (14,), ("LP",), ),
"lp0initvals15.fw" : ( (15,), ("LP",), ),
# "lp0initvals16.fw" : ( (16,17,18,), ("LP",), ),
"lcn0initvals24.fw" : ( (24,), ("LCN",), ),
"ht0initvals26.fw" : ( (26,), ("HT",), ),
"ht0initvals29.fw" : ( (29,), ("HT",), ),
"lcn400initvals33.fw" : ( (33,), ("LCN40",), ),
"ac0initvals40.fw" : ( (40,), ("AC",), ),
"ac1initvals42.fw" : ( (42,), ("AC",), ),
"a0g1bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("AG",), ),
"a0g0bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("A", "AG"), ),
"b0g0bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("G",), ),
"n0bsinitvals11.fw" : ( (11,12,), ("N",), ),
"n0bsinitvals16.fw" : ( (16,17,18,23,), ("N",), ),
"n0bsinitvals24.fw" : ( (24,), ("N",), ),
"n0bsinitvals25.fw" : ( (25,28,), ("N",), ),
"n16bsinitvals30.fw" : ( (30,), ("N",), ),
"lp0bsinitvals13.fw" : ( (13,), ("LP",), ),
"lp0bsinitvals14.fw" : ( (14,), ("LP",), ),
"lp0bsinitvals15.fw" : ( (15,), ("LP",), ),
# "lp0bsinitvals16.fw" : ( (16,17,18,), ("LP",), ),
"lcn0bsinitvals24.fw" : ( (24,), ("LCN",), ),
"ht0bsinitvals26.fw" : ( (26,), ("HT",), ),
"ht0bsinitvals29.fw" : ( (29,), ("HT",), ),
"lcn400bsinitvals33.fw" : ( (33,), ("LCN40",), ),
"ac0bsinitvals40.fw" : ( (40,), ("AC",), ),
"ac1bsinitvals42.fw" : ( (42,), ("AC",), ),
}
for f in fwfiles:
if f in revmapping:
if revs_match(corerevs, revmapping[f][0]) and\
phytypes_match(phytypes, revmapping[f][1]):
required_fwfiles += [f]
continue
if f in initvalmapping:
if revs_match(corerevs, initvalmapping[f][0]) and\
phytypes_match(phytypes, initvalmapping[f][1]):
required_fwfiles += [f]
continue
print("WARNING: Firmware file %s not found in the mapping lists" % f)
for f in fwfiles:
if f not in required_fwfiles:
print("Deleting %s" % f)
os.unlink(fwpath + '/' + f)

View File

@@ -0,0 +1,16 @@
--- a/fwcutter/fwcutter.c
+++ b/fwcutter/fwcutter.c
@@ -50,13 +50,8 @@
#include "fwcutter.h"
#include "fwcutter_list.h"
-#if defined(__DragonFly__) || defined(__FreeBSD__)
-#define V3_FW_DIRNAME "v3"
-#define V4_FW_DIRNAME "v4"
-#else
#define V3_FW_DIRNAME "b43legacy"
#define V4_FW_DIRNAME "b43"
-#endif
static struct cmdline_args cmdargs;

View File

@@ -0,0 +1,14 @@
--- a/assembler/main.c
+++ b/assembler/main.c
@@ -1268,6 +1268,11 @@ static void initialize(void)
#endif /* YYDEBUG */
}
+int yywrap(void)
+{
+ return 1;
+}
+
int main(int argc, char **argv)
{
int err, res = 1;

25
tools/bash/Makefile Normal file
View File

@@ -0,0 +1,25 @@
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bash
PKG_CPE_ID:=cpe:/a:gnu:bash
PKG_VERSION:=5.2.15
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/bash
PKG_HASH:=13720965b5f4fc3a0d4b61dd37e7565c741da9a5be24edc2ae00182fc1b3588c
HOST_BUILD_PARALLEL := 1
include $(INCLUDE_DIR)/host-build.mk
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

25
tools/bc/Makefile Normal file
View File

@@ -0,0 +1,25 @@
#
# Copyright (C) 2013-2022 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bc
PKG_VERSION:=1.07.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/bc
PKG_HASH:=62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a
PKG_FIXUP := autoreconf
PKG_CPE_ID:=cpe:/a:gnu:bc
include $(INCLUDE_DIR)/host-build.mk
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,21 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = lib bc dc doc
+SUBDIRS = lib bc dc
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
stamp-h $(distdir).tar.gz h/number.h depcomp missing \
--- a/Makefile.in
+++ b/Makefile.in
@@ -288,7 +288,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = lib bc dc doc
+SUBDIRS = lib bc dc
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
stamp-h $(distdir).tar.gz h/number.h depcomp missing \
bc/libmath.h

View File

@@ -0,0 +1,32 @@
--- a/bc/fix-libmath_h
+++ b/bc/fix-libmath_h
@@ -1,9 +1,9 @@
-ed libmath.h <<EOS-EOS
-1,1s/^/{"/
-1,\$s/\$/",/
-2,\$s/^/"/
-\$,\$d
-\$,\$s/,\$/,0}/
-w
-q
-EOS-EOS
+#!/usr/bin/env bash
+sed -e '1 s/^/{"/' \
+ -e 's/$/",/' \
+ -e '2,$ s/^/"/' \
+ -e '$ d' \
+ -i libmath.h
+
+sed -e '$ s/$/0}/' \
+ -i libmath.h
--- a/configure
+++ b/configure
@@ -5288,7 +5288,7 @@ case $bcle-$bcrl-$LEX in
?-?-flex)
LEX="flex -I -8" ;;
?-y-*)
- as_fn_error $? "readline works only with flex." "$LINENO" 5 ;;
+ : ;; # as_fn_error $? "readline works only with flex." "$LINENO" 5 ;;
esac
case $LEX-`uname -s` in

33
tools/bison/Makefile Normal file
View File

@@ -0,0 +1,33 @@
#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bison
PKG_VERSION:=3.8.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5bf2
PKG_CPE_ID:=cpe:/a:gnu:bison
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += --enable-threads=posix --disable-nls
define Host/Install
$(call Host/Install/Default)
$(INSTALL_BIN) ./scripts/yacc $(STAGING_DIR_HOST)/bin/yacc
endef
define Host/Uninstall
rm -f $(STAGING_DIR_HOST)/bin/yacc
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

2
tools/bison/scripts/yacc Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec bison -y "$@"

52
tools/bzip2/Makefile Normal file
View File

@@ -0,0 +1,52 @@
#
# Copyright (C) 2022 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bzip2
PKG_VERSION:=1.0.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://sourceware.org/pub/bzip2
PKG_HASH:=ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
PKG_LICENSE:=bzip2-1.0.8
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:bzip:bzip2
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOSTCC := $(HOSTCC_NOCACHE)
HOST_CFLAGS += $(HOST_FPIC)
HOST_MAKE_FLAGS+= \
CFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
ENABLE_BIN_SHARED=0 \
ENABLE_BIN_STATIC=1 \
ENABLE_LIB_SHARED=0 \
ENABLE_LIB_STATIC=1 \
ENABLE_DEV=1 \
ENABLE_DOCS=1 \
ENABLE_TESTS=0 \
PREFIX="$(HOST_BUILD_PREFIX)"
define Host/Configure
endef
define Host/Uninstall
$(call Host/Compile/Default,uninstall)
$(call Host/Compile/Default,clean)
endef
define Host/Clean
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,27 @@
--- a/bzip2.c
+++ b/bzip2.c
@@ -69,7 +69,6 @@
#if BZ_UNIX
# include <fcntl.h>
# include <sys/types.h>
-# include <utime.h>
# include <unistd.h>
# include <sys/stat.h>
# include <sys/times.h>
@@ -1051,12 +1050,12 @@ void applySavedTimeInfoToOutputFile ( Ch
{
# if BZ_UNIX
IntNative retVal;
- struct utimbuf uTimBuf;
+ struct timespec uTimBuf[2] = {};
- uTimBuf.actime = fileMetaInfo.st_atime;
- uTimBuf.modtime = fileMetaInfo.st_mtime;
+ uTimBuf[0].tv_sec = fileMetaInfo.st_atime;
+ uTimBuf[1].tv_sec = fileMetaInfo.st_mtime;
- retVal = utime ( dstName, &uTimBuf );
+ retVal = utimensat ( AT_FDCWD, dstName, uTimBuf , 0 );
ERROR_IF_NOT_ZERO ( retVal );
# endif
}

View File

@@ -0,0 +1,401 @@
--- a/bzip2.c
+++ b/bzip2.c
@@ -54,7 +54,7 @@
#include <math.h>
#include <errno.h>
#include <ctype.h>
-#include "bzlib.h"
+#include <bzlib.h>
#define ERROR_IF_EOF(i) { if ((i) == EOF) ioError(); }
#define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); }
--- a/bzlib_private.h
+++ b/bzlib_private.h
@@ -30,7 +30,7 @@
#include <string.h>
#endif
-#include "bzlib.h"
+#include <bzlib.h>
--- a/Makefile
+++ b/Makefile
@@ -21,11 +21,38 @@ RANLIB=ranlib
LDFLAGS=
BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
+CFLAGS_COMMON=-Wall -Winline -O2 -g $(BIGFILES) -I.
+CFLAGS_NOPIC=$(filter-out -O%,$(CFLAGS)) $(CFLAGS_COMMON)
+CFLAGS_PIC=$(filter-out -O%,$(CFLAGS)) -fpic -fPIC $(CFLAGS_COMMON)
# Where you want it installed when you do 'make install'
-PREFIX=/usr/local
-
+PREFIX?=/usr/local
+ENABLE_BIN_STATIC?=1
+ENABLE_BIN_SHARED?=1
+ENABLE_LIB_STATIC?=1
+ENABLE_LIB_SHARED?=1
+ENABLE_DEV?=1
+ENABLE_DOCS?=1
+ENABLE_TESTS?=1
+
+ifeq ($(ENABLE_BIN_STATIC),1)
+ ENABLE_BIN=1
+ ifneq ($(ENABLE_LIB_STATIC),1)
+ ENABLE_LIB_STATIC=1
+ endif
+endif
+ifeq ($(ENABLE_BIN_SHARED),1)
+ ENABLE_BIN=1
+ ifneq ($(ENABLE_LIB_SHARED),1)
+ ENABLE_LIB_STATIC=1
+ endif
+endif
+ifeq ($(ENABLE_LIB_STATIC),1)
+ ENABLE_LIB=1
+endif
+ifeq ($(ENABLE_LIB_SHARED),1)
+ ENABLE_LIB=1
+endif
OBJS= blocksort.o \
huffman.o \
@@ -35,15 +62,38 @@ OBJS= blocksort.o \
decompress.o \
bzlib.o
-all: libbz2.a bzip2 bzip2recover test
-
-bzip2: libbz2.a bzip2.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+TGTS_all:=
+TGTS_bzip2:=bzip2.o
+TGTS_check:=
+TGTS_install:=
+ifeq ($(ENABLE_LIB),1)
+ TGTS_all+=libbz2
+ TGTS_bzip2+=libbz2
+endif
+ifeq ($(ENABLE_BIN),1)
+ TGTS_all+=bzip2 bzip2recover
+ TGTS_install+=bzip2 bzip2recover
+endif
+ifeq ($(ENABLE_TESTS),1)
+ TGTS_all+=test
+ TGTS_check+=test
+endif
+
+all: $(TGTS_all)
+
+bzip2: $(TGTS_bzip2)
+ifeq ($(ENABLE_BIN_STATIC),1)
+ $(CC) $(CFLAGS_NOPIC) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+endif
+ifeq ($(ENABLE_BIN_SHARED),1)
+ $(CC) $(CFLAGS_PIC) -o bzip2-shared bzip2.o libbz2.so.1.0
+endif
bzip2recover: bzip2recover.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
+ $(CC) $(CFLAGS_NOPIC) $(LDFLAGS) -o bzip2recover bzip2recover.o
-libbz2.a: $(OBJS)
+libbz2: $(OBJS)
+ifeq ($(ENABLE_LIB_STATIC),1)
rm -f libbz2.a
$(AR) cq libbz2.a $(OBJS)
@if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
@@ -51,8 +101,18 @@ libbz2.a: $(OBJS)
echo $(RANLIB) libbz2.a ; \
$(RANLIB) libbz2.a ; \
fi
+endif
+ifeq ($(ENABLE_LIB_SHARED),1)
+ $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 $(LDFLAGS) -o libbz2.so.1.0.8 $(OBJS)
+ rm -f libbz2.so.1.0
+ rm -f libbz2.so.1
+ rm -f libbz2.so
+ ln -s libbz2.so.1.0.8 libbz2.so.1.0
+ ln -s libbz2.so.1.0 libbz2.so.1
+ ln -s libbz2.so.1 libbz2.so
+endif
-check: test
+check: $(TGTS_check)
test: bzip2
@cat words1
./bzip2 -1 < sample1.ref > sample1.rb2
@@ -69,69 +129,153 @@ test: bzip2
cmp sample3.tst sample3.ref
@cat words3
-install: bzip2 bzip2recover
+install: $(TGTS_install)
+ifeq ($(ENABLE_BIN),1)
if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
+endif
+ifeq ($(ENABLE_LIB),1)
if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
+endif
+ifeq ($(ENABLE_DEV),1)
+ if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
+endif
+ifeq ($(ENABLE_DOCS),1)
if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
- if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
+endif
+ifeq ($(ENABLE_BIN),1)
+ ifeq ($(ENABLE_BIN_STATIC),1)
cp -f bzip2 $(PREFIX)/bin/bzip2
- cp -f bzip2 $(PREFIX)/bin/bunzip2
- cp -f bzip2 $(PREFIX)/bin/bzcat
+ chmod a+rx $(PREFIX)/bin/bzip2
+ endif
+ ifeq ($(ENABLE_BIN_SHARED),1)
+ ifeq ($(ENABLE_BIN_STATIC),1)
+ cp -f bzip2-shared $(PREFIX)/bin/bzip2-shared
+ chmod a+rx $(PREFIX)/bin/bzip2-shared
+ else
+ cp -f bzip2-shared $(PREFIX)/bin/bzip2
+ endif
+ endif
+ rm -f $(PREFIX)/bin/bunzip2
+ rm -f $(PREFIX)/bin/bzcat
+ ( cd $(PREFIX)/bin && ln -s bzip2 bunzip2 )
+ ( cd $(PREFIX)/bin && ln -s bzip2 bzcat )
+ rm -f $(PREFIX)/bin/bunzip2-shared
+ rm -f $(PREFIX)/bin/bzcat-shared
+ ifeq ($(ENABLE_BIN_SHARED),1)
+ ifeq ($(ENABLE_BIN_STATIC),1)
+ ( cd $(PREFIX)/bin && ln -s bzip2-shared bunzip2-shared )
+ ( cd $(PREFIX)/bin && ln -s bzip2-shared bzcat-shared )
+ endif
+ endif
cp -f bzip2recover $(PREFIX)/bin/bzip2recover
- chmod a+x $(PREFIX)/bin/bzip2
- chmod a+x $(PREFIX)/bin/bunzip2
- chmod a+x $(PREFIX)/bin/bzcat
- chmod a+x $(PREFIX)/bin/bzip2recover
- cp -f bzip2.1 $(PREFIX)/man/man1
- chmod a+r $(PREFIX)/man/man1/bzip2.1
- cp -f bzlib.h $(PREFIX)/include
- chmod a+r $(PREFIX)/include/bzlib.h
- cp -f libbz2.a $(PREFIX)/lib
- chmod a+r $(PREFIX)/lib/libbz2.a
+ chmod a+rx $(PREFIX)/bin/bzip2recover
cp -f bzgrep $(PREFIX)/bin/bzgrep
- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
- chmod a+x $(PREFIX)/bin/bzgrep
+ chmod a+rx $(PREFIX)/bin/bzgrep
+ rm -f $(PREFIX)/bin/bzegrep
+ rm -f $(PREFIX)/bin/bzfgrep
+ ( cd $(PREFIX)/bin && ln -s bzgrep bzegrep )
+ ( cd $(PREFIX)/bin && ln -s bzgrep bzfgrep )
cp -f bzmore $(PREFIX)/bin/bzmore
- ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
- chmod a+x $(PREFIX)/bin/bzmore
+ chmod a+rx $(PREFIX)/bin/bzmore
+ rm -f $(PREFIX)/bin/bzless
+ ( cd $(PREFIX)/bin && ln -s bzmore bzless )
+ rm -f $(PREFIX)/bin/bzcmp
cp -f bzdiff $(PREFIX)/bin/bzdiff
- ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
- chmod a+x $(PREFIX)/bin/bzdiff
- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
- chmod a+r $(PREFIX)/man/man1/bzgrep.1
- chmod a+r $(PREFIX)/man/man1/bzmore.1
- chmod a+r $(PREFIX)/man/man1/bzdiff.1
+ chmod a+rx $(PREFIX)/bin/bzdiff
+ ( cd $(PREFIX)/bin && ln -s bzdiff bzcmp )
+endif
+ifeq ($(ENABLE_DEV),1)
+ cp -f bzlib.h $(PREFIX)/include
+ chmod a+r $(PREFIX)/include/bzlib.h
+endif
+ifeq ($(ENABLE_DOCS),1)
+ cp -f bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+ chmod a+r $(PREFIX)/man/man1/bzip2.1
+ chmod a+r $(PREFIX)/man/man1/bzgrep.1
+ chmod a+r $(PREFIX)/man/man1/bzmore.1
+ chmod a+r $(PREFIX)/man/man1/bzdiff.1
+ chmod a+r $(PREFIX)/man/man1/bzegrep.1
+ chmod a+r $(PREFIX)/man/man1/bzfgrep.1
+ chmod a+r $(PREFIX)/man/man1/bzless.1
+ chmod a+r $(PREFIX)/man/man1/bzcmp.1
+endif
+ifeq ($(ENABLE_LIB_SHARED),1)
+ cp -f libbz2.so.1.0.8 $(PREFIX)/lib
+ chmod a+r $(PREFIX)/lib/libbz2.so.1.0.8
+ rm -f $(PREFIX)/lib/libbz2.so.1.0
+ rm -f $(PREFIX)/lib/libbz2.so.1
+ rm -f $(PREFIX)/lib/libbz2.so
+ ( cd $(PREFIX)/lib && ln -s libbz2.so.1.0.8 libbz2.so.1.0 )
+ ( cd $(PREFIX)/lib && ln -s libbz2.so.1.0 libbz2.so.1 )
+ ( cd $(PREFIX)/lib && ln -s libbz2.so.1 libbz2.so )
+endif
+ifeq ($(ENABLE_LIB_STATIC),1)
+ cp -f libbz2.a $(PREFIX)/lib
+ chmod a+r $(PREFIX)/lib/libbz2.a
+endif
+
+uninstall:
+ rm -f $(PREFIX)/bin/bzip2
+ rm -f $(PREFIX)/bin/bzip2-shared
+ rm -f $(PREFIX)/bin/bunzip2
+ rm -f $(PREFIX)/bin/bzcat
+ rm -f $(PREFIX)/bin/bunzip2-shared
+ rm -f $(PREFIX)/bin/bzcat-shared
+ rm -f $(PREFIX)/bin/bzip2recover
+ rm -f $(PREFIX)/bin/bzgrep
+ rm -f $(PREFIX)/bin/bzegrep
+ rm -f $(PREFIX)/bin/bzfgrep
+ rm -f $(PREFIX)/bin/bzmore
+ rm -f $(PREFIX)/bin/bzless
+ rm -f $(PREFIX)/bin/bzdiff
+ rm -f $(PREFIX)/bin/bzcmp
+ rm -f $(PREFIX)/include/bzlib.h
+ rm -f $(PREFIX)/lib/libbz2.so.1.0.8
+ rm -f $(PREFIX)/lib/libbz2.so.1.0
+ rm -f $(PREFIX)/lib/libbz2.so.1
+ rm -f $(PREFIX)/lib/libbz2.so
+ rm -f $(PREFIX)/lib/libbz2.a
+ rm -f $(PREFIX)/man/man1/bzip2.1
+ rm -f $(PREFIX)/man/man1/bzgrep.1
+ rm -f $(PREFIX)/man/man1/bzmore.1
+ rm -f $(PREFIX)/man/man1/bzdiff.1
+ rm -f $(PREFIX)/man/man1/bzegrep.1
+ rm -f $(PREFIX)/man/man1/bzfgrep.1
+ rm -f $(PREFIX)/man/man1/bzless.1
+ rm -f $(PREFIX)/man/man1/bzcmp.1
+ (rmdir $(PREFIX)/bin $(PREFIX)/include $(PREFIX)/lib $(PREFIX)/man/man1 $(PREFIX)/man || true ) 2> /dev/null
clean:
- rm -f *.o libbz2.a bzip2 bzip2recover \
+ rm -f $(OBJS) bzip2.o \
+ libbz2.so.1.0.8 libbz2.so.1.0 libbz2.so.1 libbz2.so \
+ libbz2.a bzip2 bzip2-shared bzip2recover \
sample1.rb2 sample2.rb2 sample3.rb2 \
sample1.tst sample2.tst sample3.tst
blocksort.o: blocksort.c
@cat words0
- $(CC) $(CFLAGS) -c blocksort.c
+ $(CC) $(CFLAGS_NOPIC) -c blocksort.c
huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
+ $(CC) $(CFLAGS_NOPIC) -c huffman.c
crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
+ $(CC) $(CFLAGS_NOPIC) -c crctable.c
randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
+ $(CC) $(CFLAGS_NOPIC) -c randtable.c
compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
+ $(CC) $(CFLAGS_NOPIC) -c compress.c
decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
+ $(CC) $(CFLAGS_NOPIC) -c decompress.c
bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
+ $(CC) $(CFLAGS_NOPIC) -c bzlib.c
bzip2.o: bzip2.c
- $(CC) $(CFLAGS) -c bzip2.c
+ $(CC) $(CFLAGS_NOPIC) -c bzip2.c
bzip2recover.o: bzip2recover.c
- $(CC) $(CFLAGS) -c bzip2recover.c
+ $(CC) $(CFLAGS_NOPIC) -c bzip2recover.c
distclean: clean
@@ -189,7 +333,6 @@ dist: check manual
$(DISTNAME)/bzmore.1 \
$(DISTNAME)/bzgrep \
$(DISTNAME)/bzgrep.1 \
- $(DISTNAME)/Makefile-libbz2_so \
$(DISTNAME)/bz-common.xsl \
$(DISTNAME)/bz-fo.xsl \
$(DISTNAME)/bz-html.xsl \
--- a/Makefile-libbz2_so
+++ b/Makefile-libbz2_so
@@ -1,59 +0,0 @@
-
-# This Makefile builds a shared version of the library,
-# libbz2.so.1.0.8, with soname libbz2.so.1.0,
-# at least on x86-Linux (RedHat 7.2),
-# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
-# Please see the README file for some important info
-# about building the library like this.
-
-# ------------------------------------------------------------------
-# This file is part of bzip2/libbzip2, a program and library for
-# lossless, block-sorting data compression.
-#
-# bzip2/libbzip2 version 1.0.8 of 13 July 2019
-# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
-#
-# Please read the WARNING, DISCLAIMER and PATENTS sections in the
-# README file.
-#
-# This program is released under the terms of the license contained
-# in the file LICENSE.
-# ------------------------------------------------------------------
-
-
-SHELL=/bin/sh
-CC=gcc
-BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
-
-OBJS= blocksort.o \
- huffman.o \
- crctable.o \
- randtable.o \
- compress.o \
- decompress.o \
- bzlib.o
-
-all: $(OBJS)
- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)
- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
- rm -f libbz2.so.1.0
- ln -s libbz2.so.1.0.8 libbz2.so.1.0
-
-clean:
- rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared
-
-blocksort.o: blocksort.c
- $(CC) $(CFLAGS) -c blocksort.c
-huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
-crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
-randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
-compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
-decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
-bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
--- a/unzcrash.c
+++ b/unzcrash.c
@@ -30,7 +30,7 @@
#include <stdio.h>
#include <assert.h>
-#include "bzlib.h"
+#include <bzlib.h>
#define M_BLOCK 1000000

View File

@@ -0,0 +1,32 @@
#
# Copyright (c) 2017-2019 Tomasz Maciej Nowak <tmn505@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME := cbootimage-configs
PKG_SOURCE_DATE := 2017-04-13
PKG_SOURCE_PROTO := git
PKG_SOURCE_URL := https://github.com/NVIDIA/cbootimage-configs.git
PKG_SOURCE_VERSION := 7c3b458b93ed6947cd083623f543e93f9103cc0f
PKG_MIRROR_HASH := 1d24421af8cf74ec2d625e237aa8121b1273774c4380ad333e2954e052a5a4fe
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/share/$(PKG_NAME)
$(CP) $(HOST_BUILD_DIR)/* \
$(STAGING_DIR_HOST)/share/$(PKG_NAME)
endef
define Host/Clean
rm -fR $(STAGING_DIR_HOST)/share/$(PKG_NAME)
endef
$(eval $(call HostBuild))

31
tools/cbootimage/Makefile Normal file
View File

@@ -0,0 +1,31 @@
#
# Copyright (c) 2017-2019 Tomasz Maciej Nowak <tmn505@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME := cbootimage
PKG_VERSION := 1.8
PKG_SOURCE_PROTO := git
PKG_SOURCE_URL := https://github.com/NVIDIA/cbootimage.git
PKG_SOURCE_VERSION := 7c9db585d06cce9efffa2a82245f233233680060
PKG_MIRROR_HASH := 84d9abaaa3eddde05f506dc16effe1c9e18eb94727ed59c5e0a879baeb04e0b2
HOST_BUILD_PARALLEL := 1
include $(INCLUDE_DIR)/host-build.mk
define Host/Configure
(cd $(HOST_BUILD_DIR); autoreconf --install --symlink)
$(call Host/Configure/Default)
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/$(PKG_NAME) \
$(STAGING_DIR_HOST)/share/man/man1/$(PKG_NAME).1
endef
$(eval $(call HostBuild))

27
tools/ccache/Makefile Normal file
View File

@@ -0,0 +1,27 @@
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ccache
PKG_VERSION:=4.8.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION)
PKG_HASH:=87959b6819530b3dcaeb39992f585b9fc2c7120302809741378097774919fb6f
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_HOST_OPTIONS += \
-DCMAKE_C_COMPILER_LAUNCHER="" \
-DCMAKE_CXX_COMPILER_LAUNCHER="" \
-DCMAKE_SKIP_RPATH=FALSE \
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" \
-DENABLE_DOCUMENTATION=OFF \
-DREDIS_STORAGE_BACKEND=OFF
$(eval $(call HostBuild))

View File

@@ -0,0 +1,10 @@
--- a/src/ccache.cpp
+++ b/src/ccache.cpp
@@ -1815,6 +1815,7 @@ get_manifest_key(Context& ctx, Hash& has
"CPLUS_INCLUDE_PATH",
"OBJC_INCLUDE_PATH",
"OBJCPLUS_INCLUDE_PATH", // clang
+ "GCC_HONOUR_COPTS",
nullptr};
for (const char** p = envvars; *p; ++p) {
const char* v = getenv(*p);

57
tools/cmake/Makefile Normal file
View File

@@ -0,0 +1,57 @@
#
# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=cmake
PKG_VERSION:=3.26.4
PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION)))
PKG_RELEASE:=1
PKG_CPE_ID:=cpe:/a:kitware:cmake
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \
https://cmake.org/files/v$(PKG_VERSION_MAJOR)/
PKG_HASH:=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
HOST_BUILD_PARALLEL:=1
HOST_CONFIGURE_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_VARS += \
CC="$(HOSTCC_NOCACHE)" \
CXX="$(HOSTCXX_NOCACHE)" \
MAKEFLAGS="$(HOST_JOBS)" \
CXXFLAGS="$(HOST_CFLAGS)" \
MAKE="$(STAGING_DIR_HOST)/bin/ninja"
HOST_CONFIGURE_ARGS := \
$(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
--prefix="$(STAGING_DIR_HOST)" \
--system-expat \
--system-liblzma \
--system-zlib \
--system-zstd \
--generator=Ninja
define Host/Compile/Default
+$(NINJA) -C $(HOST_BUILD_DIR) $(1)
endef
define Host/Install/Default
+$(NINJA) -C $(HOST_BUILD_DIR) install
endef
define Host/Uninstall/Default
+$(NINJA) -C $(HOST_BUILD_DIR) uninstall
endef
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
HOST_MAKE_FLAGS += VERBOSE=1
endif
$(eval $(call HostBuild))

View File

@@ -0,0 +1,33 @@
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -47,7 +47,7 @@ the :variable:`CTEST_USE_LAUNCHERS` vari
in the ``CTestConfig.cmake`` file.
#]=======================================================================]
-option(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." OFF)
# function to turn generator name into a version string
# like vs9 or vs10
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -33,7 +33,7 @@ whether testing support should be enable
#
#
-option(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." OFF)
if(BUILD_TESTING)
find_package(Dart QUIET)
--- a/Tests/Contracts/VTK/Dashboard.cmake.in
+++ b/Tests/Contracts/VTK/Dashboard.cmake.in
@@ -25,7 +25,7 @@ ctest_empty_binary_directory(${CTEST_BIN
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
VTK_BUILD_EXAMPLES:BOOL=ON
- VTK_BUILD_TESTING:STRING=WANT
+ VTK_BUILD_TESTING:STRING=OFF
VTK_WRAP_PYTHON:BOOL=ON
ExternalData_OBJECT_STORES:FILEPATH=@base_dir@/ExternalData
")

View File

@@ -0,0 +1,17 @@
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -58,7 +58,13 @@ The following variables are provided for
#]=======================================================================]
-find_path(LIBLZMA_INCLUDE_DIR lzma.h )
+if(UNIX)
+ find_package(PkgConfig QUIET)
+ pkg_search_module(PC_liblzma liblzma)
+endif()
+
+find_path(LIBLZMA_INCLUDE_DIR lzma.h HINTS ${PC_liblzma_INCLUDEDIR} ${PC_liblzma_INCLUDE_DIRS})
+find_library(LIBLZMA_LIBRARY NAMES lzma HINTS ${PC_liblzma_LIBDIR} ${PC_liblzma_LIBRARY_DIRS})
if(NOT LIBLZMA_LIBRARY)
find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib)
find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad NAMES_PER_DIR PATH_SUFFIXES lib)

View File

@@ -0,0 +1,37 @@
From: Jo-Philipp Wich <jo@mein.io>
Date: Wed, 11 Jan 2017 03:36:04 +0100
Subject: [PATCH] cmcurl: link librt
When cmake is linked against LibreSSL, there might be an indirect
dependency on librt on certain systems if LibreSSL's libcrypto uses
clock_gettime() from librt:
[ 28%] Linking C executable LIBCURL
.../lib/libcrypto.a(getentropy_linux.o): In function `getentropy_fallback':
getentropy_linux.c:(.text+0x16d): undefined reference to `clock_gettime'
getentropy_linux.c:(.text+0x412): undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
make[5]: *** [Utilities/cmcurl/LIBCURL] Error 1
Modify the cmcurl CMakeLists.txt to check for clock_gettime() in librt
and unconditionally link the rt library when the symbol is found.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -611,6 +611,14 @@ if(CURL_USE_OPENSSL)
endif()
set(SSL_ENABLED ON)
set(USE_OPENSSL ON)
+ check_library_exists("rt" clock_gettime "" HAVE_LIBRT)
+ if(HAVE_LIBRT)
+ list(APPEND OPENSSL_LIBRARIES rt)
+ endif()
+ check_library_exists("pthread" pthread_once "" HAVE_PTHREAD)
+ if(HAVE_PTHREAD)
+ list(APPEND OPENSSL_LIBRARIES pthread)
+ endif()
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
include_directories(${OPENSSL_INCLUDE_DIR})

View File

@@ -0,0 +1,14 @@
--- a/bootstrap
+++ b/bootstrap
@@ -1449,7 +1449,10 @@ int main(){ printf("1%c", (char)0x0a); r
' > "test.c"
cmake_original_make_flags="${cmake_make_flags}"
if test "x${cmake_parallel_make}" != "x"; then
- cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
+ case "$cmake_parallel_make" in
+ [0-9]*) cmake_parallel_make="-j ${cmake_parallel_make}";;
+ esac
+ cmake_make_flags="${cmake_make_flags} ${cmake_parallel_make}"
fi
for a in ${cmake_make_processors}; do
if test -z "${cmake_make_processor}" && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then

View File

@@ -0,0 +1,20 @@
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -117,10 +117,13 @@ else()
set(ZLIB_NAMES_DEBUG zd zlibd zdlld zlibd1 zlib1d zlibstaticd zlibwapid zlibvcd zlibstatd)
endif()
-# Try each search configuration.
-foreach(search ${_ZLIB_SEARCHES})
- find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
-endforeach()
+if(UNIX)
+ find_package(PkgConfig QUIET)
+ pkg_search_module(PC_zlib zlib)
+endif()
+
+find_path(ZLIB_INCLUDE_DIR zlib.h HINTS ${PC_zlib_INCLUDEDIR} ${PC_zlib_INCLUDE_DIRS})
+find_library(ZLIB_LIBRARY NAMES z HINTS ${PC_zlib_LIBDIR} ${PC_zlib_LIBRARY_DIRS})
# Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library
if(NOT ZLIB_LIBRARY)

View File

@@ -0,0 +1,18 @@
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -632,8 +632,13 @@ IF(ENABLE_ZSTD)
SET(ZSTD_FIND_QUIETLY TRUE)
ENDIF (ZSTD_INCLUDE_DIR)
- FIND_PATH(ZSTD_INCLUDE_DIR zstd.h)
- FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd libzstd)
+ IF(UNIX)
+ FIND_PACKAGE(PkgConfig QUIET)
+ PKG_SEARCH_MODULE(PC_ZSTD libzstd)
+ ENDIF()
+
+ FIND_PATH(ZSTD_INCLUDE_DIR zstd.h HINTS ${PC_ZSTD_INCLUDEDIR} ${PC_ZSTD_INCLUDE_DIRS})
+ FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd HINTS ${PC_ZSTD_LIBDIR} ${PC_ZSTD_LIBRARY_DIRS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR)
ELSE(ENABLE_ZSTD)

68
tools/coreutils/Makefile Normal file
View File

@@ -0,0 +1,68 @@
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=coreutils
PKG_CPE_ID:=cpe:/a:gnu:coreutils
PKG_VERSION:=9.3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/coreutils
PKG_HASH:=adbcfcfe899235b71e8768dcf07cd532520b7f54f9a8064843f8d199a904bbaa
HOST_BUILD_PARALLEL := 1
PKG_PROGRAMS:=date readlink touch ln chown ginstall
include $(INCLUDE_DIR)/host-build.mk
export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
HOST_CONFIGURE_ARGS += \
--enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS)))
HOST_MAKE_FLAGS += \
$(AM_TOOL_PATHS_FAKE) \
PROGRAMS="$(patsubst %,src/%,$(PKG_PROGRAMS))" \
LIBRARIES= MANS= SUBDIRS=.
define Host/Bootstrap
( \
cd $(HOST_BUILD_DIR); \
$(AM_TOOL_PATHS_FAKE) \
./bootstrap \
--bootstrap-sync \
--force \
--no-git \
--skip-po \
--gnulib-srcdir=$(GNULIB_SRCDIR) \
)
endef
define Host/Prepare
$(call Host/Prepare/Default)
$(if $(QUILT),,$(call Host/Bootstrap))
endef
define Host/Configure
$(if $(QUILT),$(call Host/Bootstrap))
-$(CP) $(HOST_BUILD_DIR)/lib/time.in.h~ $(HOST_BUILD_DIR)/lib/time.in.h # @GNULIB_TIME@ not defined
$(call Host/Configure/Default)
endef
define Host/Install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/src/%,$(PKG_PROGRAMS)) $(1)/bin/
ln -sf ginstall $(1)/bin/install
endef
define Host/Uninstall
rm -f $(STAGING_DIR_HOST)/bin/install
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,45 @@
--- a/bootstrap
+++ b/bootstrap
@@ -278,7 +278,7 @@ check_exists() {
($2 --version </dev/null)
fi
else
- ($1 --version </dev/null) >/dev/null 2>&1
+ ($@ --version </dev/null) >/dev/null 2>&1
fi
test $? -lt 126
@@ -563,7 +563,7 @@ p
q'
get_version() {
- app=$1
+ app="$@"
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
@@ -620,13 +620,13 @@ check_versions() {
if [ "$req_ver" = "-" ]; then
# Merely require app to exist; not all prereq apps are well-behaved
# so we have to rely on $? rather than get_version.
- if ! check_exists --verbose $app; then
+ if ! check_exists --verbose "$app"; then
warn_ "Error: '$app' not found"
ret=1
fi
else
# Require app to produce a new enough version string.
- inst_ver=$(get_version $app)
+ inst_ver=$(get_version "$app")
if [ ! "$inst_ver" ]; then
warn_ "Error: '$app' not found"
ret=1
@@ -923,7 +923,7 @@ version_controlled_file() {
# two just-pre-run programs.
# Import from gettext.
-with_gettext=yes
+with_gettext=no
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
with_gettext=no

18
tools/cpio/Makefile Normal file
View File

@@ -0,0 +1,18 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=cpio
PKG_CPE_ID:=cpe:/a:gnu:cpio
PKG_VERSION:=2.15
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@GNU/cpio
PKG_HASH:=937610b97c329a1ec9268553fb780037bcfff0dcffe9725ebc4fd9c1aa9075db
include $(INCLUDE_DIR)/host-build.mk
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,23 @@
--- a/src/extern.h
+++ b/src/extern.h
@@ -97,7 +97,8 @@ extern char input_is_special;
extern char output_is_special;
extern char input_is_seekable;
extern char output_is_seekable;
-extern int (*xstat) ();
+//void not good enough
+extern int (*xstat) (const char * restrict, struct stat * restrict);
extern void (*copy_function) ();
extern char *change_directory_option;
--- a/src/global.c
+++ b/src/global.c
@@ -185,7 +185,7 @@ bool to_stdout_option = false;
/* A pointer to either lstat or stat, depending on whether
dereferencing of symlinks is done for input files. */
-int (*xstat) ();
+int (*xstat) (const char * restrict, struct stat * restrict);
/* Which copy operation to perform. (-i, -o, -p) */
void (*copy_function) () = 0;

31
tools/dosfstools/Makefile Normal file
View File

@@ -0,0 +1,31 @@
#
# Copyright (C) 2012-2015 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dosfstools
PKG_CPE_ID:=cpe:/a:dosfstools_project:dosfstools
PKG_VERSION:=4.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
http://fossies.org/linux/misc
PKG_HASH:=64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527
HOST_FIXUP:=autoreconf
include $(INCLUDE_DIR)/host-build.mk
ifeq ($(HOST_OS),Darwin)
HOST_CFLAGS += -UHAVE_ENDIAN_H
endif
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,150 @@
From 8da7bc93315cb0c32ad868f17808468b81fa76ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
Date: Wed, 5 Dec 2018 19:52:51 +0100
Subject: [PATCH] Honor the SOURCE_DATE_EPOCH variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Implement the SOURCE_DATE_EPOCH specification[1] for reproducible
builds. If SOURCE_DATE_EPOCH is set, use it as timestamp instead of the
current time.
[1] https://reproducible-builds.org/specs/source-date-epoch/
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
---
src/boot.c | 23 +++++++++++++++++++++--
src/common.c | 18 ++++++++++++++++--
src/mkfs.fat.c | 19 ++++++++++++++++---
3 files changed, 53 insertions(+), 7 deletions(-)
--- a/src/boot.c
+++ b/src/boot.c
@@ -33,6 +33,8 @@
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
+#include <errno.h>
+#include <ctype.h>
#include "common.h"
#include "fsck.fat.h"
@@ -672,6 +674,7 @@ void write_volume_label(DOS_FS * fs, cha
{
time_t now;
struct tm *mtime;
+ char *source_date_epoch = NULL;
off_t offset;
int created;
DIR_ENT de;
@@ -687,8 +690,24 @@ void write_volume_label(DOS_FS * fs, cha
if (de.name[0] == 0xe5)
de.name[0] = 0x05;
- now = time(NULL);
- mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
+ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch) {
+ char *tmp = NULL;
+ long long conversion = 0;
+ errno = 0;
+ conversion = strtoll(source_date_epoch, &tmp, 10);
+ now = conversion;
+ if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
+ || errno != 0 || (long long)now != conversion) {
+ die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
+ source_date_epoch);
+ }
+ mtime = gmtime(&now);
+ } else {
+ now = time(NULL);
+ mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
+ }
+
if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
(mtime->tm_min << 5) +
--- a/src/common.c
+++ b/src/common.c
@@ -30,6 +30,7 @@
#include <string.h>
#include <stdarg.h>
#include <errno.h>
+#include <ctype.h>
#include <wctype.h>
#include <termios.h>
#include <sys/time.h>
@@ -298,8 +299,21 @@ void check_atari(void)
uint32_t generate_volume_id(void)
{
struct timeval now;
+ char *source_date_epoch = NULL;
- if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
+ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch) {
+ char *tmp = NULL;
+ long long conversion = 0;
+ errno = 0;
+ conversion = strtoll(source_date_epoch, &tmp, 10);
+ if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
+ || errno != 0) {
+ die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
+ source_date_epoch);
+ }
+ return (uint32_t)conversion;
+ } else if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
srand(getpid());
/* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
--- a/src/mkfs.fat.c
+++ b/src/mkfs.fat.c
@@ -1074,7 +1074,7 @@ static void setup_tables(void)
}
/* If is not available then generate random 32 bit disk signature */
- if (invariant)
+ if (invariant || getenv("SOURCE_DATE_EPOCH"))
disk_sig = volume_id;
else if (!disk_sig)
disk_sig = generate_volume_id();
@@ -1287,7 +1287,7 @@ static void setup_tables(void)
de->name[0] = 0x05;
de->attr = ATTR_VOLUME;
if (create_time != (time_t)-1) {
- if (!invariant)
+ if (!invariant && !getenv("SOURCE_DATE_EPOCH"))
ctime = localtime(&create_time);
else
ctime = gmtime(&create_time);
@@ -1477,6 +1477,7 @@ int main(int argc, char **argv)
int blocks_specified = 0;
struct timeval create_timeval;
long long conversion;
+ char *source_date_epoch = NULL;
enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
const struct option long_options[] = {
@@ -1497,8 +1498,20 @@ int main(int argc, char **argv)
program_name = p + 1;
}
- if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1)
+ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch) {
+ errno = 0;
+ conversion = strtoll(source_date_epoch, &tmp, 10);
+ create_time = conversion;
+ if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0'
+ || errno != 0 || (long long)create_time != conversion) {
+ die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"",
+ source_date_epoch);
+ }
+ } else if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1) {
create_time = create_timeval.tv_sec;
+ }
+
volume_id = generate_volume_id();
check_atari();

View File

@@ -0,0 +1,28 @@
From e7671c2a3be03d790cbc225cd3e784b5434fb5da Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Mon, 16 Jan 2023 01:29:22 +0100
Subject: [PATCH] config: switch to AC_CHECK_LIB
This fixes spurious build-errors on OpenWrt, where the AM_ICONV macro
is undefined while invoking autoconfig. Later in the build, the ICONV
LDOPTIONS are set to @LIBICONV@, failing the build.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
configure.ac | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -70,10 +70,7 @@ AC_CHECK_DECLS([getmntent], [], [], [[#i
AC_CHECK_DECLS([getmntinfo], [], [], [[#include <sys/mount.h>]])
# optional iconv support
-AC_ARG_WITH([iconv], AS_HELP_STRING([--without-iconv], [build without iconv support]))
-if test "x$with_iconv" != "xno"; then
- AM_ICONV
-fi
+AC_CHECK_LIB(iconv, iconv_open)
# xxd (distributed with vim) is used in the testsuite
AC_CHECK_PROG([XXD_FOUND], [xxd], [yes])

35
tools/dwarves/Makefile Normal file
View File

@@ -0,0 +1,35 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=dwarves
PKG_VERSION:=1.25
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://fedorapeople.org/~acme/dwarves/
PKG_HASH:=e7d45955f6f4eca25a4c8c3bd6611059b35dc217e45976681d7db170fccdec4a
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_HOST_OPTIONS += \
-D__LIB=lib \
-DCMAKE_INSTALL_RPATH="$(STAGING_DIR_HOST)/lib" \
-DCMAKE_SKIP_RPATH=FALSE
define Host/Clean
$(RM) $(STAGING_DIR_HOST)/bin/{codiff,ctracer,dtagnames,pahole,pdwtags}
$(RM) $(STAGING_DIR_HOST)/bin/{pfunct,pglobal,prefcnt,scncopy,syscse}
$(RM) $(STAGING_DIR_HOST)/bin/{ostra-cg,btfdiff,fullcircle}
$(RM) $(STAGING_DIR_HOST)/lib/libdwarves*.so*
$(RM) $(STAGING_DIR_HOST)/share/man/man1/pahole.1
rm -rf $(STAGING_DIR_HOST)/include/dwarves
rm -rf $(STAGING_DIR_HOST)/share/dwarves
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))

54
tools/e2fsprogs/Makefile Normal file
View File

@@ -0,0 +1,54 @@
#
# Copyright (C) 2010-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs
PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
PKG_VERSION:=1.47.0
PKG_HASH:=144af53f2bbd921cef6f8bea88bb9faddca865da3fbc657cc9b4d2001097d5db
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
ifneq ($(shell $(HOSTCC) --version | grep clang),)
HOST_CFLAGS += -D__GNUC_PREREQ\(...\)=0 -Dloff_t=off_t
endif
HOST_CFLAGS += $(HOST_FPIC)
HOST_CONFIGURE_ARGS += \
--disable-elf-shlibs \
--enable-libuuid \
--disable-tls \
--disable-nls \
--enable-threads=pth
define Host/Prepare
$(call Host/Prepare/Default)
rm -rf $(HOST_BUILD_DIR)/doc
endef
define Host/Install
$(Host/Install/Default)
$(MAKE) -C $(HOST_BUILD_DIR)/lib/uuid install
mkdir -p $(STAGING_DIR_HOST)/include/e2fsprogs
$(CP) $(STAGING_DIR_HOST)/include/uuid $(STAGING_DIR_HOST)/include/e2fsprogs/
rm -rf $(STAGING_DIR_HOST)/include/uuid
$(INSTALL_DATA) $(HOST_BUILD_DIR)/lib/uuid/libuuid.a $(STAGING_DIR_HOST)/lib/
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/e2fsck
rm -f $(STAGING_DIR_HOST)/bin/tune2fs
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,11 @@
--- a/e2fsck/e2fsck.h
+++ b/e2fsck/e2fsck.h
@@ -81,7 +81,7 @@
* Exit codes used by fsck-type programs
*/
#define FSCK_OK 0 /* No errors */
-#define FSCK_NONDESTRUCT 1 /* File system errors corrected */
+#define FSCK_NONDESTRUCT 0 /* File system errors corrected */
#define FSCK_REBOOT 2 /* System should be rebooted */
#define FSCK_UNCORRECTED 4 /* File system errors left uncorrected */
#define FSCK_ERROR 8 /* Operational error */

View File

@@ -0,0 +1,11 @@
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -12,7 +12,7 @@ MKDIR_P = @MKDIR_P@
@MCONFIG@
-@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG= e4defrag
+@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG=
@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_MAN= e4defrag.8
@LINUX_CMT@E4CRYPT_PROG = e4crypt

View File

@@ -0,0 +1,11 @@
--- a/configure
+++ b/configure
@@ -15259,7 +15259,7 @@ then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
printf "%s\n" "${crond_dir}" >&6; }
- have_crond="yes"
+ have_crond="no"; with_crond_dir=""
else $as_nop

View File

@@ -0,0 +1,38 @@
From 49fd04d77b3244c6c6990be41142168eef373aef Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Fri, 22 Nov 2024 12:36:32 +0000
Subject: [PATCH] libext2fs: fix -std=c23 build failure
gcc-15 switched to -std=c23 by default:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
As a result `e2fsprogs` fails the build so only typedef int bool
for __STDC_VERSION__ <= 201710L (C17)
../../../lib/ext2fs/tdb.c:113:13: error: two or more data types in declaration specifiers
../../../lib/ext2fs/tdb.c:113:1: warning: useless type name in empty declaration
113 | typedef int bool;
| ^~~~~~~
https://github.com/tytso/e2fsprogs/issues/202
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://lore.kernel.org/r/Z0B60JhdvT9bpSQ6@6f91903e89da
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
lib/ext2fs/tdb.c | 2 ++
1 file changed, 2 insertions(+)
--- a/lib/ext2fs/tdb.c
+++ b/lib/ext2fs/tdb.c
@@ -110,7 +110,9 @@ static char *rep_strdup(const char *s)
#endif
#endif
+#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
typedef int bool;
+#endif
#include "tdb.h"

26
tools/elftosb/Makefile Normal file
View File

@@ -0,0 +1,26 @@
#
# Copyright (C) 2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=elftosb
PKG_VERSION:=10.12.01
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://repository.timesys.com/buildsources/e/elftosb/elftosb-10.12.01/
PKG_HASH:=77bb6981620f7575b87d136d94c7daa88dd09195959cc75fc18b138369ecd42b
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) LDFLAGS="$(HOST_LDFLAGS)"
endef
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/bld/linux/elftosb $(STAGING_DIR_HOST)/bin/elftosb
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,11 @@
--- a/makefile.rules
+++ b/makefile.rules
@@ -101,7 +101,7 @@ OBJ_FILES_KEYGEN = \
keygen.o
-LIBS = -lstdc++
+LIBS = -lstdc++ -lm
ifeq ("${UNAMES}", "Linux")

View File

@@ -0,0 +1,18 @@
This package had an absolute path for sys/types.h, which doesn't
make much sense. It breaks on newer Ubuntu systems, and probably many
others once multiarch becomes more common.
This patch makes the types a relative path, and allows the system
to use whatever include paths it feels are correct.
--- a/common/stdafx.h
+++ b/common/stdafx.h
@@ -27,7 +27,7 @@
// For Linux systems only, types.h only defines the signed
// integer types. This is not professional code.
// Update: They are defined in the header files in the more recent version of redhat enterprise gcc.
-#include "/usr/include/sys/types.h"
+#include <sys/types.h>
#include <stdint.h>
//typedef unsigned long uint32_t;
//typedef unsigned short uint16_t;

View File

@@ -0,0 +1,26 @@
--- a/makefile.rules
+++ b/makefile.rules
@@ -131,19 +131,20 @@ exec_always:
@echo "LIBS = ${LIBS}"
@echo "EXEC_FILE = ${EXEC_FILE}"
@echo "BUILD_DIR = ${BUILD_DIR}"
+ @echo "LDFLAGS = ${LDFLAGS}"
clean:
rm -f ${OBJ_FILES_ELFTOSB2} ${OBJ_FILES_SBTOOL} ${OBJ_FILES_KEYGEN} \
${EXEC_FILE_ELFTOSB2} ${EXEC_FILE_SBTOOL} ${EXEC_FILE_KEYGEN}
elftosb: ${OBJ_FILES_ELFTOSB2}
- gcc ${OBJ_FILES_ELFTOSB2} ${LIBS} -o ${EXEC_FILE_ELFTOSB2}
+ gcc ${OBJ_FILES_ELFTOSB2} ${LIBS} ${LDFLAGS} -o ${EXEC_FILE_ELFTOSB2}
sbtool: ${OBJ_FILES_SBTOOL}
- gcc ${OBJ_FILES_SBTOOL} ${LIBS} -o ${EXEC_FILE_SBTOOL}
+ gcc ${OBJ_FILES_SBTOOL} ${LIBS} ${LDFLAGS} -o ${EXEC_FILE_SBTOOL}
keygen: ${OBJ_FILES_KEYGEN}
- gcc ${OBJ_FILES_KEYGEN} ${LIBS} -o ${EXEC_FILE_KEYGEN}
+ gcc ${OBJ_FILES_KEYGEN} ${LIBS} ${LDFLAGS} -o ${EXEC_FILE_KEYGEN}
#ifeq ("${UNAMES}", "Linux")

39
tools/elfutils/Makefile Normal file
View File

@@ -0,0 +1,39 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=elfutils
PKG_VERSION:=0.189
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
PKG_HASH:=39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CFLAGS +=-std=gnu17
HOST_CONFIGURE_ARGS += \
--disable-debuginfod \
--disable-libdebuginfod \
--disable-nls \
--disable-shared \
--without-lzma \
--without-zstd
HOST_MAKE_FLAGS += \
SUBDIRS="lib libelf libcpu backends libebl libdwelf libdwfl libdw"
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,63 @@
From: Sergei Trofimovich <slyich@gmail.com>
Date: Wed, 17 Jul 2024 22:03:34 +0000 (+0100)
Subject: backends: allocate enough stace for null terminator
X-Git-Tag: elfutils-0.192~64
X-Git-Url: https://sourceware.org/git/?p=elfutils.git;a=commitdiff_plain;h=7508696d107ca01b65ce8273c881462a8658f90f
backends: allocate enough stace for null terminator
`gcc-15` added a new warning in https://gcc.gnu.org/PR115185:
i386_regs.c:88:11: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization]
88 | "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip"
| ^~~~
`elfutils` does not need to store '\0'. We could either initialize the
arrays with individual bytes or allocate extra byte for null.
This change initializes the array bytewise.
* backends/i386_regs.c (i386_register_info): Initialize the
array bytewise to fix gcc-15 warning.
* backends/x86_64_regs.c (x86_64_register_info): Ditto.
Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
---
--- a/backends/i386_regs.c
+++ b/backends/i386_regs.c
@@ -85,7 +85,15 @@ i386_register_info (Ebl *ebl __attribute
{
static const char baseregs[][2] =
{
- "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip"
+ {'a', 'x'},
+ {'c', 'x'},
+ {'d', 'x'},
+ {'b', 'x'},
+ {'s', 'p'},
+ {'b', 'p'},
+ {'s', 'i'},
+ {'d', 'i'},
+ {'i', 'p'},
};
case 4:
--- a/backends/x86_64_regs.c
+++ b/backends/x86_64_regs.c
@@ -82,7 +82,14 @@ x86_64_register_info (Ebl *ebl __attribu
{
static const char baseregs[][2] =
{
- "ax", "dx", "cx", "bx", "si", "di", "bp", "sp"
+ {'a', 'x'},
+ {'d', 'x'},
+ {'c', 'x'},
+ {'b', 'x'},
+ {'s', 'i'},
+ {'d', 'i'},
+ {'b', 'p'},
+ {'s', 'p'},
};
case 6 ... 7:

33
tools/expat/Makefile Normal file
View File

@@ -0,0 +1,33 @@
#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=expat
PKG_CPE_ID:=cpe:/a:libexpat:expat
PKG_VERSION:=2.5.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe
PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION))
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOSTCC := $(HOSTCC_NOCACHE)
HOST_CONFIGURE_ARGS += \
--disable-shared \
--without-docbook \
--with-pic
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

32
tools/fakeroot/Makefile Normal file
View File

@@ -0,0 +1,32 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=fakeroot
PKG_VERSION:=1.29
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot
PKG_HASH:=8fbbafb780c9173e3ace4a04afbc1d900f337f3216883939f5c7db3431be7c20
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_VARS += \
ac_cv_header_sys_capability_h=no \
ac_cv_func_capset=no \
CPP="$(HOSTCC) -E"
HOST_CONFIGURE_ARGS += \
--with-ipc=tcp
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,29 @@
--- a/scripts/fakeroot.in
+++ b/scripts/fakeroot.in
@@ -30,13 +30,20 @@ fatal ()
}
# strip /bin/fakeroot to find install prefix
-FAKEROOT_PREFIX=@prefix@
-FAKEROOT_BINDIR=@bindir@
+if [ -n "$STAGING_DIR_HOST" ]; then
+ USEABSLIBPATH=1
+ FAKEROOT_LIB=${STAGING_DIR_HOST}/lib/lib@fakeroot_transformed@@DLSUFFIX@
+ FAKED=${STAGING_DIR_HOST}/bin/faked
+ PATHS=
+else
+ FAKEROOT_PREFIX=@prefix@
+ FAKEROOT_BINDIR=@bindir@
-USEABSLIBPATH=@LDPRELOADABS@
-FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@
-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
-FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
+ USEABSLIBPATH=@LDPRELOADABS@
+ FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@
+ PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
+ FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
+fi
FAKED_MODE="unknown-is-root"
export FAKED_MODE

View File

@@ -0,0 +1,10 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I build-aux
-SUBDIRS=doc scripts test
+SUBDIRS=scripts test
noinst_LTLIBRARIES = libcommunicate.la libmacosx.la
libcommunicate_la_SOURCES = communicate.c

View File

@@ -0,0 +1,34 @@
Alpine linux libc.musl build error fix
Prevent build error on Alpine Linux host:
libfakeroot.c error: conflicting types for 'id_t'
Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: symbol not found
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -86,12 +86,14 @@
#define SEND_STAT64(a,b,c) send_stat64(a,b,c)
#define SEND_GET_STAT(a,b) send_get_stat(a,b)
#define SEND_GET_STAT64(a,b) send_get_stat64(a,b)
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c)
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c)
#else
#define SEND_STAT(a,b,c) send_stat(a,b)
#define SEND_STAT64(a,b,c) send_stat64(a,b)
#define SEND_GET_STAT(a,b) send_get_stat(a)
#define SEND_GET_STAT64(a,b) send_get_stat64(a)
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b)
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
#endif
@@ -142,8 +144,9 @@
/* 10.10 uses id_t in getpriority/setpriority calls, so pretend
id_t is used everywhere, just happens to be int on some OSes */
-#ifndef _ID_T
+#if !defined(_ID_T) && !defined(__DEFINED_id_t)
#define _ID_T
+#define __DEFINED_id_t
typedef int id_t;
#endif
#endif

View File

@@ -0,0 +1,56 @@
--- a/communicate.c
+++ b/communicate.c
@@ -441,6 +441,10 @@ void semaphore_down(){
#else /* FAKEROOT_FAKENET */
+#ifndef SOL_TCP
+# define SOL_TCP 6 /* this should probably be done with getprotoent */
+#endif
+
static struct sockaddr *get_addr(void)
{
static struct sockaddr_in addr = { 0, 0, { 0 } };
--- a/libfakeroot_inode64.c
+++ b/libfakeroot_inode64.c
@@ -25,7 +25,7 @@
#include "config.h"
#include "communicate.h"
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T
#include <stdio.h>
#include <spawn.h>
--- a/wrapfunc.inp
+++ b/wrapfunc.inp
@@ -48,9 +48,11 @@ getattrlist$UNIX2003;int;(const char *pa
#endif
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if !__DARWIN_ONLY_64_BIT_INO_T
lstat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
stat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
fstat$INODE64;int;(int fd, struct stat *buf);(fd, buf)
+#endif
posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
#endif
@@ -229,7 +231,7 @@ facl;int;(int fd, int cmd, int cnt, void
#ifdef HAVE_FTS_READ
fts_read;FTSENT *;(FTS *ftsp);(ftsp)
#ifdef __APPLE__
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T
fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp)
#endif
#endif /* ifdef __APPLE__ */
@@ -237,7 +239,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f
#ifdef HAVE_FTS_CHILDREN
fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
#ifdef __APPLE__
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T
fts_children$INODE64;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
#endif
#endif /* ifdef __APPLE__ */

37
tools/findutils/Makefile Normal file
View File

@@ -0,0 +1,37 @@
#
# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=findutils
PKG_CPE_ID:=cpe:/a:gnu:findutils
PKG_VERSION:=4.9.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe
PKG_PROGRAMS:=find locate updatedb xargs
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
ifeq ($(HOST_OS),Darwin)
HOST_CFLAGS +=-D__nonnull\\(params\\)=
endif
HOST_CONFIGURE_ARGS += \
--enable-threads=pth \
--disable-rpath \
--disable-nls \
--without-selinux
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,20 @@
--- a/find/parser.c
+++ b/find/parser.c
@@ -67,12 +67,12 @@
#include "findutils-version.h"
#include "system.h"
-
-#ifndef HAVE_ENDGRENT
-# define endgrent ()
+#if ! HAVE_ENDGRENT
+# define endgrent() ((void) 0)
#endif
-#ifndef HAVE_ENDPWENT
-# define endpwent ()
+
+#if ! HAVE_ENDPWENT
+# define endpwent() ((void) 0)
#endif
static bool parse_accesscheck (const struct parser_table*, char *argv[], int *arg_ptr);

View File

@@ -0,0 +1,21 @@
#
# Copyright (C) 2006-2020 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=firmware-utils
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
PKG_SOURCE_DATE:=2024-09-22
PKG_SOURCE_VERSION:=f3b636d0ee478ee8d757cb42d469e0a40d07627a
PKG_MIRROR_HASH:=c60f97e2c48842dd5c8e55cb214ce1139fa7586cd22ca489d656320b06bbbe68
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
$(eval $(call HostBuild))

42
tools/flex/Makefile Normal file
View File

@@ -0,0 +1,42 @@
#
# Copyright (C) 2008-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=flex
PKG_CPE_ID:=cpe:/a:westes:flex
PKG_VERSION:=2.6.4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/westes/flex/releases/download/v$(PKG_VERSION)/
PKG_HASH:=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995
HOST_FIXUP:=autoreconf
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += --disable-shared
define Host/Compile
$(call Host/Compile/Default,SUBDIRS='src tools')
endef
define Host/Install
$(call Host/Compile/Default,install SUBDIRS='src tools')
$(LN) flex $(STAGING_DIR_HOST)/bin/lex
endef
define Host/Uninstall
-$(call Host/Compile/Default,uninstall SUBDIRS='src tools')
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/lex
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,27 @@
From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Mon, 4 Sep 2017 10:47:33 +0800
Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac.
This would, e.g. define _GNU_SOURCE in config.h, enabling the
reallocarray() prototype in glibc 2.26+ on Linux systems with that
version of glibc.
Fixes #241.
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
--- a/configure.ac
+++ b/configure.ac
@@ -25,8 +25,10 @@
# autoconf requirements and initialization
AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
+AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([src/scan.l])
AC_CONFIG_AUX_DIR([build-aux])
+AC_USE_SYSTEM_EXTENSIONS
LT_INIT
AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])
AC_CONFIG_HEADER([src/config.h])

31
tools/flock/Makefile Normal file
View File

@@ -0,0 +1,31 @@
#
# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME := flock
PKG_VERSION := 2.18
PKG_RELEASE := 1
include $(INCLUDE_DIR)/host-build.mk
HOSTCC := $(HOSTCC_NOCACHE)
HOSTCXX := $(HOSTCXX_NOCACHE)
define Host/Compile
mkdir -p $(HOST_BUILD_DIR)
$(HOSTCC) $(HOST_CFLAGS) -o $(HOST_BUILD_DIR)/flock src/flock.c
endef
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/flock $(STAGING_DIR_HOST)/bin/
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/flock
endef
$(eval $(call HostBuild))

342
tools/flock/src/flock.c Normal file
View File

@@ -0,0 +1,342 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2003-2005 H. Peter Anvin - All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall
* be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* ----------------------------------------------------------------------- */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <signal.h>
#include <ctype.h>
#include <string.h>
#include <paths.h>
#include <sysexits.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <fcntl.h>
#define PACKAGE_STRING "util-linux-ng 2.18"
#define _(x) (x)
static const struct option long_options[] = {
{ "shared", 0, NULL, 's' },
{ "exclusive", 0, NULL, 'x' },
{ "unlock", 0, NULL, 'u' },
{ "nonblocking", 0, NULL, 'n' },
{ "nb", 0, NULL, 'n' },
{ "timeout", 1, NULL, 'w' },
{ "wait", 1, NULL, 'w' },
{ "close", 0, NULL, 'o' },
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'V' },
{ 0, 0, 0, 0 }
};
const char *program;
static void usage(int ex)
{
fputs("flock (" PACKAGE_STRING ")\n", stderr);
fprintf(stderr,
_("Usage: %1$s [-sxun][-w #] fd#\n"
" %1$s [-sxon][-w #] file [-c] command...\n"
" %1$s [-sxon][-w #] directory [-c] command...\n"
" -s --shared Get a shared lock\n"
" -x --exclusive Get an exclusive lock\n"
" -u --unlock Remove a lock\n"
" -n --nonblock Fail rather than wait\n"
" -w --timeout Wait for a limited amount of time\n"
" -o --close Close file descriptor before running command\n"
" -c --command Run a single command string through the shell\n"
" -h --help Display this text\n"
" -V --version Display version\n"),
program);
exit(ex);
}
static sig_atomic_t timeout_expired = 0;
static void timeout_handler(int sig)
{
(void)sig;
timeout_expired = 1;
}
static char * strtotimeval(const char *str, struct timeval *tv)
{
char *s;
long fs; /* Fractional seconds */
int i;
tv->tv_sec = strtol(str, &s, 10);
fs = 0;
if ( *s == '.' ) {
s++;
for ( i = 0 ; i < 6 ; i++ ) {
if ( !isdigit(*s) )
break;
fs *= 10;
fs += *s++ - '0';
}
for ( ; i < 6; i++ )
fs *= 10;
while ( isdigit(*s) )
s++;
}
tv->tv_usec = fs;
return s;
}
int main(int argc, char *argv[])
{
struct itimerval timeout, old_timer;
int have_timeout = 0;
int type = LOCK_EX;
int block = 0;
int fd = -1;
int opt, ix;
int do_close = 0;
int err;
int status;
int open_flags = 0;
char *eon;
char **cmd_argv = NULL, *sh_c_argv[4];
const char *filename = NULL;
struct sigaction sa, old_sa;
program = argv[0];
if ( argc < 2 )
usage(EX_USAGE);
memset(&timeout, 0, sizeof timeout);
optopt = 0;
while ( (opt = getopt_long(argc, argv, "+sexnouw:hV?", long_options, &ix)) != EOF ) {
switch(opt) {
case 's':
type = LOCK_SH;
break;
case 'e':
case 'x':
type = LOCK_EX;
break;
case 'u':
type = LOCK_UN;
break;
case 'o':
do_close = 1;
break;
case 'n':
block = LOCK_NB;
break;
case 'w':
have_timeout = 1;
eon = strtotimeval(optarg, &timeout.it_value);
if ( *eon )
usage(EX_USAGE);
break;
case 'V':
printf("flock (%s)\n", PACKAGE_STRING);
exit(0);
default:
/* optopt will be set if this was an unrecognized option, i.e. *not* 'h' or '?' */
usage(optopt ? EX_USAGE : 0);
break;
}
}
if ( argc > optind+1 ) {
/* Run command */
if ( !strcmp(argv[optind+1], "-c") ||
!strcmp(argv[optind+1], "--command") ) {
if ( argc != optind+3 ) {
fprintf(stderr, _("%s: %s requires exactly one command argument\n"),
program, argv[optind+1]);
exit(EX_USAGE);
}
cmd_argv = sh_c_argv;
cmd_argv[0] = getenv("SHELL");
if ( !cmd_argv[0] || !*cmd_argv[0] )
cmd_argv[0] = _PATH_BSHELL;
cmd_argv[1] = "-c";
cmd_argv[2] = argv[optind+2];
cmd_argv[3] = 0;
} else {
cmd_argv = &argv[optind+1];
}
filename = argv[optind];
fd = open(filename, O_RDONLY|O_NOCTTY|O_CREAT, 0666);
/* Linux doesn't like O_CREAT on a directory, even though it should be a
no-op */
if (fd < 0 && errno == EISDIR)
fd = open(filename, O_RDONLY|O_NOCTTY);
if ( fd < 0 ) {
err = errno;
fprintf(stderr, _("%s: cannot open lock file %s: %s\n"),
program, argv[optind], strerror(err));
exit((err == ENOMEM||err == EMFILE||err == ENFILE) ? EX_OSERR :
(err == EROFS||err == ENOSPC) ? EX_CANTCREAT :
EX_NOINPUT);
}
} else if (optind < argc) {
/* Use provided file descriptor */
fd = (int)strtol(argv[optind], &eon, 10);
if ( *eon || !argv[optind] ) {
fprintf(stderr, _("%s: bad number: %s\n"), program, argv[optind]);
exit(EX_USAGE);
}
} else {
/* Bad options */
fprintf(stderr, _("%s: requires file descriptor, file or directory\n"),
program);
exit(EX_USAGE);
}
if ( have_timeout ) {
if ( timeout.it_value.tv_sec == 0 &&
timeout.it_value.tv_usec == 0 ) {
/* -w 0 is equivalent to -n; this has to be special-cased
because setting an itimer to zero means disabled! */
have_timeout = 0;
block = LOCK_NB;
} else {
memset(&sa, 0, sizeof sa);
sa.sa_handler = timeout_handler;
sa.sa_flags = SA_RESETHAND;
sigaction(SIGALRM, &sa, &old_sa);
setitimer(ITIMER_REAL, &timeout, &old_timer);
}
}
while ( flock(fd, type|block) ) {
switch( (err = errno) ) {
case EWOULDBLOCK: /* -n option set and failed to lock */
exit(1);
case EINTR: /* Signal received */
if ( timeout_expired )
exit(1); /* -w option set and failed to lock */
continue; /* otherwise try again */
case EBADF: /* since Linux 3.4 (commit 55725513) */
/* Probably NFSv4 where flock() is emulated by fcntl().
* Let's try to reopen in read-write mode.
*/
if (!(open_flags & O_RDWR) &&
type != LOCK_SH &&
filename &&
access(filename, R_OK | W_OK) == 0) {
close(fd);
open_flags = O_RDWR;
fd = open(filename, open_flags);
break;
}
/* go through */
default: /* Other errors */
if ( filename )
fprintf(stderr, "%s: %s: %s\n", program, filename, strerror(err));
else
fprintf(stderr, "%s: %d: %s\n", program, fd, strerror(err));
exit((err == ENOLCK||err == ENOMEM) ? EX_OSERR : EX_DATAERR);
}
}
if ( have_timeout ) {
setitimer(ITIMER_REAL, &old_timer, NULL); /* Cancel itimer */
sigaction(SIGALRM, &old_sa, NULL); /* Cancel signal handler */
}
status = 0;
if ( cmd_argv ) {
pid_t w, f;
/* Clear any inherited settings */
signal(SIGCHLD, SIG_DFL);
f = fork();
if ( f < 0 ) {
err = errno;
fprintf(stderr, _("%s: fork failed: %s\n"), program, strerror(err));
exit(EX_OSERR);
} else if ( f == 0 ) {
if ( do_close )
close(fd);
err = errno;
execvp(cmd_argv[0], cmd_argv);
/* execvp() failed */
fprintf(stderr, "%s: %s: %s\n", program, cmd_argv[0], strerror(err));
_exit((err == ENOMEM) ? EX_OSERR: EX_UNAVAILABLE);
} else {
do {
w = waitpid(f, &status, 0);
if (w == -1 && errno != EINTR)
break;
} while ( w != f );
if (w == -1) {
err = errno;
status = EXIT_FAILURE;
fprintf(stderr, "%s: waitpid failed: %s\n", program, strerror(err));
} else if ( WIFEXITED(status) )
status = WEXITSTATUS(status);
else if ( WIFSIGNALED(status) )
status = WTERMSIG(status) + 128;
else
status = EX_OSERR; /* WTF? */
}
}
return status;
}

58
tools/genext2fs/Makefile Normal file
View File

@@ -0,0 +1,58 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=genext2fs
PKG_VERSION:=1.5.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/bestouff/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=d3861e4fe89131bd21fbd25cf0b683b727b5c030c4c336fadcd738ada830aab0
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS = \
--target=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--build=$(GNU_HOST_NAME) \
--program-prefix="" \
--program-suffix="" \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var \
--mandir=/usr/man \
--infodir=/usr/info \
define Host/Configure
(cd $(HOST_BUILD_DIR); \
./autogen.sh \
);
$(call Host/Configure/Default)
endef
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) \
CFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
all
endef
define Host/Install
install -m0755 $(HOST_BUILD_DIR)/genext2fs $(STAGING_DIR_HOST)/bin/
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/genext2fs
endef
$(eval $(call HostBuild))

34
tools/gengetopt/Makefile Normal file
View File

@@ -0,0 +1,34 @@
#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=gengetopt
PKG_VERSION:=2.23
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac
PKG_SUBDIRS:=$$$$(foreach dir,gl src skels,$$$$(wildcard $$$$(dir)) )
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
endef
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/gengetopt $(STAGING_DIR_HOST)/bin/
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/gengetopt
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,25 @@
From bfba6445a778007f40af5cbfbe725e12c0fcafc6 Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Tue, 5 Mar 2024 22:25:20 +0100
Subject: [PATCH] gm_utils.cpp: Call clear instead of empty.
Since the intention seem to be to erase the next word, I believe calling empty
was a mistake and it should have been clear. Empty does nothing in this
context.
* src/gm_utils.cpp (wrap_cstr): Call clear.
---
src/gm_utils.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/gm_utils.cpp
+++ b/src/gm_utils.cpp
@@ -311,7 +311,7 @@ void wrap_cstr(string& wrapped, unsigned
// trim leading spaces
std::size_t pos = next_word.find_first_not_of(' ');
if( pos == std::string::npos )
- next_word.empty();
+ next_word.clear();
else if( pos )
next_word.erase( 0, pos );

View File

@@ -0,0 +1,33 @@
From a3d0a0419a35bef9b80a6a12432ab30e2d1e0f5a Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Tue, 5 Mar 2024 22:27:42 +0100
Subject: [PATCH] gm_utils.h: Drop std::unary_function.
I am not sure what it does, it is deprecated/removed (depending on C++ version)
and the advice seems to be that is just is not necessary. So just remove it.
* src/gm_utils.h (print_f, pair_print_f): Drop std::unary_function.
---
src/gm_utils.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/src/gm_utils.h
+++ b/src/gm_utils.h
@@ -117,7 +117,7 @@ bool string_contains(const char *s, cons
* Function object to print something into a stream (to be used with for_each)
*/
template<class T>
-struct print_f : public std::unary_function<T, void>
+struct print_f
{
print_f(std::ostream& out, const string &s = ", ") : os(out), sep(s) {}
void operator() (T x) { os << x << sep; }
@@ -129,7 +129,7 @@ struct print_f : public std::unary_funct
* Function object to print a pair into two streams (to be used with for_each)
*/
template<class T>
-struct pair_print_f : public std::unary_function<T, void>
+struct pair_print_f
{
pair_print_f(std::ostream& out1, std::ostream& out2, const string &s = ", ") :
os1(out1), os2(out2), sep(s) {}

39
tools/gmp/Makefile Normal file
View File

@@ -0,0 +1,39 @@
#
# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=gmp
PKG_VERSION:=6.2.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gmp/
PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
PKG_CPE_ID:=cpe:/a:gmplib:gmp
HOST_FIXUP:=autoreconf
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
unexport CFLAGS
HOST_CONFIGURE_ARGS += \
--enable-static \
--disable-shared \
--disable-assembly \
--enable-cxx
ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32)
HOST_CONFIGURE_ARGS += ABI=x32
endif
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,19 @@
# HG changeset patch
# User Marc Glisse <marc.glisse@inria.fr>
# Date 1738186682 -3600
# Wed Jan 29 22:38:02 2025 +0100
# Node ID 8e7bb4ae7a18b1405ea7f9cbcda450b7d920a901
# Parent e84c5c785bbe8ed8c3620194e50b65adfc2f5d83
Complete function prototype in acinclude.m4 for C23 compatibility
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long
#if defined (__GNUC__) && ! defined (__cplusplus)
typedef unsigned long long t1;typedef t1*t2;
-void g(){}
+void g(int,t1 const*,t1,t2,t1 const*,int){}
void h(){}
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}

View File

@@ -0,0 +1,22 @@
# HG changeset patch
# User Marc Glisse <marc.glisse@inria.fr>
# Date 1743513946 -7200
# Tue Apr 01 15:25:46 2025 +0200
# Node ID d66d66d82dbbe4f561920d28c1e1cbe6818452c7
# Parent 1a2ad0e32507e842486c8ac9d5cdc772fd0c335e
Add parameter names to function prototype
2025-02-01 Marc Glisse <marc.glisse@inria.fr>
* longlong.h (loongarch64 umul_ppmm): __int128__ -> __int128.
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long
#if defined (__GNUC__) && ! defined (__cplusplus)
typedef unsigned long long t1;typedef t1*t2;
-void g(int,t1 const*,t1,t2,t1 const*,int){}
+void g(int a,t1 const*b,t1 c,t2 d,t1 const*e,int f){}
void h(){}
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}

27
tools/gnulib/Makefile Normal file
View File

@@ -0,0 +1,27 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gnulib
PKG_CPE_ID:=cpe:/a:gnu:$(PKG_NAME)
PKG_VERSION:=f9a4ee73c3e7b544f640d0d04b55983d3a7b894e# # master
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.savannah.gnu.org/cgit/$(PKG_NAME).git/snapshot
PKG_HASH:=514716d58987a9c0de0d69fb22d42bcd19edf80eed099882a004ff162060f1a8
include $(INCLUDE_DIR)/host-build.mk
define Host/Configure
endef
define Host/Install
$(INSTALL_DIR) $(1)/share/aclocal
$(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/*.m4 $(1)/share/aclocal/
$(INSTALL_DIR) $(1)/share/gnulib
$(CP) $(HOST_BUILD_DIR)/* $(1)/share/gnulib/
endef
define Host/Clean
rm -rf $(STAGING_DIR_HOST)/share/gnulib
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,54 @@
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -237,14 +237,14 @@ test -r "$conffile" && . "$conffile"
check_exists() {
if test "$1" = "--verbose"; then
- ($2 --version </dev/null) >/dev/null 2>&1
+ ($2 $3 $4 --version </dev/null) >/dev/null 2>&1
if test $? -ge 126; then
# If not found, run with diagnostics as one may be
# presented with env variables to set to find the right version
- ($2 --version </dev/null)
+ ($2 $3 $4 --version </dev/null)
fi
else
- ($1 --version </dev/null) >/dev/null 2>&1
+ ($@ --version </dev/null) >/dev/null 2>&1
fi
test $? -lt 126
@@ -309,7 +309,7 @@ p
q'
get_version() {
- app=$1
+ app="$@"
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
@@ -366,13 +366,13 @@ check_versions() {
if [ "$req_ver" = "-" ]; then
# Merely require app to exist; not all prereq apps are well-behaved
# so we have to rely on $? rather than get_version.
- if ! check_exists --verbose $app; then
+ if ! check_exists --verbose "$app"; then
warn_ "Error: '$app' not found"
ret=1
fi
else
# Require app to produce a new enough version string.
- inst_ver=$(get_version $app)
+ inst_ver=$(get_version "$app")
if [ ! "$inst_ver" ]; then
warn_ "Error: '$app' not found"
ret=1
@@ -1135,7 +1135,7 @@ autogen()
# two just-pre-run programs.
# Import from gettext.
- with_gettext=yes
+ with_gettext=no
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
with_gettext=no

29
tools/include/asm/types.h Normal file
View File

@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* asm-generic/int-ll64.h
*
* Integer declarations for architectures which use "long long"
* for 64-bit types.
*/
#ifndef _ASM_GENERIC_INT_LL64_H
#define _ASM_GENERIC_INT_LL64_H
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
#ifdef __GNUC__
__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
#else
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#endif
#endif /* _ASM_GENERIC_INT_LL64_H */

5
tools/include/byteswap.h Normal file
View File

@@ -0,0 +1,5 @@
#if defined(__linux__) || defined(__CYGWIN__)
#include_next <byteswap.h>
#else
#include <endian.h>
#endif

4327
tools/include/elf.h Normal file

File diff suppressed because it is too large Load Diff

40
tools/include/endian.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef __endian_compat_h
#define __endian_compat_h
#if defined(__linux__) || defined(__CYGWIN__)
#include <byteswap.h>
#include_next <endian.h>
#elif defined(__APPLE__)
#include <netinet/in.h>
#include <libkern/OSByteOrder.h>
#define bswap_16(x) OSSwapInt16(x)
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)
#elif defined(__FreeBSD__)
#include <sys/endian.h>
#define bswap_16(x) bswap16(x)
#define bswap_32(x) bswap32(x)
#define bswap_64(x) bswap64(x)
#elif defined(__OpenBSD__)
#include <sys/types.h>
#define bswap_16(x) __swap16(x)
#define bswap_32(x) __swap32(x)
#define bswap_64(x) __swap64(x)
#else
#include <machine/endian.h>
#define bswap_16(x) swap16(x)
#define bswap_32(x) swap32(x)
#define bswap_64(x) swap64(x)
#endif
#ifndef __BYTE_ORDER
#define __BYTE_ORDER BYTE_ORDER
#endif
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN BIG_ENDIAN
#endif
#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#endif
#endif

View File

@@ -0,0 +1,56 @@
/* Definitions of macros to access `dev_t' values.
Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef __SYS_SYSMACROS_H
#define __SYS_SYSMACROS_H 1
static inline unsigned int
__gnu_dev_major(unsigned long long int __dev)
{
return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}
static inline unsigned int
__gnu_dev_minor(unsigned long long int __dev)
{
return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}
static inline unsigned long long int
__gnu_dev_makedev(unsigned int __major, unsigned int __minor)
{
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
| (((unsigned long long int) (__minor & ~0xff)) << 12)
| (((unsigned long long int) (__major & ~0xfff)) << 32));
}
/* Access the functions with their traditional names. */
#ifndef major
# define major(dev) __gnu_dev_major (dev)
#endif
#ifndef minor
# define minor(dev) __gnu_dev_minor (dev)
#endif
#ifndef makedev
# define makedev(maj, min) __gnu_dev_makedev (maj, min)
#endif
#endif /* sys/sysmacros.h */

31
tools/isl/Makefile Normal file
View File

@@ -0,0 +1,31 @@
#
# Copyright (C) 2009-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=isl
PKG_VERSION:=0.26
PKG_SOURCE_URL:=https://libisl.sourceforge.io/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=a0b5cb06d24f9fa9e77b55fabbe9a3c94a336190345c2555f9915bb38e976504
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
unexport CFLAGS
HOST_CONFIGURE_ARGS += \
--enable-static \
--disable-shared \
--with-gmp-prefix=$(STAGING_DIR_HOST)
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,29 @@
#
# Copyright (C) 2016 adron@yapic.net
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=kernel2minor
PKG_VERSION:=0.25
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/adron-s/kernel2minor.git
PKG_MIRROR_HASH:=6083c46c2fe0da37bacd04d5d5439c0e2a9d00e58ff47a63acfd5057d2aa2145
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1e5a52c7941945f6d64807ebca4a5923ba5466bd
PKG_HASH:=33ca413403a3341af0c9a8e6d9bb58f4ad080a5339e8a8729b83637d35bfaf1b
include $(INCLUDE_DIR)/host-build.mk
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/kernel2minor $(STAGING_DIR_HOST)/bin/
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/kernel2minor
endef
$(eval $(call HostBuild))

38
tools/libdeflate/Makefile Normal file
View File

@@ -0,0 +1,38 @@
#
# Copyright (C) 2022 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=libdeflate
PKG_VERSION:=1.18
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/ebiggers/libdeflate.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_MIRROR_HASH:=015cbd33b1382b812f7c035640709186bc5d3d6a0ab177bffa7948f26f64edf9
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(HOSTCC_NOCACHE) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
$(HOST_BUILD_DIR)/lib/*{,/*}.c \
$(HOST_BUILD_DIR)/programs/{gzip,prog_util,tgetopt}.c \
-o $(HOST_BUILD_DIR)/libdeflate-gzip
endef
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/libdeflate-gzip $(STAGING_DIR_HOST)/bin/
$(LN) libdeflate-gzip $(STAGING_DIR_HOST)/bin/libdeflate-gunzip
endef
define Host/Uninstall
$(RM) $(STAGING_DIR_HOST)/bin/libdeflate-gzip
$(RM) $(STAGING_DIR_HOST)/bin/libdeflate-gunzip
$(call Host/Uninstall/Default)
endef
$(eval $(call HostBuild))

43
tools/liblzo/Makefile Normal file
View File

@@ -0,0 +1,43 @@
#
# Copyright (C) 2022 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=lzo
PKG_VERSION:=2.10
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/
PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:lzo_project:lzo
CMAKE_BINARY_SUBDIR:=openwrt-build
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_HOST_OPTIONS += \
-DENABLE_SHARED=ON \
-DENABLE_TESTS=OFF \
-DENABLE_EXAMPLES=OFF \
-DENABLE_DOCS=ON \
-DBUILD_TESTING=OFF
define Host/Uninstall
rm -rf $(HOST_BUILD_PREFIX)/include/lzo
rm -f $(HOST_BUILD_PREFIX)/lib/liblzo2.a
rm -f $(HOST_BUILD_PREFIX)/lib/liblzo2.so.2.0.0
rm -f $(HOST_BUILD_PREFIX)/lib/liblzo2.so.2
rm -f $(HOST_BUILD_PREFIX)/lib/liblzo2.so
rm -f $(HOST_BUILD_PREFIX)/lib/pkgconfig/lzo2.pc
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,68 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,8 +51,11 @@ endif()
project(lzo VERSION 2.10 LANGUAGES C)
# configuration options
-option(ENABLE_STATIC "Build static LZO library." ON)
-option(ENABLE_SHARED "Build shared LZO library." OFF)
+option(ENABLE_STATIC "Build static LZO library." ON)
+option(ENABLE_SHARED "Build shared LZO library." OFF)
+option(ENABLE_TESTS "Build tests." ON)
+option(ENABLE_EXAMPLES "Build examples." ON)
+option(ENABLE_DOCS "Install documentation." ON)
if(NOT ENABLE_STATIC AND NOT ENABLE_SHARED)
set(ENABLE_STATIC ON)
endif()
@@ -127,14 +130,20 @@ macro(lzo_add_executable t)
endif()
endmacro()
# main test driver
+if(ENABLE_TESTS OR ENABLE_EXAMPLES)
lzo_add_executable(lzotest lzotest/lzotest.c)
+endif()
# examples
+if(ENABLE_EXAMPLES)
lzo_add_executable(dict examples/dict.c)
lzo_add_executable(lzopack examples/lzopack.c)
lzo_add_executable(overlap examples/overlap.c)
lzo_add_executable(precomp examples/precomp.c)
lzo_add_executable(precomp2 examples/precomp2.c)
+endif()
+if(ENABLE_TESTS OR ENABLE_EXAMPLES)
lzo_add_executable(simple examples/simple.c)
+endif()
# some boring internal test programs
if(0)
lzo_add_executable(align tests/align.c)
@@ -144,7 +153,7 @@ if(0)
endif()
# miniLZO
-if(1)
+if(ENABLE_TESTS)
add_executable(testmini minilzo/testmini.c minilzo/minilzo.c)
target_include_directories(testmini PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include/lzo") # needed for "lzoconf.h"
endif()
@@ -263,8 +272,10 @@ add_test(NAME lzotest-03 COMMAND lzotest
if(DEFINED CMAKE_INSTALL_FULL_LIBDIR)
-set(f AUTHORS COPYING NEWS THANKS doc/LZO.FAQ doc/LZO.TXT doc/LZOAPI.TXT)
-install(FILES ${f} DESTINATION "${CMAKE_INSTALL_FULL_DOCDIR}")
+if(ENABLE_DOCS)
+ set(f AUTHORS COPYING NEWS THANKS doc/LZO.FAQ doc/LZO.TXT doc/LZOAPI.TXT)
+ install(FILES ${f} DESTINATION "${CMAKE_INSTALL_FULL_DOCDIR}")
+endif()
set(f include/lzo/lzo1.h include/lzo/lzo1a.h include/lzo/lzo1b.h
include/lzo/lzo1c.h include/lzo/lzo1f.h include/lzo/lzo1x.h
@@ -285,7 +296,7 @@ if(ENABLE_SHARED)
)
endif()
-if(1)
+if(ENABLE_EXAMPLES)
set(f lzopack lzotest simple testmini) # examples
install(TARGETS ${f} DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/lzo/examples")
endif()

40
tools/libressl/Makefile Normal file
View File

@@ -0,0 +1,40 @@
#
# Copyright (C) 2016-2017 LEDE project
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libressl
PKG_VERSION:=3.7.2
PKG_HASH:=b06aa538fefc9c6b33c4db4931a09a5f52d9d2357219afcbff7d93fe12ebf6f7
PKG_CPE_ID:=cpe:/a:openbsd:libressl
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://mirror.ox.ac.uk/pub/OpenBSD/LibreSSL \
http://ftp.jaist.ac.jp/pub/OpenBSD/LibreSSL \
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOSTCC := $(HOSTCC_NOCACHE)
HOST_CFLAGS += $(HOST_FPIC)
HOST_CONFIGURE_ARGS += \
--enable-static \
--disable-shared \
--disable-asm \
--with-pic \
--disable-tests
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
endef
$(eval $(call HostBuild))

60
tools/libtool/Makefile Normal file
View File

@@ -0,0 +1,60 @@
#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libtool
PKG_CPE_ID:=cpe:/a:gnu:libtool
PKG_VERSION:=2.4.7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
HOST_CONFIGURE_VARS += \
lt_cv_sys_dlsearch_path=""
define Host/Bootstrap
( \
cd $(HOST_BUILD_DIR); \
$(AM_TOOL_PATHS) \
./bootstrap \
--copy \
--force \
--skip-git \
--skip-po \
--gnulib-srcdir=$(GNULIB_SRCDIR) \
)
endef
define Host/Prepare
$(call Host/Prepare/Default)
$(call Host/Uninstall)
$(if $(QUILT),,$(call Host/Bootstrap))
endef
define Host/Configure
$(if $(QUILT),$(call Host/Bootstrap))
$(call Host/Configure/Default)
endef
define Host/Install
$(call Host/Compile/Default,install)
$(SED) 's,\(hardcode_into_libs\)=yes,\1=no,g' $(STAGING_DIR_HOST)/bin/libtool
endef
define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
(cd $(STAGING_DIR_HOST)/share/aclocal/ && rm -f libtool.m4 ltdl.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,118 @@
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -35,7 +35,7 @@ progpath="$0"
# The name of this program:
progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
+modename="OpenWrt-$progname-patched-1.5"
# Global variables:
EXIT_SUCCESS=0
@@ -297,8 +297,8 @@ func_infer_tag ()
# line option must be used.
if test -z "$tagname"; then
$echo "$modename: unable to infer tagged configuration"
- $echo "$modename: specify a tag with \`--tag'" 1>&2
- exit $EXIT_FAILURE
+ $echo "$modename: defaulting to \`CC'"
+ $echo "$modename: if this is not correct, specify a tag with \`--tag'"
# else
# $echo "$modename: using $tagname tagged configuration"
fi
@@ -2462,8 +2462,14 @@ EOF
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$libdir"
- absdir="$libdir"
+ # Adding 'libdir' from the .la file to our library search paths
+ # breaks crosscompilation horribly. We cheat here and don't add
+ # it, instead adding the path where we found the .la. -CL
+ dir="$lt_sysroot$abs_ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ #dir="$libdir"
+ #absdir="$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -2602,7 +2608,7 @@ EOF
{ test "$use_static_libs" = no || test -z "$old_library"; }; then
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
+ need_relink=no
fi
# This is a shared library
@@ -2804,7 +2810,6 @@ EOF
if test "$hardcode_direct" = yes; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
@@ -2820,8 +2825,6 @@ EOF
add="$libdir/$linklib"
fi
else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -5687,6 +5690,10 @@ fi\
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
+ # Replacing uninstalled with installed can easily break crosscompilation,
+ # since the installed path is generally the wrong architecture. -CL
+ newdependency_libs="$newdependency_libs $deplib"
+ continue
case $deplib in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
@@ -5999,8 +6006,12 @@ relink_command=\"$relink_command\""
dir="$dir$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ s_libdir=`$echo "X$libdir" | $Xsed -e 's%/$%%'`
+ s_destdir=`$echo "X$destdir" | $Xsed -e 's%/$%%'`
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+ inst_prefix_dir=`$echo "$s_destdir" | $SED "s%$s_libdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
@@ -6008,10 +6019,13 @@ relink_command=\"$relink_command\""
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
- if test "$inst_prefix_dir" = "$destdir"; then
- $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
- exit $EXIT_FAILURE
- fi
+ #
+ # This breaks install into our staging area. -PB
+ #
+ # if test "$inst_prefix_dir" = "$destdir"; then
+ # $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ # exit $EXIT_FAILURE
+ # fi
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
@@ -6020,6 +6034,9 @@ relink_command=\"$relink_command\""
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
fi
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
+
$echo "$modename: warning: relinking \`$file'" 1>&2
$show "$relink_command"
if $run eval "$relink_command"; then :

View File

@@ -0,0 +1,123 @@
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -243,7 +243,7 @@ opt_warning=:
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname${mode+: }$mode: $*"
+ $ECHO "OpenWrt-$progname-patched-2.2${mode+: }$mode: $*"
}
# func_verbose arg...
@@ -262,14 +262,14 @@ func_verbose ()
# Echo program name prefixed message to standard error.
func_error ()
{
- $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+ $ECHO "OpenWrt-$progname-patched-2.2${mode+: }$mode: "${1+"$@"} 1>&2
}
# func_warning arg...
# Echo program name prefixed warning message to standard error.
func_warning ()
{
- $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+ $opt_warning && $ECHO "OpenWrt-$progname-patched-2.2${mode+: }$mode: warning: "${1+"$@"} 1>&2
# bash bug again:
:
@@ -1048,8 +1048,8 @@ func_infer_tag ()
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
- func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
+ func_echo "defaulting to \`CC'"
+ func_echo "if this is not correct, specify a tag with \`--tag'"
# else
# func_verbose "using $tagname tagged configuration"
fi
@@ -2009,8 +2009,15 @@ func_mode_install ()
dir="$dir$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ s_libdir=$func_stripname_result
+
+ func_stripname '' '/' "$destdir"
+ s_destdir=$func_stripname_result
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$s_libdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
@@ -2018,8 +2025,11 @@ func_mode_install ()
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
- test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+ #
+ # This breaks install into our staging area. -PB
+ #
+ # test "$inst_prefix_dir" = "$destdir" && \
+ # func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
@@ -2028,6 +2038,9 @@ func_mode_install ()
relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
fi
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
+
func_warning "relinking \`$file'"
func_show_eval "$relink_command" \
'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
@@ -5412,8 +5425,12 @@ func_mode_link ()
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$libdir"
- absdir="$libdir"
+ # Adding 'libdir' from the .la file to our library search paths
+ # breaks crosscompilation horribly. We cheat here and don't add
+ # it, instead adding the path where we found the .la. -CL
+ dir="$abs_ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -5564,7 +5581,7 @@ func_mode_link ()
*)
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
+ need_relink=no
fi
;;
esac
@@ -5768,7 +5785,6 @@ func_mode_link ()
test "$hardcode_direct_absolute" = no; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
@@ -8052,6 +8068,10 @@ EOF
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
+ # Replacing uninstalled with installed can easily break crosscompilation,
+ # since the installed path is generally the wrong architecture. -CL
+ newdependency_libs="$newdependency_libs $deplib"
+ continue
case $deplib in
*.la)
func_basename "$deplib"

View File

@@ -0,0 +1,160 @@
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -443,7 +443,7 @@ opt_warning=:
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ $ECHO "OpenWrt-$progname-patched-2.4: ${opt_mode+$opt_mode: }$*"
}
# func_verbose arg...
@@ -469,14 +469,14 @@ func_echo_all ()
# Echo program name prefixed message to standard error.
func_error ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+ $ECHO "OpenWrt-$progname-patched-2.4: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
}
# func_warning arg...
# Echo program name prefixed warning message to standard error.
func_warning ()
{
- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+ $opt_warning && $ECHO "OpenWrt-$progname-patched-2.4: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
# bash bug again:
:
@@ -1416,8 +1416,8 @@ func_infer_tag ()
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
- func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
+ func_echo "defaulting to \`CC'"
+ func_echo "if this is not correct, specify a tag with \`--tag'"
# else
# func_verbose "using $tagname tagged configuration"
fi
@@ -2953,8 +2953,15 @@ func_mode_install ()
func_append dir "$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ s_libdir=$func_stripname_result
+
+ func_stripname '' '/' "$destdir"
+ s_destdir=$func_stripname_result
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "$s_destdir" | $SED -e "s%$s_libdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
@@ -2962,8 +2969,11 @@ func_mode_install ()
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
- test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+ #
+ # This breaks install into our staging area. -PB
+ #
+ # test "$inst_prefix_dir" = "$destdir" && \
+ # func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
@@ -2972,6 +2982,9 @@ func_mode_install ()
relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
+
func_warning "relinking \`$file'"
func_show_eval "$relink_command" \
'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
@@ -6504,8 +6517,12 @@ func_mode_link ()
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$lt_sysroot$libdir"
- absdir="$lt_sysroot$libdir"
+ # Adding 'libdir' from the .la file to our library search paths
+ # breaks crosscompilation horribly. We cheat here and don't add
+ # it, instead adding the path where we found the .la. -CL
+ dir="$lt_sysroot$abs_ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -6683,7 +6700,7 @@ func_mode_link ()
*)
if test "$installed" = no; then
func_append notinst_deplibs " $lib"
- need_relink=yes
+ need_relink=no
fi
;;
esac
@@ -6887,7 +6904,6 @@ func_mode_link ()
test "$hardcode_direct_absolute" = no; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
@@ -6903,8 +6919,6 @@ func_mode_link ()
add="$libdir/$linklib"
fi
else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -7059,7 +7073,17 @@ func_mode_link ()
fi
;;
*)
- path="-L$absdir/$objdir"
+ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
+ # preferring $objdir. RP 31/04/2008
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ path="-L$absdir/$objdir"
+ elif test -f "$absdir/$depdepl" ; then
+ depdepl="$absdir/$depdepl"
+ path="-L$absdir"
+ else
+ path="-L$absdir/$objdir"
+ fi
;;
esac
else
@@ -8050,7 +8074,7 @@ EOF
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) func_apped perm_rpath " $libdir" ;;
+ *) func_append perm_rpath " $libdir" ;;
esac
fi
done
@@ -9257,6 +9281,10 @@ EOF
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
+ # Replacing uninstalled with installed can easily break crosscompilation,
+ # since the installed path is generally the wrong architecture. -CL
+ newdependency_libs="$newdependency_libs $deplib"
+ continue
case $deplib in
*.la)
func_basename "$deplib"

View File

@@ -0,0 +1,104 @@
From ca10caa502f971f90d8c041aa2476de54ef0ce2b Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Tue, 20 Jul 2021 16:41:11 -0300
Subject: openwrt: make relocatable, search resources relative to STAGING_DIR
This was originally commited to openwrt by Jo-Philipp Wich
<jow@openwrt.org>.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/libtoolize.in
+++ b/libtoolize.in
@@ -38,14 +38,23 @@
# with bootstrap, so set those here where they can still be over-
# ridden by the user, but otherwise take precedence.
-: ${AUTOCONF="autoconf"}
-: ${AUTOMAKE="automake"}
-: ${EGREP="@EGREP@"}
-: ${FGREP="@FGREP@"}
-: ${GREP="@GREP@"}
: ${LN_S="@LN_S@"}
-: ${SED="@SED@"}
+if test -n "$STAGING_DIR_HOST"; then
+ : ${AUTOCONF="$STAGING_DIR_HOST/bin/autoconf"}
+ : ${AUTOMAKE="$STAGING_DIR_HOST/bin/automake"}
+ : ${EGREP="$STAGING_DIR_HOST/bin/grep -E"}
+ : ${FGREP="$STAGING_DIR_HOST/bin/grep -F"}
+ : ${GREP="$STAGING_DIR_HOST/bin/grep"}
+ : ${SED="$STAGING_DIR_HOST/bin/sed"}
+else
+ : ${AUTOCONF="autoconf"}
+ : ${AUTOMAKE="automake"}
+ : ${EGREP="@EGREP@"}
+ : ${FGREP="@FGREP@"}
+ : ${GREP="@GREP@"}
+ : ${SED="@SED@"}
+fi
## -------------------------- ##
## Source external libraries. ##
@@ -1903,11 +1912,21 @@ func_require_seen_libtool ()
pkgmacro_files="@pkgmacro_files@"
# Locations for important files:
- prefix="@prefix@"
- datadir="@datadir@"
- pkgauxdir="@pkgauxdir@"
- pkgltdldir="@pkgdatadir@"
- aclocaldir="@aclocaldir@"
+ if test -n "$STAGING_DIR_HOST"; then
+ prefix="$STAGING_DIR_HOST"
+ datadir="$STAGING_DIR_HOST/share"
+ pkgauxdir="$STAGING_DIR_HOST/share/libtool/build-aux"
+ pkgdatadir="$STAGING_DIR_HOST/share/libtool"
+ pkgltdldir="$STAGING_DIR_HOST/share/libtool"
+ aclocaldir="$STAGING_DIR_HOST/share/aclocal"
+ else
+ prefix="@prefix@"
+ datadir="@datadir@"
+ pkgauxdir="@pkgauxdir@"
+ pkgdatadir="@pkgdatadir@"
+ pkgltdldir="@pkgdatadir@"
+ aclocaldir="@aclocaldir@"
+ fi
# Allow the user to override the master libtoolize repository:
if test -n "$_lt_pkgdatadir"; then
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -933,7 +933,7 @@ m4_defun([_LT_TAG_COMPILER],
[AC_REQUIRE([AC_PROG_CC])dnl
_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], ["-O2 -I\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/include"], [LTCC compiler flags])dnl
_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
@@ -8183,9 +8183,9 @@ m4_defun([_LT_DECL_EGREP],
[AC_REQUIRE([AC_PROG_EGREP])dnl
AC_REQUIRE([AC_PROG_FGREP])dnl
test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
+_LT_DECL([], [GREP], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/grep"], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/grep -E"], [An ERE matcher])
+_LT_DECL([], [FGREP], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/grep -F"], [A literal string matcher])
dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
AC_SUBST([GREP])
])
@@ -8226,9 +8226,8 @@ _LT_DECL([], [FILECMD], [1], [A file(cmd
# as few characters as possible. Prefer GNU sed if found.
m4_defun([_LT_DECL_SED],
[AC_PROG_SED
-test -z "$SED" && SED=sed
Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [SED], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/sed"], [A sed program that does not truncate output])
_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
[Sed that helps us avoid accidentally triggering echo(1) options like -n])
])# _LT_DECL_SED

View File

@@ -0,0 +1,66 @@
From 67ffe8e8582a7ba1f1d1307a419098e6dd88bdaf Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Tue, 20 Jul 2021 16:41:11 -0300
Subject: openwrt: cross-compilation path adjustments
Comments from the patch:
Adding 'libdir' from the .la file to our library search paths
breaks crosscompilation horribly. We cheat here and don't add
it, instead adding the path where we found the .la. -CL
OE sets installed=no in staging. We need to look in $objdir and $absdir,
preferring $objdir. RP 31/04/2008
This was originally commited to openwrt by Jo-Philipp Wich
<jow@openwrt.org>.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -6097,8 +6097,14 @@ func_mode_link ()
absdir=$abs_ladir
libdir=$abs_ladir
else
- dir=$lt_sysroot$libdir
- absdir=$lt_sysroot$libdir
+ # Adding 'libdir' from the .la file to our library search paths
+ # breaks crosscompilation horribly. We cheat here and don't add
+ # it, instead adding the path where we found the .la. -CL
+ dir="$lt_sysroot$abs_ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ #dir=$lt_sysroot$libdir
+ #absdir=$lt_sysroot$libdir
fi
test yes = "$hardcode_automatic" && avoidtemprpath=yes
else
@@ -6496,8 +6502,6 @@ func_mode_link ()
add=$libdir/$linklib
fi
else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir=-L$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -6652,7 +6656,17 @@ func_mode_link ()
fi
;;
*)
- path=-L$absdir/$objdir
+ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
+ # preferring $objdir. RP 31/04/2008
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ path="-L$absdir/$objdir"
+ elif test -f "$absdir/$depdepl" ; then
+ depdepl="$absdir/$depdepl"
+ path="-L$absdir"
+ else
+ path="-L$absdir/$objdir"
+ fi
;;
esac
else

View File

@@ -0,0 +1,32 @@
From 375833af93999f8b0a747c8a1dfa3ec8d347743d Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Tue, 20 Jul 2021 16:52:37 -0300
Subject: openwrt: don't use target dir for relinking
This was originally commited to openwrt by Jo-Philipp Wich
<jow@openwrt.org>.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -6482,13 +6482,13 @@ func_mode_link ()
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
- if test yes = "$hardcode_direct" &&
- test no = "$hardcode_direct_absolute"; then
- add=$libdir/$linklib
- elif test yes = "$hardcode_minus_L"; then
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
add_dir=-L$libdir
- add=-l$name
- elif test yes = "$hardcode_shlibpath_var"; then
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) func_append finalize_shlibpath "$libdir:" ;;

View File

@@ -0,0 +1,25 @@
From 7f2b8a1ab4fa1475eeeddfb84eb5b92594bfce43 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Tue, 20 Jul 2021 16:54:12 -0300
Subject: openwrt: strip unsave directories from relink command
strip unsave directories from relink command, nuke every -L that looks
like /usr/lib or /lib
This was originally commited to openwrt by Jo-Philipp Wich
<jow@openwrt.org>.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -2400,6 +2400,9 @@ func_mode_install ()
relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
+
func_warning "relinking '$file'"
func_show_eval "$relink_command" \
'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'

View File

@@ -0,0 +1,37 @@
From 1b45c3c0d6682be7f4876b620780ee246a5acbaa Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Tue, 20 Jul 2021 16:56:16 -0300
Subject: openwrt: remove trailing slash in install destdir
A command like /bin/sh ../../i586-poky-linux-libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/media/data1/builds/poky1/tmp/work/core2-poky-linux/gnome-keyring-2.26.1-r1/image/usr/lib/gnome-keyring/standalone/' fails (e.g. gnome-keyring or pulseaudio)
This is because libdir has a trailing slash which breaks the comparision.
RP 2/1/10
Merged a patch received from Gary Thomas <gary@mlbassoc.com>
Date: 2010/07/12
Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -2381,8 +2381,15 @@ func_mode_install ()
func_append dir "$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ destlibdir=$func_stripname_result
+
+ func_stripname '' '/' "$destdir"
+ s_destdir=$func_stripname_result
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that

View File

@@ -0,0 +1,72 @@
From 879578d3f4dc9bc42aa433b1fb6b584564f83617 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Wed, 21 Jul 2021 13:38:24 -0300
Subject: openwrt: don't quote $(SHELL) in Makefile.am
This allows to use SHELL="env bash" to get a controlled enviroment.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ EXTRA_LTLIBRARIES =
# Using 'cd' in backquotes may print the directory name, use this instead:
lt__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-git_version_gen = '$(SHELL)' '$(aux_dir)/git-version-gen' '--fallback' '$(VERSION)' '.tarball-version'
+git_version_gen = $(SHELL) '$(aux_dir)/git-version-gen' '--fallback' '$(VERSION)' '.tarball-version'
rebuild = rebuild=:; revision=`$(lt__cd) $(srcdir) && $(git_version_gen) | $(SED) 's|-.*$$||'`
@@ -306,7 +306,7 @@ libtool: $(ltmain_sh) $(config_status) $
if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \
then echo " GEN " $@; \
else echo '$(SHELL) $(top_builddir)/config.status "$@"'; fi; \
- cd '$(top_builddir)' && '$(SHELL)' ./config.status '$@'; \
+ cd '$(top_builddir)' && $(SHELL) ./config.status '$@'; \
fi
@@ -789,13 +789,13 @@ testsuite_deps_uninstalled = $(testsuite
# Hook the test suite into the check rule
check-local: $(testsuite_deps_uninstalled)
$(AM_V_at)$(CD_TESTDIR); \
- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \
$(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) $(TESTSUITEFLAGS)
# Run the test suite on the *installed* tree.
installcheck-local: $(testsuite_deps)
$(AM_V_at)$(CD_TESTDIR); \
- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \
$(TESTS_ENVIRONMENT) $(INSTALLCHECK_ENVIRONMENT) $(TESTSUITEFLAGS) \
AUTOTEST_PATH='$(exec_prefix)/bin'
@@ -807,7 +807,7 @@ check-noninteractive-old:
.PHONY: check-noninteractive-new
check-noninteractive-new: $(testsuite_deps_uninstalled)
$(AM_V_at)$(CD_TESTDIR); \
- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \
$(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \
-k '!interactive' INNER_TESTSUITEFLAGS=',!interactive' \
$(TESTSUITEFLAGS)
@@ -816,7 +816,7 @@ check-noninteractive-new: $(testsuite_de
.PHONY: check-interactive
check-interactive: $(testsuite_deps_uninstalled)
$(AM_V_at)$(CD_TESTDIR); \
- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \
$(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \
-k interactive -k recursive INNER_TESTSUITEFLAGS=',interactive' \
$(TESTSUITEFLAGS)
@@ -828,7 +828,7 @@ check-noninteractive: check-noninteracti
clean-local:
-$(CD_TESTDIR); \
test -f "$$abs_srcdir/$(TESTSUITE)" && \
- '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" --clean
+ $(SHELL) "$$abs_srcdir/$(TESTSUITE)" --clean
## An empty target to depend on when a rule needs to always run
## whenever it is visited.

View File

@@ -0,0 +1,34 @@
From 90707200efadc8e230635c7c204c9c272cbc8631 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Tue, 20 Jul 2021 17:01:03 -0300
Subject: openwrt: add openwrt branding
This prepends program name with "OpenWrt-".
This was originally commited to openwrt by Jo-Philipp Wich
<jow@openwrt.org>.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -82,7 +82,7 @@ func_echo ()
IFS=$nl
for _G_line in $_G_message; do
IFS=$func_echo_IFS
- $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+ $ECHO "OpenWrt-$progname${opt_mode+: $opt_mode}: $_G_line"
done
IFS=$func_echo_IFS
}
--- a/build-aux/funclib.sh
+++ b/build-aux/funclib.sh
@@ -699,7 +699,7 @@ func_echo ()
IFS=$nl
for _G_line in $_G_message; do
IFS=$func_echo_IFS
- $ECHO "$progname: $_G_line"
+ $ECHO "OpenWrt-$progname: $_G_line"
done
IFS=$func_echo_IFS
}

Some files were not shown because too many files have changed in this diff Show More