Initial commit

This commit is contained in:
domenico
2025-06-24 13:14:22 +02:00
commit 4002f145fc
9002 changed files with 1731834 additions and 0 deletions

157
tools/Makefile Normal file
View File

@@ -0,0 +1,157 @@
#
# 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_PACKAGE_b43legacy-firmware)$(CONFIG_BRCMSMAC_USE_FW_FROM_WL),)
BUILD_B43_TOOLS = y
endif
tools-y += autoconf autoconf-archive automake bc bison cmake cpio dosfstools
tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt
tools-y += libressl libtool lzma m4 make-ext4fs meson missing-macros mkimage
tools-y += mklibs mtd-utils mtools ninja padjffs2 patch-image
tools-y += patchelf pkgconf quilt squashfskit4 sstrip xxd zip zlib zstd
tools-$(BUILD_B43_TOOLS) += b43-tools
tools-$(BUILD_ISL) += isl
tools-$(BUILD_TOOLCHAIN) += expat gmp mpc mpfr
tools-$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini) += genext2fs
tools-$(CONFIG_TARGET_ath79) += lzma-old squashfs
tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
tools-$(CONFIG_TARGET_tegra) += cbootimage cbootimage-configs
tools-$(CONFIG_USES_MINOR) += kernel2minor
tools-$(CONFIG_USE_SPARSE) += sparse
# builddir dependencies
$(curdir)/autoconf/compile := $(curdir)/m4/compile
$(curdir)/automake/compile := $(curdir)/m4/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)/cbootimage/compile += $(curdir)/automake/compile
$(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile
$(curdir)/dosfstools/compile := $(curdir)/autoconf/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)/libressl/compile $(curdir)/zlib/compile
$(curdir)/flex/compile := $(curdir)/libtool/compile
$(curdir)/gengetopt/compile := $(curdir)/libtool/compile
$(curdir)/gmp/compile := $(curdir)/libtool/compile
$(curdir)/isl/compile := $(curdir)/gmp/compile
$(curdir)/libressl/compile := $(curdir)/pkgconf/compile
$(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile
$(curdir)/lzma-old/compile := $(curdir)/zlib/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)/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)/squashfs/compile := $(curdir)/lzma-old/compile
$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
$(curdir)/zlib/compile := $(curdir)/cmake/compile
$(curdir)/zstd/compile := $(curdir)/cmake/compile
ifneq ($(HOST_OS),Linux)
$(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
tools-y += coreutils
endif
ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
$(foreach tool, $(filter-out xz zstd pkgconf patch ninja meson libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile))
tools-y += ccache
$(curdir)/ccache/compile := $(curdir)/zstd/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 tar, xz and patch to ensure that archives can be unpacked and patched properly
tools-core := tar xz patch
$(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
# 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
$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared
# 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,28 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf-archive
PKG_VERSION:=2021.02.19
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/autoconf-archive
PKG_HASH:=e8a6eb9d28ddcba8ffef3fa211653239e9bf239aba6a01a6b7cfc7ceaec69cbd
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
--datarootdir=$(STAGING_DIR_HOST)/share
define Host/Compile
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Clean
-export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))

37
tools/autoconf/Makefile Normal file
View File

@@ -0,0 +1,37 @@
#
# 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.69
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/autoconf
PKG_HASH:=64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
--datarootdir=$(STAGING_DIR_HOST)/share
HOST_CONFIGURE_VARS += \
PERL="/usr/bin/env perl"
define Host/Compile
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install
export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Clean
-export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,229 @@
--- a/bin/autoheader.in
+++ b/bin/autoheader.in
@@ -28,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
unshift @INC, "$pkgdatadir";
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -50,7 +51,7 @@ use strict;
use vars qw ($config_h %verbatim %symbol);
# Lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
local $config_h;
my $config_h_in;
my @prepend_include;
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -1,10 +1,12 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+$^W = 1;
+
# autom4te - Wrapper around M4 libraries.
# Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
@@ -24,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -44,7 +47,8 @@ use File::Basename;
use strict;
# Data directory.
-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
+my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
# $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
my %language;
@@ -87,7 +91,7 @@ my @include;
my $freeze = 0;
# $M4.
-my $m4 = $ENV{"M4"} || '@M4@';
+my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $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";
@@ -269,6 +273,12 @@ sub load_configuration ($)
my @words = shellwords ($_);
my $type = shift @words;
+
+ if ($ENV{'STAGING_DIR'})
+ {
+ @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
@@ -1,10 +1,12 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+$^W = 1;
+
# autoreconf - install the GNU Build System in a directory tree
# Copyright (C) 1994, 1999-2012 Free Software Foundation, Inc.
@@ -26,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -106,9 +109,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'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
+my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $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
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -23,9 +23,12 @@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -91,10 +94,10 @@ my $configure_scan = 'configure.scan';
my $log;
# Autoconf and lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $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'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
# $help
# -----
--- a/bin/autoupdate.in
+++ b/bin/autoupdate.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -24,9 +24,12 @@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+$^W = 1;
+
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
@@ -50,10 +53,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'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
my $force = 0;
# m4.
-my $m4 = $ENV{"M4"} || '@M4@';
+my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
# $HELP
--- a/bin/ifnames.in
+++ b/bin/ifnames.in
@@ -1,10 +1,12 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+$^W = 1;
+
# ifnames - print the identifiers used in C preprocessor conditionals
# Copyright (C) 1994-1995, 1999-2003, 2005-2012 Free Software
@@ -31,7 +33,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
BEGIN
{
- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+ ($ENV{'STAGING_DIR'} ? $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
@@ -84,7 +84,11 @@ exit_missing_arg='
# restore font-lock: '
# Variables.
-: ${AUTOM4TE='@bindir@/@autom4te-name@'}
+if test -n "$STAGING_DIR"; then
+ : ${AUTOM4TE="$STAGING_DIR/../host/bin/@autom4te-name@"}
+else
+ : ${AUTOM4TE='@bindir@/@autom4te-name@'}
+fi
autom4te_options=
outfile=
verbose=false

View File

@@ -0,0 +1,22 @@
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
nodist_pkgdata_DATA = autom4te.cfg
EXTRA_DIST = autom4te.in freeze.mk
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -225,7 +225,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
nodist_pkgdata_DATA = autom4te.cfg
EXTRA_DIST = autom4te.in freeze.mk
edit = sed \

View File

@@ -0,0 +1,24 @@
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -122,9 +122,9 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-musl* | \
+ linux-newlib* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
@@ -1360,7 +1360,7 @@ case $os in
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-uclibc* \
+ | -linux-musl* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \

51
tools/automake/Makefile Normal file
View File

@@ -0,0 +1,51 @@
#
# 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.15.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/automake
PKG_HASH:=af6ba39142220687c500f79b4aa2f181d9b24e4f8d8ec497cea4ba26c64bedaf
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
--datarootdir=$(STAGING_DIR_HOST)/share \
--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="" ./bootstrap)
$(call Host/Configure/Default)
endef
define Host/Install
# remove old automake resources to avoid version conflicts
rm -rf $(STAGING_DIR_HOST)/share/aclocal-[0-9]*
rm -rf $(STAGING_DIR_HOST)/share/automake-[0-9]*
$(MAKE) -C $(HOST_BUILD_DIR) install
mv $(STAGING_DIR_HOST)/bin/aclocal $(STAGING_DIR_HOST)/bin/aclocal.real
$(INSTALL_BIN) ./files/aclocal $(STAGING_DIR_HOST)/bin
ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.9
ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.10
ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11
ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11.6
ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.15
endef
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))

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

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

View File

@@ -0,0 +1,96 @@
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -32,7 +32,7 @@ our $PACKAGE = '@PACKAGE@';
our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
our $VERSION = '@VERSION@';
our $RELEASE_YEAR = '@RELEASE_YEAR@';
-our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
+our $libdir = $ENV{'STAGING_DIR'} ? $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
@@ -1,10 +1,12 @@
-#!@PERL@ -w
+#!@PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+$^W = 1;
+
# aclocal - create aclocal.m4 by scanning configure.ac
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
@@ -27,7 +29,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
BEGIN
{
- @Aclocal::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+ @Aclocal::perl_libdirs = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@')
unless @Aclocal::perl_libdirs;
unshift @INC, @Aclocal::perl_libdirs;
}
@@ -69,8 +71,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'} ? $ENV{'STAGING_DIR'} . "/../host/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
+my @system_includes = ($ENV{'STAGING_DIR'} ? $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
@@ -1,10 +1,12 @@
-#!@PERL@ -w
+#!@PERL@
# -*- perl -*-
# @configure_input@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+$^W = 1;
+
# automake - create Makefile.in from Makefile.am
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
@@ -31,7 +33,7 @@ use strict;
BEGIN
{
- @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+ @Automake::perl_libdirs = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@')
unless @Automake::perl_libdirs;
unshift @INC, @Automake::perl_libdirs;
--- a/t/wrap/aclocal.in
+++ b/t/wrap/aclocal.in
@@ -1,6 +1,8 @@
-#!@PERL@ -w
+#!@PERL@
# @configure_input@
+$^W = 1;
+
# Copyright (C) 2012-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
--- a/t/wrap/automake.in
+++ b/t/wrap/automake.in
@@ -1,6 +1,8 @@
-#!@PERL@ -w
+#!@PERL@
# @configure_input@
+$^W = 1;
+
# Copyright (C) 2012-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify

View File

@@ -0,0 +1,15 @@
--- a/bin/aclocal.in
+++ b/bin/aclocal.in
@@ -356,6 +356,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?

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

@@ -0,0 +1,50 @@
#
# 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:=2017-09-13
PKG_SOURCE_URL:=https://github.com/mbuesch/b43-tools.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE_VERSION:=27892ef741e7f1d08cb939744f8b8f5dac7b04ae
PKG_MIRROR_HASH:=f914c36ac566e9e3b5a3a04de16ddb014fcad6a1cf25cdd8e4825c708d28d3f4
HOST_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME)
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" \
$(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;

23
tools/bc/Makefile Normal file
View File

@@ -0,0 +1,23 @@
#
# 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:=bc
PKG_VERSION:=1.06.95
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://alpha.gnu.org/gnu/bc \
http://gnualpha.uib.no/bc/ \
http://mirrors.fe.up.pt/pub/gnu-alpha/bc/ \
http://www.nic.funet.fi/pub/gnu/alpha/gnu/bc/
PKG_HASH:=7ee4abbcfac03d8a6e1a8a3440558a3d239d6b858585063e745c760957725ecc
PKG_FIXUP := autoreconf
include $(INCLUDE_DIR)/host-build.mk
$(eval $(call HostBuild))

View File

@@ -0,0 +1,23 @@
diff -urN bc-1.06.95/Makefile.am bc-1.06.95.new/Makefile.am
--- bc-1.06.95/Makefile.am 2005-05-27 01:05:41.000000000 +0100
+++ bc-1.06.95.new/Makefile.am 2013-07-09 09:33:31.521490710 +0100
@@ -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
diff -urN bc-1.06.95/Makefile.in bc-1.06.95.new/Makefile.in
--- bc-1.06.95/Makefile.in 2006-09-05 03:39:30.000000000 +0100
+++ bc-1.06.95.new/Makefile.in 2013-07-09 09:33:28.565490767 +0100
@@ -149,7 +149,7 @@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-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

32
tools/bison/Makefile Normal file
View File

@@ -0,0 +1,32 @@
#
# 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
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += --enable-threads=posix --disable-nls
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
endef
define Host/Install
$(call Host/Install/Default)
$(INSTALL_BIN) ./scripts/yacc $(STAGING_DIR_HOST)/bin/yacc
endef
$(eval $(call HostBuild))

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

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

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))

41
tools/ccache/Makefile Normal file
View File

@@ -0,0 +1,41 @@
#
# 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
include $(INCLUDE_DIR)/target.mk
PKG_NAME:=ccache
PKG_VERSION:=4.4.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION)
PKG_HASH:=9200cafbaa5fd62c2600fccb40a18214e57747825e6cdcd76688b4b61c2dcba0
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" \
-DREDIS_STORAGE_BACKEND=OFF
ifneq (docs-$(CONFIG_BUILD_DOCUMENTATION),docs-y)
CMAKE_HOST_OPTIONS += -DENABLE_DOCUMENTATION=OFF
endif
define Host/Install/ccache
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
$(CP) ./files/* $(STAGING_DIR_HOST)/bin/
endef
define Host/Install
$(call Host/Install/Default)
$(call Host/Install/ccache)
endef
$(eval $(call HostBuild))

2
tools/ccache/files/ccache_cc Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec ccache "${TARGET_CC_NOCACHE}" "$@"

2
tools/ccache/files/ccache_cxx Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec ccache "${TARGET_CXX_NOCACHE}" "$@"

View File

@@ -0,0 +1,10 @@
--- a/src/ccache.cpp
+++ b/src/ccache.cpp
@@ -1633,6 +1633,7 @@ calculate_result_and_manifest_key(Contex
"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);

51
tools/cmake/Makefile Normal file
View File

@@ -0,0 +1,51 @@
#
# 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.21.3
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/v3.19/
PKG_HASH:=d14d06df4265134ee42c4d50f5a60cb8b471b7b6a47da8e5d914d49dd783794f
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)"
HOST_CONFIGURE_ARGS := \
$(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
--prefix="$(STAGING_DIR_HOST)" \
--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,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
@@ -528,6 +528,14 @@ if(CMAKE_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
@@ -1420,7 +1420,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

37
tools/coreutils/Makefile Normal file
View File

@@ -0,0 +1,37 @@
#
# 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:=8.32
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/coreutils
PKG_HASH:=4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa
HOST_BUILD_PARALLEL := 1
BUILD_PROGRAMS = date readlink touch ln
include $(INCLUDE_DIR)/host-build.mk
BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS))
HOST_CONFIGURE_ARGS += \
--enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS)))
HOST_MAKE_FLAGS += \
PROGRAMS="$(BUILD_BINS)" \
LIBRARIES= MANS= SUBDIRS=.
define Host/Install
$(INSTALL_DIR) $(1)/bin
$(CP) $(patsubst %,$(HOST_BUILD_DIR)/%,$(BUILD_BINS)) $(1)/bin/
endef
$(eval $(call HostBuild))

14
tools/cpio/Makefile Normal file
View File

@@ -0,0 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=cpio
PKG_CPE_ID:=cpe:/a:gnu:cpio
PKG_VERSION:=2.13
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@GNU/cpio
PKG_HASH:=eab5bdc5ae1df285c59f2a4f140a98fc33678a0bf61bdba67d9436ae26b46f6d
include $(INCLUDE_DIR)/host-build.mk
$(eval $(call HostBuild))

View File

@@ -0,0 +1,20 @@
author Sergey Poznyakoff <gray@gnu.org>
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=641d3f489cf6238bb916368d4ba0d9325a235afb
* src/global.c: Remove superfluous declaration of program_name
diff --git a/src/global.c b/src/global.c
index fb3abe9..acf92bc 100644
--- a/src/global.c
+++ b/src/global.c
@@ -184,9 +184,6 @@ unsigned int warn_option = 0;
/* Extract to standard output? */
bool to_stdout_option = false;
-/* The name this program was run with. */
-char *program_name;
-
/* A pointer to either lstat or stat, depending on whether
dereferencing of symlinks is done for input files. */
int (*xstat) ();

27
tools/dosfstools/Makefile Normal file
View File

@@ -0,0 +1,27 @@
#
# 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.xz
PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
http://fossies.org/linux/misc
PKG_HASH:=ba7c716ff9b8208a3bba5094a77584a7dc814141de09ab4ce1ae9b84bbcd7844
HOST_FIXUP:=autoreconf
include $(INCLUDE_DIR)/host-build.mk
ifeq ($(HOST_OS),Darwin)
HOST_CFLAGS += -UHAVE_ENDIAN_H
endif
$(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.46.4
PKG_HASH:=b11042533c1b1dcf17512f0da48e05b0c573dada1dd8b762864d10f4dc399713
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
@@ -74,7 +74,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
@@ -12538,7 +12538,7 @@ $as_echo_n "checking for system crontab
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
$as_echo "${crond_dir}" >&6; }
- have_crond="yes"
+ have_crond="no"; with_crond_dir=""
else

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 @@
--- elftosb-10.12.01/makefile.rules 2012-03-15 11:01:44.979020178 -0400
+++ elftosb-10.12.01/makefile.rules 2012-03-15 11:01:16.332761989 -0400
@@ -101,7 +101,7 @@
keygen.o
-LIBS = -lstdc++
+LIBS = -lstdc++ -lm
ifeq ("${UNAMES}", "Linux")

View File

@@ -0,0 +1,19 @@
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.
diff -Naurp elftosb-10.12.01-orig/common/stdafx.h elftosb-10.12.01/common/stdafx.h
--- elftosb-10.12.01-orig/common/stdafx.h 2012-07-12 13:30:10.990249396 -0400
+++ elftosb-10.12.01/common/stdafx.h 2012-07-12 13:30:06.858249391 -0400
@@ -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")

29
tools/expat/Makefile Normal file
View File

@@ -0,0 +1,29 @@
#
# 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.2.10
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_HASH:=b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5
PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION))
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += \
--without-docbook
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef
$(eval $(call HostBuild))

28
tools/fakeroot/Makefile Normal file
View File

@@ -0,0 +1,28 @@
#
# 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.26
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot
PKG_HASH:=480a578ffdc5592e73df4c086950d321b4adc78dbdaec56c82e4fe1fb68de8e9
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
$(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,11 @@
--- a/libfakeroot_inode64.c
+++ b/libfakeroot_inode64.c
@@ -36,6 +36,8 @@
#include <fts.h>
#endif /* HAVE_FTS_H */
+void load_library_symbols(void);
+
#include "wrapped.h"
#include "wraptmpf.h"
#include "wrapdef.h"

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
@@ -81,12 +81,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
@@ -131,8 +133,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

31
tools/findutils/Makefile Normal file
View File

@@ -0,0 +1,31 @@
#
# 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.8.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=57127b7e97d91282c6ace556378d5455a9509898297e46e10443016ea1387164
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
$(eval $(call HostBuild))

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:=13
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
PKG_SOURCE_DATE:=2021-10-05
PKG_SOURCE_VERSION:=f9ad6b335e0fd699398370d4c6e2e45e1c459dea
PKG_MIRROR_HASH:=a1a5c22e8a05b4521e7f6ec20cfa443e9f33a9c07e30718e2f328ee99cebf6cf
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
$(eval $(call HostBuild))

34
tools/flex/Makefile Normal file
View File

@@ -0,0 +1,34 @@
#
# 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:flex_project: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/Install
$(call Host/Install/Default)
$(LN) flex $(STAGING_DIR_HOST)/bin/lex
endef
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,13 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,10 +43,7 @@ EXTRA_DIST = \
SUBDIRS = \
src \
- doc \
- examples \
po \
- tests \
tools
# Create the ChangeLog, but only if we're inside a git working directory

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])

27
tools/flock/Makefile Normal file
View File

@@ -0,0 +1,27 @@
#
# 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
$(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;
}

51
tools/genext2fs/Makefile Normal file
View File

@@ -0,0 +1,51 @@
#
# 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.4.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/genext2fs
PKG_HASH:=404dbbfa7a86a6c3de8225c8da254d026b17fd288e05cec4df2cc7e1f4feecfc
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/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))

View File

@@ -0,0 +1,21 @@
commit 3b8ca0ce9a0b58287a780747c90c449bdebfe464
Author: Xavier Bestel <bestouff@users.sourceforge.net>
Date: Mon Jan 14 08:52:44 2008 +0000
removed use of %as is scanf (GNU conflicts with C99) by Giacomo Catenazzi <cate@debian.org>
diff --git a/genext2fs.c b/genext2fs.c
index 070b270..f0d797d 100644
--- a/genext2fs.c
+++ b/genext2fs.c
@@ -286,7 +286,9 @@ typedef unsigned int uint32;
// older solaris. Note that this is still not very portable, in that
// the return value cannot be trusted.
-#if SCANF_CAN_MALLOC
+#if 0 // SCANF_CAN_MALLOC
+// C99 define "a" for floating point, so you can have runtime surprise
+// according the library versions
# define SCANF_PREFIX "a"
# define SCANF_STRING(s) (&s)
#else

View File

@@ -0,0 +1,13 @@
Index: genext2fs/m4/ac_func_scanf_can_malloc.m4
===================================================================
--- genext2fs.orig/m4/ac_func_scanf_can_malloc.m4 2011-09-03 21:28:49.000000000 +0200
+++ genext2fs/m4/ac_func_scanf_can_malloc.m4 2011-09-03 21:29:41.000000000 +0200
@@ -9,7 +9,7 @@
# --------------------------------------
AC_DEFUN([AC_FUNC_SCANF_CAN_MALLOC],
[ AC_CHECK_HEADERS([stdlib.h])
- AC_CACHE_CHECK([whether scanf can malloc], [ac_scanf_can_malloc],
+ AC_CACHE_CHECK([whether scanf can malloc], [ac_cv_func_scanf_can_malloc],
[ AC_RUN_IFELSE(
[ AC_LANG_PROGRAM(
[

View File

@@ -0,0 +1,558 @@
Index: genext2fs/genext2fs.c
===================================================================
--- genext2fs.orig/genext2fs.c 2011-09-03 14:21:17.000000000 +0200
+++ genext2fs/genext2fs.c 2011-09-03 14:21:17.000000000 +0200
@@ -151,13 +151,24 @@
// block size
-#define BLOCKSIZE 1024
+static int blocksize = 1024;
+
+#define BLOCKSIZE blocksize
#define BLOCKS_PER_GROUP 8192
#define INODES_PER_GROUP 8192
/* Percentage of blocks that are reserved.*/
#define RESERVED_BLOCKS 5/100
#define MAX_RESERVED_BLOCKS 25/100
+/* The default value for s_creator_os. */
+#if defined(__GNU__)
+# define CREATOR_OS 1 /* Hurd */
+#elif defined(__FreeBSD__)
+# define CREATOR_OS 3 /* FreeBSD */
+#else
+# define CREATOR_OS 0 /* Linux */
+#endif
+
// inode block size (why is it != BLOCKSIZE ?!?)
/* The field i_blocks in the ext2 inode stores the number of data blocks
@@ -239,10 +250,10 @@
(fs)->sb.s_blocks_per_group - 1) / (fs)->sb.s_blocks_per_group)
// Get group block bitmap (bbm) given the group number
-#define GRP_GET_GROUP_BBM(fs,grp) ( get_blk((fs),(fs)->gd[(grp)].bg_block_bitmap) )
+#define GRP_GET_GROUP_BBM(fs,grp) ( get_blk((fs), get_gd((fs),(grp))->bg_block_bitmap) )
// Get group inode bitmap (ibm) given the group number
-#define GRP_GET_GROUP_IBM(fs,grp) ( get_blk((fs),(fs)->gd[(grp)].bg_inode_bitmap) )
+#define GRP_GET_GROUP_IBM(fs,grp) ( get_blk((fs), get_gd((fs),(grp))->bg_inode_bitmap) )
// Given an inode number find the group it belongs to
#define GRP_GROUP_OF_INODE(fs,nod) ( ((nod)-1) / (fs)->sb.s_inodes_per_group)
@@ -532,7 +543,7 @@
char d_name[0];
} directory;
-typedef uint8 block[BLOCKSIZE];
+typedef uint8 *block;
/* blockwalker fields:
The blockwalker is used to access all the blocks of a file (including
@@ -571,16 +582,12 @@
/* Filesystem structure that support groups */
-#if BLOCKSIZE == 1024
typedef struct
{
- block zero; // The famous block 0
- superblock sb; // The superblock
- groupdescriptor gd[0]; // The group descriptors
+ uint8 zero[1024]; // Room for bootloader stuff
+ superblock sb; // The superblock, always at 1024
+ // group descriptors come next, see get_gd() below
} filesystem;
-#else
-#error UNHANDLED BLOCKSIZE
-#endif
// now the endianness swap
@@ -820,6 +827,14 @@
return (uint8*)fs + blk*BLOCKSIZE;
}
+// the group descriptors are aligned on the block size
+static inline groupdescriptor *
+get_gd(filesystem *fs, int no)
+{
+ int gdblk = (sizeof (filesystem) + BLOCKSIZE - 1) / BLOCKSIZE;
+ return ((groupdescriptor *) get_blk(fs, gdblk)) + no;
+}
+
// return a given inode from a filesystem
static inline inode *
get_nod(filesystem *fs, uint32 nod)
@@ -829,7 +844,7 @@
offset = GRP_IBM_OFFSET(fs,nod);
grp = GRP_GROUP_OF_INODE(fs,nod);
- itab = (inode *)get_blk(fs, fs->gd[grp].bg_inode_table);
+ itab = (inode *)get_blk(fs, get_gd(fs,grp)->bg_inode_table);
return itab+offset-1;
}
@@ -875,18 +890,18 @@
grp = GRP_GROUP_OF_INODE(fs,nod);
nbgroups = GRP_NBGROUPS(fs);
- if(!(bk = allocate(get_blk(fs,fs->gd[grp].bg_block_bitmap), 0))) {
+ if(!(bk = allocate(GRP_GET_GROUP_BBM(fs, grp), 0))) {
for(grp=0;grp<nbgroups && !bk;grp++)
- bk=allocate(get_blk(fs,fs->gd[grp].bg_block_bitmap),0);
+ bk = allocate(GRP_GET_GROUP_BBM(fs, grp), 0);
grp--;
}
if (!bk)
error_msg_and_die("couldn't allocate a block (no free space)");
- if(!(fs->gd[grp].bg_free_blocks_count--))
+ if(!(get_gd(fs, grp)->bg_free_blocks_count--))
error_msg_and_die("group descr %d. free blocks count == 0 (corrupted fs?)",grp);
if(!(fs->sb.s_free_blocks_count--))
error_msg_and_die("superblock free blocks count == 0 (corrupted fs?)");
- return fs->sb.s_blocks_per_group*grp + bk;
+ return fs->sb.s_first_data_block + fs->sb.s_blocks_per_group*grp + (bk-1);
}
// free a block
@@ -897,8 +912,8 @@
grp = bk / fs->sb.s_blocks_per_group;
bk %= fs->sb.s_blocks_per_group;
- deallocate(get_blk(fs,fs->gd[grp].bg_block_bitmap), bk);
- fs->gd[grp].bg_free_blocks_count++;
+ deallocate(GRP_GET_GROUP_BBM(fs, grp), bk);
+ get_gd(fs, grp)->bg_free_blocks_count++;
fs->sb.s_free_blocks_count++;
}
@@ -918,16 +933,16 @@
/* We do it for all inodes. */
avefreei = fs->sb.s_free_inodes_count / nbgroups;
for(grp=0; grp<nbgroups; grp++) {
- if (fs->gd[grp].bg_free_inodes_count < avefreei ||
- fs->gd[grp].bg_free_inodes_count == 0)
+ if (get_gd(fs, grp)->bg_free_inodes_count < avefreei ||
+ get_gd(fs, grp)->bg_free_inodes_count == 0)
continue;
if (!best_group ||
- fs->gd[grp].bg_free_blocks_count > fs->gd[best_group].bg_free_blocks_count)
+ get_gd(fs, grp)->bg_free_blocks_count > get_gd(fs, best_group)->bg_free_blocks_count)
best_group = grp;
}
- if (!(nod = allocate(get_blk(fs,fs->gd[best_group].bg_inode_bitmap),0)))
+ if (!(nod = allocate(GRP_GET_GROUP_IBM(fs, best_group), 0)))
error_msg_and_die("couldn't allocate an inode (no free inode)");
- if(!(fs->gd[best_group].bg_free_inodes_count--))
+ if(!(get_gd(fs, best_group)->bg_free_inodes_count--))
error_msg_and_die("group descr. free blocks count == 0 (corrupted fs?)");
if(!(fs->sb.s_free_inodes_count--))
error_msg_and_die("superblock free blocks count == 0 (corrupted fs?)");
@@ -1390,7 +1405,7 @@
case FM_IFDIR:
add2dir(fs, nod, nod, ".");
add2dir(fs, nod, parent_nod, "..");
- fs->gd[GRP_GROUP_OF_INODE(fs,nod)].bg_used_dirs_count++;
+ get_gd(fs, GRP_GROUP_OF_INODE(fs,nod))->bg_used_dirs_count++;
break;
}
}
@@ -1860,7 +1875,7 @@
swap_nod(nod);
}
for(i=0;i<GRP_NBGROUPS(fs);i++)
- swap_gd(&(fs->gd[i]));
+ swap_gd(get_gd(fs, i));
swap_sb(&fs->sb);
}
@@ -1870,7 +1885,7 @@
uint32 i;
swap_sb(&fs->sb);
for(i=0;i<GRP_NBGROUPS(fs);i++)
- swap_gd(&(fs->gd[i]));
+ swap_gd(get_gd(fs, i));
for(i = 1; i < fs->sb.s_inodes_count; i++)
{
inode *nod = get_nod(fs, i);
@@ -1895,7 +1910,8 @@
// initialize an empty filesystem
static filesystem *
-init_fs(int nbblocks, int nbinodes, int nbresrvd, int holes, uint32 fs_timestamp)
+init_fs(int nbblocks, int nbinodes, int nbresrvd, int holes,
+ uint32 fs_timestamp, uint32 creator_os)
{
uint32 i;
filesystem *fs;
@@ -1921,10 +1937,14 @@
*/
min_nbgroups = (nbinodes + INODES_PER_GROUP - 1) / INODES_PER_GROUP;
+ /* On filesystems with 1k block size, the bootloader area uses a full
+ * block. For 2048 and up, the superblock can be fitted into block 0.
+ */
+ first_block = (BLOCKSIZE == 1024);
+
/* nbblocks is the total number of blocks in the filesystem.
* a block group can have no more than 8192 blocks.
*/
- first_block = (BLOCKSIZE == 1024);
nbgroups = (nbblocks - first_block + BLOCKS_PER_GROUP - 1) / BLOCKS_PER_GROUP;
if(nbgroups < min_nbgroups) nbgroups = min_nbgroups;
nbblocks_per_group = rndup((nbblocks - first_block + nbgroups - 1)/nbgroups, 8);
@@ -1936,10 +1956,10 @@
gdsz = rndup(nbgroups*sizeof(groupdescriptor),BLOCKSIZE)/BLOCKSIZE;
itblsz = nbinodes_per_group * sizeof(inode)/BLOCKSIZE;
overhead_per_group = 3 /*sb,bbm,ibm*/ + gdsz + itblsz;
- if((uint32)nbblocks - 1 < overhead_per_group * nbgroups)
- error_msg_and_die("too much overhead, try fewer inodes or more blocks. Note: options have changed, see --help or the man page.");
- free_blocks = nbblocks - overhead_per_group*nbgroups - 1 /*boot block*/;
+ free_blocks = nbblocks - overhead_per_group*nbgroups - first_block;
free_blocks_per_group = nbblocks_per_group - overhead_per_group;
+ if(free_blocks < 0)
+ error_msg_and_die("too much overhead, try fewer inodes or more blocks. Note: options have changed, see --help or the man page.");
if(!(fs = (filesystem*)calloc(nbblocks, BLOCKSIZE)))
error_msg_and_die("not enough memory for filesystem");
@@ -1959,28 +1979,31 @@
fs->sb.s_wtime = fs_timestamp;
fs->sb.s_magic = EXT2_MAGIC_NUMBER;
fs->sb.s_lastcheck = fs_timestamp;
+ fs->sb.s_creator_os = creator_os;
// set up groupdescriptors
- for(i=0, bbmpos=gdsz+2, ibmpos=bbmpos+1, itblpos=ibmpos+1;
+ for(i=0, bbmpos=first_block+1+gdsz, ibmpos=bbmpos+1, itblpos=ibmpos+1;
i<nbgroups;
i++, bbmpos+=nbblocks_per_group, ibmpos+=nbblocks_per_group, itblpos+=nbblocks_per_group)
{
+ groupdescriptor *gd = get_gd(fs, i);
+
if(free_blocks > free_blocks_per_group) {
- fs->gd[i].bg_free_blocks_count = free_blocks_per_group;
+ gd->bg_free_blocks_count = free_blocks_per_group;
free_blocks -= free_blocks_per_group;
} else {
- fs->gd[i].bg_free_blocks_count = free_blocks;
+ gd->bg_free_blocks_count = free_blocks;
free_blocks = 0; // this is the last block group
}
if(i)
- fs->gd[i].bg_free_inodes_count = nbinodes_per_group;
+ gd->bg_free_inodes_count = nbinodes_per_group;
else
- fs->gd[i].bg_free_inodes_count = nbinodes_per_group -
+ gd->bg_free_inodes_count = nbinodes_per_group -
EXT2_FIRST_INO + 2;
- fs->gd[i].bg_used_dirs_count = 0;
- fs->gd[i].bg_block_bitmap = bbmpos;
- fs->gd[i].bg_inode_bitmap = ibmpos;
- fs->gd[i].bg_inode_table = itblpos;
+ gd->bg_used_dirs_count = 0;
+ gd->bg_block_bitmap = bbmpos;
+ gd->bg_inode_bitmap = ibmpos;
+ gd->bg_inode_table = itblpos;
}
/* Mark non-filesystem blocks and inodes as allocated */
@@ -1988,9 +2011,9 @@
for(i = 0; i<nbgroups;i++) {
/* Block bitmap */
- bbm = get_blk(fs,fs->gd[i].bg_block_bitmap);
+ bbm = GRP_GET_GROUP_BBM(fs, i);
//non-filesystem blocks
- for(j = fs->gd[i].bg_free_blocks_count
+ for(j = get_gd(fs, i)->bg_free_blocks_count
+ overhead_per_group + 1; j <= BLOCKSIZE * 8; j++)
allocate(bbm, j);
//system blocks
@@ -1998,7 +2021,7 @@
allocate(bbm, j);
/* Inode bitmap */
- ibm = get_blk(fs,fs->gd[i].bg_inode_bitmap);
+ ibm = GRP_GET_GROUP_IBM(fs, i);
//non-filesystem inodes
for(j = fs->sb.s_inodes_per_group+1; j <= BLOCKSIZE * 8; j++)
allocate(ibm, j);
@@ -2012,9 +2035,9 @@
// make root inode and directory
/* We have groups now. Add the root filesystem in group 0 */
/* Also increment the directory count for group 0 */
- fs->gd[0].bg_free_inodes_count--;
- fs->gd[0].bg_used_dirs_count = 1;
- itab0 = (inode *)get_blk(fs,fs->gd[0].bg_inode_table);
+ get_gd(fs, 0)->bg_free_inodes_count--;
+ get_gd(fs, 0)->bg_used_dirs_count = 1;
+ itab0 = (inode *)get_blk(fs, get_gd(fs,0)->bg_inode_table);
itab0[EXT2_ROOT_INO-1].i_mode = FM_IFDIR | FM_IRWXU | FM_IRGRP | FM_IROTH | FM_IXGRP | FM_IXOTH;
itab0[EXT2_ROOT_INO-1].i_ctime = fs_timestamp;
itab0[EXT2_ROOT_INO-1].i_mtime = fs_timestamp;
@@ -2338,8 +2361,9 @@
for (i = 0; i < GRP_NBGROUPS(fs); i++) {
printf("Group No: %d\n", i+1);
printf("block bitmap: block %d,inode bitmap: block %d, inode table: block %d\n",
- fs->gd[i].bg_block_bitmap, fs->gd[i].bg_inode_bitmap,
- fs->gd[i].bg_inode_table);
+ get_gd(fs, i)->bg_block_bitmap,
+ get_gd(fs, i)->bg_inode_bitmap,
+ get_gd(fs, i)->bg_inode_table);
printf("block bitmap allocation:\n");
print_bm(GRP_GET_GROUP_BBM(fs, i),fs->sb.s_blocks_per_group);
printf("inode bitmap allocation:\n");
@@ -2421,10 +2445,12 @@
" -x, --starting-image <image>\n"
" -d, --root <directory>\n"
" -D, --devtable <file>\n"
+ " -B, --block-size <bytes>\n"
" -b, --size-in-blocks <blocks>\n"
" -i, --bytes-per-inode <bytes per inode>\n"
" -N, --number-of-inodes <number of inodes>\n"
" -m, --reserved-percentage <percentage of blocks to reserve>\n"
+ " -o, --creator-os <os> 'linux', 'hurd', 'freebsd' or a numerical value.\n"
" -g, --block-map <path> Generate a block map file for this path.\n"
" -e, --fill-value <value> Fill unallocated blocks with value.\n"
" -z, --allow-holes Allow files with holes.\n"
@@ -2446,6 +2472,29 @@
extern char* optarg;
extern int optind, opterr, optopt;
+// parse the value for -o <os>
+int
+lookup_creator_os(const char *name)
+{
+ static const char *const creators[] =
+ {"linux", "hurd", "2", "freebsd", NULL};
+ char *endptr;
+ int i;
+
+ // numerical value ?
+ i = strtol(name, &endptr, 0);
+ if(name[0] && *endptr == '\0')
+ return i;
+
+ // symbolic name ?
+ for(i=0; creators[i]; i++)
+ if(strcasecmp(creators[i], name) == 0)
+ return i;
+
+ // whatever ?
+ return -1;
+}
+
int
main(int argc, char **argv)
{
@@ -2455,6 +2504,7 @@
float bytes_per_inode = -1;
float reserved_frac = -1;
int fs_timestamp = -1;
+ int creator_os = CREATOR_OS;
char * fsout = "-";
char * fsin = 0;
char * dopt[MAX_DOPT];
@@ -2478,10 +2528,12 @@
{ "starting-image", required_argument, NULL, 'x' },
{ "root", required_argument, NULL, 'd' },
{ "devtable", required_argument, NULL, 'D' },
+ { "block-size", required_argument, NULL, 'B' },
{ "size-in-blocks", required_argument, NULL, 'b' },
{ "bytes-per-inode", required_argument, NULL, 'i' },
{ "number-of-inodes", required_argument, NULL, 'N' },
{ "reserved-percentage", required_argument, NULL, 'm' },
+ { "creator-os", required_argument, NULL, 'o' },
{ "block-map", required_argument, NULL, 'g' },
{ "fill-value", required_argument, NULL, 'e' },
{ "allow-holes", no_argument, NULL, 'z' },
@@ -2497,11 +2549,11 @@
app_name = argv[0];
- while((c = getopt_long(argc, argv, "x:d:D:b:i:N:m:g:e:zfqUPhVv", longopts, NULL)) != EOF) {
+ while((c = getopt_long(argc, argv, "x:d:D:B:b:i:N:m:o:g:e:zfqUPhVv", longopts, NULL)) != EOF) {
#else
app_name = argv[0];
- while((c = getopt(argc, argv, "x:d:D:b:i:N:m:g:e:zfqUPhVv")) != EOF) {
+ while((c = getopt(argc, argv, "x:d:D:B:b:i:N:m:o:g:e:zfqUPhVv")) != EOF) {
#endif /* HAVE_GETOPT_LONG */
switch(c)
{
@@ -2512,6 +2564,9 @@
case 'D':
dopt[didx++] = optarg;
break;
+ case 'B':
+ blocksize = SI_atof(optarg);
+ break;
case 'b':
nbblocks = SI_atof(optarg);
break;
@@ -2524,6 +2579,9 @@
case 'm':
reserved_frac = SI_atof(optarg) / 100;
break;
+ case 'o':
+ creator_os = lookup_creator_os(optarg);
+ break;
case 'g':
gopt[gidx++] = optarg;
break;
@@ -2567,6 +2625,11 @@
error_msg_and_die("Not enough arguments. Try --help or else see the man page.");
fsout = argv[optind];
+ if(blocksize != 1024 && blocksize != 2048 && blocksize != 4096)
+ error_msg_and_die("Valid block sizes: 1024, 2048 or 4096.");
+ if(creator_os < 0)
+ error_msg_and_die("Creator OS unknown.");
+
hdlinks.hdl = (struct hdlink_s *)malloc(hdlink_cnt * sizeof(struct hdlink_s));
if (!hdlinks.hdl)
error_msg_and_die("Not enough memory");
@@ -2611,7 +2674,8 @@
}
if(fs_timestamp == -1)
fs_timestamp = time(NULL);
- fs = init_fs(nbblocks, nbinodes, nbresrvd, holes, fs_timestamp);
+ fs = init_fs(nbblocks, nbinodes, nbresrvd, holes,
+ fs_timestamp, creator_os);
}
populate_fs(fs, dopt, didx, squash_uids, squash_perms, fs_timestamp, NULL);
Index: genext2fs/test-gen.lib
===================================================================
--- genext2fs.orig/test-gen.lib 2011-09-03 13:40:35.000000000 +0200
+++ genext2fs/test-gen.lib 2011-09-03 14:21:17.000000000 +0200
@@ -8,7 +8,7 @@
# Creates an image with a file of given size
# Usage: dgen file-size number-of-blocks
dgen () {
- size=$1; blocks=$2
+ size=$1; blocks=$2; blocksz=$3;
rm -rf test
mkdir -p test
cd test
@@ -20,7 +20,7 @@
chmod 777 file.$1
TZ=UTC-11 touch -t 200502070321.43 file.$1 .
cd ..
- ./genext2fs -N 17 -b $blocks -d test -f -q ext2.img
+ ./genext2fs -B $blocksz -N 17 -b $blocks -d test -f -o Linux -q ext2.img
}
# fgen - Exercises the -f spec-file option of genext2fs
@@ -31,7 +31,7 @@
mkdir -p test
cp $fname test
TZ=UTC-11 touch -t 200502070321.43 test/$fname
- ./genext2fs -N 92 -b $blocks -D test/$fname -f ext2.img
+ ./genext2fs -N 92 -b $blocks -D test/$fname -f -o Linux ext2.img
}
# gen_cleanup - Remove the files generated by the above functions
Index: genext2fs/test-mount.sh
===================================================================
--- genext2fs.orig/test-mount.sh 2011-09-03 13:40:35.000000000 +0200
+++ genext2fs/test-mount.sh 2011-09-03 14:21:17.000000000 +0200
@@ -33,9 +33,9 @@
# and returns the command line with which to invoke dtest()
# Usage: dtest-mount file-size number-of-blocks
dtest_mount () {
- size=$1; blocks=$2
- echo Testing with file of size $size
- dgen $size $blocks
+ size=$1; blocks=$2; blocksz=$3;
+ echo Testing $blocks blocks of $blocksz bytes with file of size $size
+ dgen $size $blocks $blocksz
/sbin/e2fsck -fn ext2.img || fail
mkdir -p mnt
mount -t ext2 -o ro,loop ext2.img mnt || fail
@@ -44,7 +44,7 @@
awk '{print $5}'`" ] ; then
fail
fi
- pass dtest $size $blocks
+ pass dtest $size $blocks $blocksz
}
# ftest-mount - Exercise the -f spec-file option of genext2fs
@@ -75,13 +75,21 @@
pass ftest $fname $blocks
}
-dtest_mount 0 4096
-dtest_mount 0 8193
-dtest_mount 0 8194
-dtest_mount 1 4096
-dtest_mount 12288 4096
-dtest_mount 274432 4096
-dtest_mount 8388608 9000
-dtest_mount 16777216 20000
+dtest_mount 0 4096 1024
+dtest_mount 0 2048 2048
+dtest_mount 0 1024 4096
+dtest_mount 0 8193 1024
+dtest_mount 0 8194 1024
+dtest_mount 0 8193 4096
+dtest_mount 0 8194 2048
+dtest_mount 1 4096 1024
+dtest_mount 1 1024 4096
+dtest_mount 12288 4096 1024
+dtest_mount 274432 4096 1024
+dtest_mount 8388608 9000 1024
+dtest_mount 8388608 4500 2048
+dtest_mount 8388608 2250 4096
+dtest_mount 16777216 20000 1024
+dtest_mount 16777216 10000 2048
ftest_mount device_table.txt 4096
Index: genext2fs/test.sh
===================================================================
--- genext2fs.orig/test.sh 2011-09-03 13:40:35.000000000 +0200
+++ genext2fs/test.sh 2011-09-03 14:21:17.000000000 +0200
@@ -30,9 +30,9 @@
# Creates an image with a file of given size and verifies it
# Usage: dtest file-size number-of-blocks correct-checksum
dtest () {
- size=$1; blocks=$2; checksum=$3
+ size=$1; blocks=$2; blocksz=$3; checksum=$4
echo Testing with file of size $size
- dgen $size $blocks
+ dgen $size $blocks $blocksz
md5cmp $checksum
gen_cleanup
}
@@ -53,12 +53,20 @@
# replace the following lines with the output of
# sudo sh test-mount.sh|grep test
-dtest 0 4096 3bc6424b8fcd51a0de34ee59d91d5f16
-dtest 0 8193 f174804f6b433b552706cbbfc60c416d
-dtest 0 8194 4855a55d0cbdc44584634df49ebd5711
-dtest 1 4096 09c569b6bfb45222c729c42d04d5451f
-dtest 12288 4096 61febcbfbf32024ef99103fcdc282c39
-dtest 274432 4096 0c517803552c55c1806e4220b0a0164f
-dtest 8388608 9000 e0e5ea15bced10ab486d8135584b5d8e
-dtest 16777216 20000 fdf636eb905ab4dc1bf76dce5ac5d209
+dtest 0 4096 1024 3bc6424b8fcd51a0de34ee59d91d5f16
+dtest 0 2048 2048 230afa16496df019878cc2370c661cdc
+dtest 0 1024 4096 ebff5eeb38b70f3f1cd081e60eb44561
+dtest 0 8193 1024 f174804f6b433b552706cbbfc60c416d
+dtest 0 8194 1024 4855a55d0cbdc44584634df49ebd5711
+dtest 0 8193 4096 c493679698418ec7e6552005e2d2a6d8
+dtest 0 8194 2048 ec13f328fa7543563f35f494bddc059c
+dtest 1 4096 1024 09c569b6bfb45222c729c42d04d5451f
+dtest 1 1024 4096 d318a326fdc907810ae9e6b0a20e9b06
+dtest 12288 4096 1024 61febcbfbf32024ef99103fcdc282c39
+dtest 274432 4096 1024 0c517803552c55c1806e4220b0a0164f
+dtest 8388608 9000 1024 e0e5ea15bced10ab486d8135584b5d8e
+dtest 8388608 4500 2048 39f4d537a72f5053fd6891721c59680d
+dtest 8388608 2250 4096 1d697fa4bc2cfffe02ac91edfadc40bf
+dtest 16777216 20000 1024 fdf636eb905ab4dc1bf76dce5ac5d209
+dtest 16777216 10000 2048 f9824a81ea5e74fdf469c097927c292b
ftest device_table.txt 4096 a0af06d944b11d2902dfd705484c64cc

View File

@@ -0,0 +1,44 @@
Index: genext2fs/genext2fs.c
===================================================================
--- genext2fs.orig/genext2fs.c 2011-11-29 17:36:06.000000000 +0100
+++ genext2fs/genext2fs.c 2011-11-29 17:37:37.000000000 +0100
@@ -1779,7 +1779,8 @@
assert(nod->i_block[EXT2_DIND_BLOCK] != 0);
for(i = 0; i < BLOCKSIZE/4; i++)
if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i )
- swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]));
+ if (((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])
+ swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]));
swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]));
if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
return;
@@ -1792,7 +1793,8 @@
(BLOCKSIZE/4)*(BLOCKSIZE/4) +
i*(BLOCKSIZE/4)*(BLOCKSIZE/4) +
j*(BLOCKSIZE/4)) )
- swap_block(get_blk(fs,b2[j]));
+ if (b2[j])
+ swap_block(get_blk(fs,b2[j]));
else {
done = 1;
break;
@@ -1825,7 +1827,8 @@
swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]));
for(i = 0; i < BLOCKSIZE/4; i++)
if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i )
- swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]));
+ if (((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])
+ swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]));
if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
return;
/* Adding support for triple indirection */
@@ -1839,7 +1842,8 @@
(BLOCKSIZE/4)*(BLOCKSIZE/4) +
i*(BLOCKSIZE/4)*(BLOCKSIZE/4) +
j*(BLOCKSIZE/4)) )
- swap_block(get_blk(fs,b2[j]));
+ if (b2[j])
+ swap_block(get_blk(fs,b2[j]));
else {
done = 1;
break;

30
tools/gengetopt/Makefile Normal file
View File

@@ -0,0 +1,30 @@
#
# 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
HOST_FIXUP:=autoreconf
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
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,33 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
ACLOCAL_AMFLAGS = -I m4 -I gl/m4
EXTRA_DIST = configure TODO LICENSE gl/m4/gnulib-cache.m4
-SUBDIRS = gl src doc tests
+SUBDIRS = gl src
gengetoptdoc_DATA = ChangeLog COPYING NEWS THANKS INSTALL README LICENSE
--- a/Makefile.in
+++ b/Makefile.in
@@ -593,7 +593,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4 -I gl/m4
EXTRA_DIST = configure TODO LICENSE gl/m4/gnulib-cache.m4
-SUBDIRS = gl src doc tests
+SUBDIRS = gl src
gengetoptdoc_DATA = ChangeLog COPYING NEWS THANKS INSTALL README LICENSE
TARBALL = $(top_builddir)/gengetopt-$(PACKAGE_VERSION).tar.xz
all: config.h
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,7 +16,7 @@
# with gengetopt; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-SUBDIRS = skels tests
+SUBDIRS = skels
bin_PROGRAMS = gengetopt

34
tools/gmp/Makefile Normal file
View File

@@ -0,0 +1,34 @@
#
# 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
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
$(eval $(call HostBuild))

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

@@ -0,0 +1,24 @@
/* 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 __signed__ short __s16;
typedef __signed__ int __s32;
#ifdef __GNUC__
__extension__ typedef __signed__ long long __s64;
#else
typedef __signed__ long long __s64;
#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

3007
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 */

27
tools/isl/Makefile Normal file
View File

@@ -0,0 +1,27 @@
#
# 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.24
PKG_SOURCE_URL:=http://isl.gforge.inria.fr
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad
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)
$(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))

34
tools/libressl/Makefile Normal file
View File

@@ -0,0 +1,34 @@
#
# 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.3.4
PKG_HASH:=bcce767a3fed252bfd1210f8a7e3505a2b54d3008f66e43d9b95e3f30c072931
PKG_RELEASE:=1
PKG_CPE_ID:=cpe:/a:openbsd:libressl
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://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_CONFIGURE_ARGS += --enable-static --disable-shared --disable-tests
HOST_CFLAGS += $(HOST_FPIC)
ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32)
HOST_CONFIGURE_ARGS += --disable-asm
endif
$(eval $(call HostBuild))

42
tools/libtool/Makefile Normal file
View File

@@ -0,0 +1,42 @@
#
# 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.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=1d7b6862c1ed162e327f083a6f78f40eae29218f0db8c38393d61dab764c4407
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_VARS += \
lt_cv_sys_dlsearch_path=""
define Host/Prepare
$(call Host/Prepare/Default)
(cd $(STAGING_DIR_HOST)/share/aclocal/ && rm -f libtool.m4 ltdl.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4)
(cd $(HOST_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap)
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
$(SED) 's,\(hardcode_into_libs\)=yes,\1=no,g' $(STAGING_DIR_HOST)/bin/libtool
$(CP) $(STAGING_DIR_HOST)/bin/libtool $(STAGING_DIR_HOST)/bin/libtool-ucxx
$(SED) 's,-lstdc++,-luClibc++,g' $(STAGING_DIR_HOST)/bin/libtool-ucxx
endef
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
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,141 @@
--- a/libltdl/config/general.m4sh
+++ b/libltdl/config/general.m4sh
@@ -45,15 +45,22 @@ progpath="$0"
M4SH_VERBATIM([[
: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="@EGREP@"}
-: ${FGREP="@FGREP@"}
-: ${GREP="@GREP@"}
: ${LN_S="@LN_S@"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
-: ${SED="@SED@"}
+if test -n "$STAGING_DIR"; then
+ : ${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
+ : ${EGREP="@EGREP@"}
+ : ${FGREP="@FGREP@"}
+ : ${GREP="@GREP@"}
+ : ${SED="@SED@"}
+fi
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
--- a/libtoolize.in
+++ b/libtoolize.in
@@ -334,15 +334,22 @@ as_unset=as_fn_unset
: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="@EGREP@"}
-: ${FGREP="@FGREP@"}
-: ${GREP="@GREP@"}
: ${LN_S="@LN_S@"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
-: ${SED="@SED@"}
+if test -n "$STAGING_DIR"; then
+ : ${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
+ : ${EGREP="@EGREP@"}
+ : ${FGREP="@FGREP@"}
+ : ${GREP="@GREP@"}
+ : ${SED="@SED@"}
+fi
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
@@ -2487,10 +2494,17 @@ func_check_macros ()
# Locations for important files:
prefix=@prefix@
- datadir=@datadir@
- pkgdatadir=@pkgdatadir@
- pkgltdldir=@pkgdatadir@
- aclocaldir=@aclocaldir@
+ if test -n "$STAGING_DIR"; then
+ datadir="$STAGING_DIR/../host/share"
+ pkgdatadir="$STAGING_DIR/../host/share/libtool"
+ pkgltdldir="$STAGING_DIR/../host/share/libtool"
+ aclocaldir="$STAGING_DIR/../host/share/aclocal"
+ else
+ datadir=@datadir@
+ pkgdatadir=@pkgdatadir@
+ pkgltdldir=@pkgdatadir@
+ aclocaldir=@aclocaldir@
+ fi
auxdir=
macrodir=
configure_ac=configure.in
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -1453,10 +1453,17 @@ func_check_macros ()
# Locations for important files:
prefix=@prefix@
- datadir=@datadir@
- pkgdatadir=@pkgdatadir@
- pkgltdldir=@pkgdatadir@
- aclocaldir=@aclocaldir@
+ if test -n "$STAGING_DIR"; then
+ datadir="$STAGING_DIR/../host/share"
+ pkgdatadir="$STAGING_DIR/../host/share/libtool"
+ pkgltdldir="$STAGING_DIR/../host/share/libtool"
+ aclocaldir="$STAGING_DIR/../host/share/aclocal"
+ else
+ datadir=@datadir@
+ pkgdatadir=@pkgdatadir@
+ pkgltdldir=@pkgdatadir@
+ aclocaldir=@aclocaldir@
+ fi
auxdir=
macrodir=
configure_ac=configure.in
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -907,9 +907,8 @@ dnl AC_DEFUN([AC_LIBTOOL_RC], [])
# ----------------
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:-$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
@@ -7660,9 +7659,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:-$STAGING_DIR}/../host/bin/grep"], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], ["\${STAGING_DIR:-$STAGING_DIR}/../host/bin/grep -E"], [An ERE matcher])
+_LT_DECL([], [FGREP], ["\${STAGING_DIR:-$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])
])
@@ -7695,9 +7694,8 @@ AC_SUBST([DLLTOOL])
# 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:-$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,94 @@
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -5731,8 +5731,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="$libdir"
+ #absdir="$lt_sysroot$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -6130,8 +6136,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
@@ -6286,7 +6290,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
--- a/libltdl/config/ltmain.sh
+++ b/libltdl/config/ltmain.sh
@@ -6518,8 +6518,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="$libdir"
+ #absdir="$lt_sysroot$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -6917,8 +6923,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
@@ -7073,7 +7077,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,20 @@
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -6120,7 +6120,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
--- a/libltdl/config/ltmain.sh
+++ b/libltdl/config/ltmain.sh
@@ -6907,7 +6907,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

View File

@@ -0,0 +1,24 @@
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2183,6 +2183,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"'
--- a/libltdl/config/ltmain.sh
+++ b/libltdl/config/ltmain.sh
@@ -2973,6 +2973,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,49 @@
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>
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2167,8 +2167,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
--- a/libltdl/config/ltmain.sh
+++ b/libltdl/config/ltmain.sh
@@ -2954,8 +2954,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,12 @@
diff -ur libtool-2.4.orig/libltdl/config/ltmain.m4sh libtool-2.4/libltdl/config/ltmain.m4sh
--- libtool-2.4.orig/libltdl/config/ltmain.m4sh 2015-06-18 10:46:15.499996979 +0200
+++ libtool-2.4/libltdl/config/ltmain.m4sh 2015-06-18 10:48:24.686882213 +0200
@@ -5076,7 +5076,7 @@
# -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*)
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
func_append compile_command " $arg"

View File

@@ -0,0 +1,112 @@
--- a/libltdl/config/general.m4sh
+++ b/libltdl/config/general.m4sh
@@ -359,7 +359,7 @@ opt_warning=:
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*"
}
# func_verbose arg...
@@ -385,14 +385,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: ${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: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
# bash bug again:
:
--- a/libltdl/config/ltmain.sh
+++ b/libltdl/config/ltmain.sh
@@ -439,7 +439,7 @@ opt_warning=:
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*"
}
# func_verbose arg...
@@ -465,14 +465,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: ${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: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
# bash bug again:
:
--- a/libtoolize.in
+++ b/libtoolize.in
@@ -648,7 +648,7 @@ opt_warning=:
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*"
}
# func_verbose arg...
@@ -674,14 +674,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: ${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: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
# bash bug again:
:
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -596,7 +596,7 @@ opt_warning=:
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*"
}
# func_verbose arg...
@@ -622,14 +622,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: ${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: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
# bash bug again:
:

38
tools/lzma-old/Makefile Normal file
View File

@@ -0,0 +1,38 @@
#
# 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:=lzma-old
PKG_VERSION:=4.32
PKG_SOURCE:=lzma-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@OPENWRT
PKG_HASH:=49053e4bb5e0646a841d250d9cb81f7714f5fff04a133216c4748163567acc3d
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/lzma-$(PKG_VERSION)
include $(INCLUDE_DIR)/host-build.mk
LIB_DIR=$(HOST_BUILD_DIR)/C/7zip/Compress/LZMA_Lib
ALONE_DIR=$(HOST_BUILD_DIR)/C/7zip/Compress/LZMA_Alone
define Host/Compile
+$(HOST_MAKE_VARS) \
$(MAKE) -C $(LIB_DIR)
+$(HOST_MAKE_VARS) \
$(MAKE) -f makefile.gcc -C $(ALONE_DIR)
endef
define Host/Install
$(INSTALL_DATA) $(LIB_DIR)/liblzma.a $(STAGING_DIR_HOST)/lib/liblzma-old.a
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/lib/liblzma-old.a
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,404 @@
--- a/C/7zip/Compress/LZMA/LZMADecoder.cpp
+++ b/C/7zip/Compress/LZMA/LZMADecoder.cpp
@@ -274,12 +274,17 @@ STDMETHODIMP CDecoder::SetDecoderPropert
Byte remainder = (Byte)(properties[0] / 9);
int lp = remainder % 5;
int pb = remainder / 5;
- if (pb > NLength::kNumPosStatesBitsMax)
- return E_INVALIDARG;
- _posStateMask = (1 << pb) - 1;
UInt32 dictionarySize = 0;
for (int i = 0; i < 4; i++)
dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);
+ return SetDecoderPropertiesRaw(lc, lp, pb, dictionarySize);
+}
+
+STDMETHODIMP CDecoder::SetDecoderPropertiesRaw(int lc, int lp, int pb, UInt32 dictionarySize)
+{
+ if (pb > NLength::kNumPosStatesBitsMax)
+ return E_INVALIDARG;
+ _posStateMask = (1 << pb) - 1;
if (!_outWindowStream.Create(dictionarySize))
return E_OUTOFMEMORY;
if (!_literalDecoder.Create(lp, lc))
--- a/C/7zip/Compress/LZMA/LZMADecoder.h
+++ b/C/7zip/Compress/LZMA/LZMADecoder.h
@@ -228,6 +228,7 @@ public:
ICompressProgressInfo *progress);
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+ STDMETHOD(SetDecoderPropertiesRaw)(int lc, int lp, int pb, UInt32 dictionarySize);
STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
--- /dev/null
+++ b/C/7zip/Compress/LZMA_Lib/makefile
@@ -0,0 +1,92 @@
+PROG = liblzma.a
+CXX = g++ -O3 -Wall
+AR = ar
+RM = rm -f
+CFLAGS = -c -I ../../../
+
+OBJS = \
+ ZLib.o \
+ LZMADecoder.o \
+ LZMAEncoder.o \
+ LZInWindow.o \
+ LZOutWindow.o \
+ RangeCoderBit.o \
+ InBuffer.o \
+ OutBuffer.o \
+ FileStreams.o \
+ Alloc.o \
+ C_FileIO.o \
+ CommandLineParser.o \
+ CRC.o \
+ StreamUtils.o \
+ String.o \
+ StringConvert.o \
+ StringToInt.o \
+ Vector.o \
+
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+ $(AR) r $(PROG) $(OBJS)
+
+ZLib.o: ZLib.cpp
+ $(CXX) $(CFLAGS) ZLib.cpp
+
+LZMADecoder.o: ../LZMA/LZMADecoder.cpp
+ $(CXX) $(CFLAGS) ../LZMA/LZMADecoder.cpp
+
+LZMAEncoder.o: ../LZMA/LZMAEncoder.cpp
+ $(CXX) $(CFLAGS) ../LZMA/LZMAEncoder.cpp
+
+LZInWindow.o: ../LZ/LZInWindow.cpp
+ $(CXX) $(CFLAGS) ../LZ/LZInWindow.cpp
+
+LZOutWindow.o: ../LZ/LZOutWindow.cpp
+ $(CXX) $(CFLAGS) ../LZ/LZOutWindow.cpp
+
+RangeCoderBit.o: ../RangeCoder/RangeCoderBit.cpp
+ $(CXX) $(CFLAGS) ../RangeCoder/RangeCoderBit.cpp
+
+InBuffer.o: ../../Common/InBuffer.cpp
+ $(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
+
+OutBuffer.o: ../../Common/OutBuffer.cpp
+ $(CXX) $(CFLAGS) ../../Common/OutBuffer.cpp
+
+StreamUtils.o: ../../Common/StreamUtils.cpp
+ $(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
+
+FileStreams.o: ../../Common/FileStreams.cpp
+ $(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
+
+Alloc.o: ../../../Common/Alloc.cpp
+ $(CXX) $(CFLAGS) ../../../Common/Alloc.cpp
+
+C_FileIO.o: ../../../Common/C_FileIO.cpp
+ $(CXX) $(CFLAGS) ../../../Common/C_FileIO.cpp
+
+CommandLineParser.o: ../../../Common/CommandLineParser.cpp
+ $(CXX) $(CFLAGS) ../../../Common/CommandLineParser.cpp
+
+CRC.o: ../../../Common/CRC.cpp
+ $(CXX) $(CFLAGS) ../../../Common/CRC.cpp
+
+MyWindows.o: ../../../Common/MyWindows.cpp
+ $(CXX) $(CFLAGS) ../../../Common/MyWindows.cpp
+
+String.o: ../../../Common/String.cpp
+ $(CXX) $(CFLAGS) ../../../Common/String.cpp
+
+StringConvert.o: ../../../Common/StringConvert.cpp
+ $(CXX) $(CFLAGS) ../../../Common/StringConvert.cpp
+
+StringToInt.o: ../../../Common/StringToInt.cpp
+ $(CXX) $(CFLAGS) ../../../Common/StringToInt.cpp
+
+Vector.o: ../../../Common/Vector.cpp
+ $(CXX) $(CFLAGS) ../../../Common/Vector.cpp
+
+clean:
+ -$(RM) $(PROG) $(OBJS)
+
--- /dev/null
+++ b/C/7zip/Compress/LZMA_Lib/ZLib.cpp
@@ -0,0 +1,273 @@
+/*
+ * lzma zlib simplified wrapper
+ *
+ * Copyright (c) 2005-2006 Oleg I. Vdovikin <oleg@cs.msu.su>
+ *
+ * This 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.
+ *
+ * This 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 this library; if not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * default values for encoder/decoder used by wrapper
+ */
+
+#include <zlib.h>
+
+#define ZLIB_LC 3
+#define ZLIB_LP 0
+#define ZLIB_PB 2
+
+#ifdef WIN32
+#include <initguid.h>
+#else
+#define INITGUID
+#endif
+
+#include "../../../Common/MyWindows.h"
+#include "../LZMA/LZMADecoder.h"
+#include "../LZMA/LZMAEncoder.h"
+
+#define STG_E_SEEKERROR ((HRESULT)0x80030019L)
+#define STG_E_MEDIUMFULL ((HRESULT)0x80030070L)
+
+class CInMemoryStream:
+ public IInStream,
+ public IStreamGetSize,
+ public CMyUnknownImp
+{
+public:
+ CInMemoryStream(const Bytef *data, UInt64 size) :
+ m_data(data), m_size(size), m_offset(0) {}
+
+ virtual ~CInMemoryStream() {}
+
+ MY_UNKNOWN_IMP2(IInStream, IStreamGetSize)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize)
+ {
+ if (size > m_size - m_offset)
+ size = m_size - m_offset;
+
+ if (size) {
+ memcpy(data, m_data + m_offset, size);
+ }
+
+ m_offset += size;
+
+ if (processedSize)
+ *processedSize = size;
+
+ return S_OK;
+ }
+
+ STDMETHOD(ReadPart)(void *data, UInt32 size, UInt32 *processedSize)
+ {
+ return Read(data, size, processedSize);
+ }
+
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+ {
+ UInt64 _offset;
+
+ if (seekOrigin == STREAM_SEEK_SET) _offset = offset;
+ else if (seekOrigin == STREAM_SEEK_CUR) _offset = m_offset + offset;
+ else if (seekOrigin == STREAM_SEEK_END) _offset = m_size;
+ else return STG_E_INVALIDFUNCTION;
+
+ if (_offset < 0 || _offset > m_size)
+ return STG_E_SEEKERROR;
+
+ m_offset = _offset;
+
+ if (newPosition)
+ *newPosition = m_offset;
+
+ return S_OK;
+ }
+
+ STDMETHOD(GetSize)(UInt64 *size)
+ {
+ *size = m_size;
+ return S_OK;
+ }
+protected:
+ const Bytef *m_data;
+ UInt64 m_size;
+ UInt64 m_offset;
+};
+
+class COutMemoryStream:
+ public IOutStream,
+ public CMyUnknownImp
+{
+public:
+ COutMemoryStream(Bytef *data, UInt64 maxsize) :
+ m_data(data), m_size(0), m_maxsize(maxsize), m_offset(0) {}
+ virtual ~COutMemoryStream() {}
+
+ MY_UNKNOWN_IMP1(IOutStream)
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize)
+ {
+ if (size > m_maxsize - m_offset)
+ size = m_maxsize - m_offset;
+
+ if (size) {
+ memcpy(m_data + m_offset, data, size);
+ }
+
+ m_offset += size;
+
+ if (m_offset > m_size)
+ m_size = m_offset;
+
+ if (processedSize)
+ *processedSize = size;
+
+ return S_OK;
+ }
+
+ STDMETHOD(WritePart)(const void *data, UInt32 size, UInt32 *processedSize)
+ {
+ return Write(data, size, processedSize);
+ }
+
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+ {
+ UInt64 _offset;
+
+ if (seekOrigin == STREAM_SEEK_SET) _offset = offset;
+ else if (seekOrigin == STREAM_SEEK_CUR) _offset = m_offset + offset;
+ else if (seekOrigin == STREAM_SEEK_END) _offset = m_size;
+ else return STG_E_INVALIDFUNCTION;
+
+ if (_offset < 0 || _offset > m_maxsize)
+ return STG_E_SEEKERROR;
+
+ m_offset = _offset;
+
+ if (newPosition)
+ *newPosition = m_offset;
+
+ return S_OK;
+ }
+
+ STDMETHOD(SetSize)(Int64 newSize)
+ {
+ if ((UInt64)newSize > m_maxsize)
+ return STG_E_MEDIUMFULL;
+
+ return S_OK;
+ }
+protected:
+ Bytef *m_data;
+ UInt64 m_size;
+ UInt64 m_maxsize;
+ UInt64 m_offset;
+};
+
+ZEXTERN int ZEXPORT compress2 (Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level)
+{
+ CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);
+ CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
+
+ COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);
+ CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
+
+ NCompress::NLZMA::CEncoder *encoderSpec =
+ new NCompress::NLZMA::CEncoder;
+ CMyComPtr<ICompressCoder> encoder = encoderSpec;
+
+ PROPID propIDs[] =
+ {
+ NCoderPropID::kDictionarySize,
+ NCoderPropID::kPosStateBits,
+ NCoderPropID::kLitContextBits,
+ NCoderPropID::kLitPosBits,
+ NCoderPropID::kAlgorithm,
+ NCoderPropID::kNumFastBytes,
+ NCoderPropID::kMatchFinder,
+ NCoderPropID::kEndMarker
+ };
+ const int kNumProps = sizeof(propIDs) / sizeof(propIDs[0]);
+
+ PROPVARIANT properties[kNumProps];
+ for (int p = 0; p < 6; p++)
+ properties[p].vt = VT_UI4;
+ properties[0].ulVal = UInt32(1 << (level + 14));
+ properties[1].ulVal = UInt32(ZLIB_PB);
+ properties[2].ulVal = UInt32(ZLIB_LC); // for normal files
+ properties[3].ulVal = UInt32(ZLIB_LP); // for normal files
+ properties[4].ulVal = UInt32(2);
+ properties[5].ulVal = UInt32(128);
+
+ properties[6].vt = VT_BSTR;
+ properties[6].bstrVal = (BSTR)(const wchar_t *)L"BT4";
+
+ properties[7].vt = VT_BOOL;
+ properties[7].boolVal = VARIANT_TRUE;
+
+ if (encoderSpec->SetCoderProperties(propIDs, properties, kNumProps) != S_OK)
+ return Z_MEM_ERROR; // should not happen
+
+ HRESULT result = encoder->Code(inStream, outStream, 0, 0, 0);
+ if (result == E_OUTOFMEMORY)
+ {
+ return Z_MEM_ERROR;
+ }
+ else if (result != S_OK)
+ {
+ return Z_BUF_ERROR; // should not happen
+ }
+
+ UInt64 fileSize;
+ outStreamSpec->Seek(0, STREAM_SEEK_END, &fileSize);
+ *destLen = fileSize;
+
+ return Z_OK;
+}
+
+ZEXTERN int ZEXPORT uncompress (Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen)
+{
+ CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);
+ CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
+
+ COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);
+ CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
+
+ NCompress::NLZMA::CDecoder *decoderSpec =
+ new NCompress::NLZMA::CDecoder;
+ CMyComPtr<ICompressCoder> decoder = decoderSpec;
+
+ if (decoderSpec->SetDecoderPropertiesRaw(ZLIB_LC,
+ ZLIB_LP, ZLIB_PB, (1 << 23)) != S_OK) return Z_DATA_ERROR;
+
+ UInt64 fileSize = *destLen;
+
+ if (decoder->Code(inStream, outStream, 0, &fileSize, 0) != S_OK)
+ {
+ return Z_DATA_ERROR;
+ }
+
+ outStreamSpec->Seek(0, STREAM_SEEK_END, &fileSize);
+ *destLen = fileSize;
+
+ return Z_OK;
+}

View File

@@ -0,0 +1,10 @@
--- a/C/7zip/Compress/LZMA_Lib/makefile
+++ b/C/7zip/Compress/LZMA_Lib/makefile
@@ -29,6 +29,7 @@ all: $(PROG)
$(PROG): $(OBJS)
$(AR) r $(PROG) $(OBJS)
+ ranlib $(PROG)
ZLib.o: ZLib.cpp
$(CXX) $(CFLAGS) ZLib.cpp

View File

@@ -0,0 +1,11 @@
--- a/C/7zip/Compress/LZMA_Lib/makefile
+++ b/C/7zip/Compress/LZMA_Lib/makefile
@@ -2,7 +2,7 @@ PROG = liblzma.a
CXX = g++ -O3 -Wall
AR = ar
RM = rm -f
-CFLAGS = -c -I ../../../
+CFLAGS += -c -I ../../../
OBJS = \
ZLib.o \

36
tools/lzma/Makefile Normal file
View File

@@ -0,0 +1,36 @@
#
# 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:=lzma
PKG_VERSION:=4.65
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@OPENWRT
PKG_HASH:=dcbdb5f4843eff638e4a5e8be0e2486a3c5483df73c70823618db8e66f609ec2
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/host-build.mk
UTIL_DIR=$(HOST_BUILD_DIR)/C/LzmaUtil
ALONE_DIR=$(HOST_BUILD_DIR)/CPP/7zip/Compress/LZMA_Alone
define Host/Compile
$(MAKE) -C $(UTIL_DIR) -f makefile.gcc
$(MAKE) -C $(ALONE_DIR) -f makefile.gcc
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/CPP/7zip/Compress/LZMA_Alone/lzma_alone $(STAGING_DIR_HOST)/bin/lzma
endef
define Host/Clean
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,13 @@
Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
===================================================================
--- lzma-4.65.orig/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-05-15 23:33:51.000000000 +0200
+++ lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-06-01 22:00:54.000000000 +0200
@@ -3,7 +3,7 @@
CXX_C = gcc -O2 -Wall
LIB = -lm
RM = rm -f
-CFLAGS = -c
+CFLAGS = -c -D_FILE_OFFSET_BITS=64
ifdef SystemDrive
IS_MINGW = 1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
diff -urN lzma-4.65/CPP/7zip/Common/FileStreams.h lzma-4.65.new/CPP/7zip/Common/FileStreams.h
--- lzma-4.65/CPP/7zip/Common/FileStreams.h 2009-05-15 23:33:51.000000000 +0200
+++ lzma-4.65.new/CPP/7zip/Common/FileStreams.h 2009-06-01 22:30:01.000000000 +0200
@@ -72,6 +72,7 @@
public IOutStream,
public CMyUnknownImp
{
+public:
#ifdef USE_WIN_FILE
NWindows::NFile::NIO::COutFile File;
#else
diff -urN lzma-4.65/CPP/Common/MyWindows.h lzma-4.65.new/CPP/Common/MyWindows.h
--- lzma-4.65/CPP/Common/MyWindows.h 2009-05-15 23:33:51.000000000 +0200
+++ lzma-4.65.new/CPP/Common/MyWindows.h 2009-06-01 22:29:26.000000000 +0200
@@ -101,8 +101,11 @@
#ifdef __cplusplus
+#ifndef INITGUID
+#define INITGUID
DEFINE_GUID(IID_IUnknown,
0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
+#endif
struct IUnknown
{
STDMETHOD(QueryInterface) (REFIID iid, void **outObject) PURE;

View File

@@ -0,0 +1,70 @@
--- a/C/LzmaUtil/makefile.gcc
+++ b/C/LzmaUtil/makefile.gcc
@@ -1,44 +1,53 @@
PROG = lzma
-CXX = g++
-LIB =
+CC = gcc
+LIB = liblzma.a
RM = rm -f
CFLAGS = -c -O2 -Wall
+AR = ar
+RANLIB = ranlib
OBJS = \
- LzmaUtil.o \
Alloc.o \
LzFind.o \
LzmaDec.o \
LzmaEnc.o \
+ LzmaLib.o \
7zFile.o \
7zStream.o \
-
all: $(PROG)
-$(PROG): $(OBJS)
- $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2)
+$(PROG): LzmaUtil.o $(LIB)
+ $(CC) -o $(PROG) $(LDFLAGS) $< $(LIB)
LzmaUtil.o: LzmaUtil.c
- $(CXX) $(CFLAGS) LzmaUtil.c
+ $(CC) $(CFLAGS) LzmaUtil.c
+
+$(LIB): $(OBJS)
+ rm -f $@
+ $(AR) rcu $@ $(OBJS)
+ $(RANLIB) $@
Alloc.o: ../Alloc.c
- $(CXX) $(CFLAGS) ../Alloc.c
+ $(CC) $(CFLAGS) ../Alloc.c
LzFind.o: ../LzFind.c
- $(CXX) $(CFLAGS) ../LzFind.c
+ $(CC) $(CFLAGS) ../LzFind.c
LzmaDec.o: ../LzmaDec.c
- $(CXX) $(CFLAGS) ../LzmaDec.c
+ $(CC) $(CFLAGS) ../LzmaDec.c
LzmaEnc.o: ../LzmaEnc.c
- $(CXX) $(CFLAGS) ../LzmaEnc.c
+ $(CC) $(CFLAGS) ../LzmaEnc.c
+
+LzmaLib.o: ../LzmaLib.c
+ $(CC) $(CFLAGS) ../LzmaLib.c
7zFile.o: ../7zFile.c
- $(CXX) $(CFLAGS) ../7zFile.c
+ $(CC) $(CFLAGS) ../7zFile.c
7zStream.o: ../7zStream.c
- $(CXX) $(CFLAGS) ../7zStream.c
+ $(CC) $(CFLAGS) ../7zStream.c
clean:
- -$(RM) $(PROG) $(OBJS)
+ -$(RM) $(PROG) *.o *.a

View File

@@ -0,0 +1,20 @@
--- a/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
+++ b/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
@@ -101,6 +101,8 @@ static const int kNumSwitches = sizeof(k
static void PrintHelp()
{
+ fprintf(stderr, "\nLZMA " MY_VERSION_COPYRIGHT_DATE "\n");
+
fprintf(stderr, "\nUsage: LZMA <e|d> inputFile outputFile [<switches>...]\n"
" e: encode file\n"
" d: decode file\n"
@@ -168,8 +170,6 @@ int main2(int n, const char *args[])
g_IsNT = IsItWindowsNT();
#endif
- fprintf(stderr, "\nLZMA " MY_VERSION_COPYRIGHT_DATE "\n");
-
if (n == 1)
{
PrintHelp();

29
tools/m4/Makefile Normal file
View File

@@ -0,0 +1,29 @@
#
# Copyright (C) 2008-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:=m4
PKG_CPE_ID:=cpe:/a:gnu:m4
PKG_VERSION:=1.4.19
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
PKG_CAT:=xzcat
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_VARS += gl_cv_func_strstr_linear=no
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,28 @@
#
# Copyright (C) 2015 OpenWrt.org
# Copyright (C) 2016 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:=make-ext4fs
PKG_SOURCE_URL=$(PROJECT_GIT)/project/make_ext4fs.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-01-05
PKG_SOURCE_VERSION:=5c201be7d72aff735da27e17c29852e0cefe3e52
PKG_MIRROR_HASH:=a9b74b7b95acc84a5a5c33d6acf493faad8f161caca3180734d9bd383c9d823f
include $(INCLUDE_DIR)/host-build.mk
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/make_ext4fs $(STAGING_DIR_HOST)/bin/
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/make_ext4fs
endef
$(eval $(call HostBuild))

35
tools/meson/Makefile Normal file
View File

@@ -0,0 +1,35 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=meson
PKG_VERSION:=0.59.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION)
PKG_HASH:=13dee549a7ba758b7e33ce7719f28d1d337a98d10d378a4779ccc996f5a2fc49
PKG_MAINTAINER:=Andre Heider <a.heider@gmail.com>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/host-build.mk
define Host/Configure
endef
define Host/Compile
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(HOST_BUILD_DIR)/packaging/create_zipapp.py $(HOST_BUILD_DIR) --outfile $(STAGING_DIR_HOST)/bin/meson
$(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/meson
$(INSTALL_CONF) files/openwrt-cross.txt.in $(STAGING_DIR_HOST)/lib/meson/
$(INSTALL_CONF) files/openwrt-native.txt.in $(STAGING_DIR_HOST)/lib/meson/
endef
define Host/Clean
$(call Host/Clean/Default)
rm -rf $(STAGING_DIR_HOST)/lib/meson
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,23 @@
[binaries]
c = [@CC@]
cpp = [@CXX@]
ar = '@AR@'
strip = '@STRIP@'
nm = '@NM@'
pkgconfig = '@PKGCONFIG@'
[built-in options]
c_args = [@CFLAGS@]
c_link_args = [@LDFLAGS@]
cpp_args = [@CXXFLAGS@]
cpp_link_args = [@LDFLAGS@]
prefix = '/usr'
[host_machine]
system = 'linux'
cpu_family = '@ARCH@'
cpu = '@CPU@'
endian = '@ENDIAN@'
[properties]
needs_exe_wrapper = true

View File

@@ -0,0 +1,13 @@
[binaries]
c = [@CC@]
cpp = [@CXX@]
pkgconfig = '@PKGCONFIG@'
[built-in options]
c_args = [@CFLAGS@]
c_link_args = [@LDFLAGS@]
cpp_args = [@CXXFLAGS@]
cpp_link_args = [@LDFLAGS@]
prefix = '@PREFIX@'
sbindir = 'bin'
libdir = 'lib'

View File

@@ -0,0 +1,28 @@
#
# 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:=missing-macros
PKG_RELEASE:=11
include $(INCLUDE_DIR)/host-build.mk
define Host/Configure
endef
define Host/Compile
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/share/aclocal
$(INSTALL_DATA) ./src/m4/*.m4 $(STAGING_DIR_HOST)/share/aclocal/
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(INSTALL_BIN) ./src/bin/* $(STAGING_DIR_HOST)/bin/
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,100 @@
The m4/ directory below contains various m4 macros used
by different packages in the OpenWrt feed.
From GNU gettext:
Library linking and rpath helper macros.
lib-ld.m4
lib-link.m4
lib-prefix.m4
Integer data type test macros.
intmax.m4
wint_t.m4
inttypes-pri.m4
uintmax_t.m4
stdint_h.m4
intdiv0.m4
inttypes_h.m4
Program test macro.
progtest.m4
GNU libc version test macros.
glibc2.m4
glibc21.m4
From UCL and LZO:
Compiler ACC conformance testing macros.
mfx_acc.m4
mfx_cppflags.m4
mfx_limits.m4
From OSSP-JS:
Test macros for va_copy() implementations.
va_copy.m4
From libmikmod:
Feature test macros for the Enlightment Sound Daemon.
esd.m4
From libdnet:
Feature test macros for socket api implementations.
dnet.m4
From FLAC:
XMMS feature detection macros.
xmms.m4
From ao:
Directory expansion macro for Automake.
as-ac-expand.m4
From tinyproxy:
Autostars m4 macro for detection of compiler flags.
as-compiler-flags.m4
From morituri:
Autostars m4 macro for versioning.
as-version.m4
From liboil:
Check if unaligned memory access works correctly.
as-unaligned-access.m4
From OpenWrt:
Always disable GTK docs.
fake-gtk-doc-check.m4
Provide intltool.m4 stubs to allow for autoreconf.
fake-intltool.m4
From XDM:
XAW macros.
xaw.m4

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env perl
use strict;
use Getopt::Long;
my $output;
my $version;
Getopt::Long::Configure('pass_through');
Getopt::Long::GetOptions(
'output=s' => \$output,
'version' => \$version
);
if ($version)
{
printf "OpenWrt help2man 1.40.10\n";
exit 0;
}
elsif ($output)
{
open O, "> $output" || die "Unable to open $output: $!\n";
print O "Dummy man page.\n";
close O;
}
else
{
print O "Dummy man page.\n";
}

View File

@@ -0,0 +1,112 @@
#!/usr/bin/env perl
use strict;
use Getopt::Long;
my $output;
my $version;
my $docbook;
my $html;
my $xml;
my $plaintext;
my $no_split;
my $no_headers;
Getopt::Long::Configure('pass_through');
Getopt::Long::GetOptions(
'output=s' => \$output,
'version' => \$version,
'no-split' => \$no_split,
'no-headers' => \$no_headers,
'docbook' => \$docbook,
'html' => \$html,
'xml' => \$xml,
'plaintext' => \$plaintext
);
if ($version)
{
print "makeinfo (OpenWrt stub) 4.13\n";
exit 0;
}
sub output_filename
{
my $path = shift || return;
my $name = $path;
my $setfile;
if (open F, "< $path")
{
while (defined(my $line = readline F))
{
if ($line =~ /\@setfilename\s+(\S+)/)
{
$setfile = $1;
$setfile =~ s!^.+/!!;
last;
}
}
close F;
}
$name =~ s!^.+/!!;
$name =~ s!\.[^.]+$!!;
if ($html)
{
$setfile =~ s!\.[^.]+$!! if $setfile;
if ($no_split)
{
return $setfile ? "$setfile.html" : "$name.html" unless $output;
return $output;
}
return $setfile ? "$setfile/index.html" : "$name/index.html" unless $output;
return "$output/index.html";
}
elsif ($xml || $docbook)
{
$setfile =~ s!\.[^.]+$!! if $setfile;
return $setfile ? "$setfile.xml" : "$name.info" unless $output;
return $output;
}
elsif ($plaintext)
{
return ($output || "-");
}
return ($output || $setfile || "$name.info");
}
foreach my $arg (@ARGV)
{
next unless -f $arg;
my $out = output_filename($arg);
if ($out =~ m!^(.+/)[^/]+$!)
{
system("mkdir", "-p", $1);
}
my $fd = \*STDOUT;
if ($out ne "-" && !$no_headers)
{
open $fd, "> $out" || die "Can't open $out: $!\n";
}
if ($html || $xml || $docbook)
{
print $fd "<!-- Dummy output for $arg -->\n";
}
else
{
print $fd "Dummy output for $arg\n";
}
close $fd;
}

View File

@@ -0,0 +1,43 @@
dnl as-ac-expand.m4 0.2.0
dnl autostars m4 macro for expanding directories using configure's prefix
dnl thomas@apestaart.org
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix="$ac_default_prefix"
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var" = "x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])

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