Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
From ffa886a580929f26fd5e5a40c9c5334955c48553 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.
Backported from: 24fd0551333e7eded87b64dd36062da3df2f6380
Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac
index 55e774b..c879fe1 100644
--- 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])
--
2.14.1

View File

@@ -0,0 +1,76 @@
From da21733178b34eea303964db5a05e8a3ee4095b4 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sat, 26 Aug 2017 15:17:06 +0200
Subject: [PATCH] build: make it possible to disable the build of the flex
program
The flex program uses fork(), which isn't available on noMMU
systems. However, the libfl library does not use fork(), and be used
by other programs/libraries.
Therefore, it makes sense to provide an option to disable the build of
the flex program.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Submitted-upstream: https://github.com/westes/flex/pull/256
Refused. We'll have to adapt when they do a new release...
---
Makefile.am | 2 ++
configure.ac | 6 ++++++
doc/Makefile.am | 4 ++++
src/Makefile.am | 3 +++
4 files changed, 15 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index e790e9d..8b57bc9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,8 +62,10 @@ ChangeLog: $(srcdir)/tools/git2cl
indent:
cd src && $(MAKE) $(AM_MAKEFLAGS) indent
+if ENABLE_PROGRAM
install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
+endif
.PHONY: ChangeLog indent
diff --git a/configure.ac b/configure.ac
index 8882016..f49872b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,6 +75,12 @@ AC_ARG_ENABLE([libfl],
[], [enable_libfl=yes])
AM_CONDITIONAL([ENABLE_LIBFL], [test "x$enable_libfl" = xyes])
+AC_ARG_ENABLE([program],
+ [AS_HELP_STRING([--disable-program],
+ [do not build the flex program, only the libfl library])],
+ [], [enable_program=yes])
+AM_CONDITIONAL([ENABLE_PROGRAM], [test "x$enable_program" = xyes])
+
# --disable-bootstrap is intended only to workaround problems with bootstrap
# (e.g. when cross-compiling flex or when bootstrapping has bugs).
# Ideally we should be able to bootstrap even when cross-compiling.
diff --git a/src/Makefile.am b/src/Makefile.am
index 0d13a5a..c73bc17 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,10 @@ LIBS = @LIBS@
m4 = @M4@
+if ENABLE_PROGRAM
bin_PROGRAMS = flex
+endif
+
if ENABLE_BOOTSTRAP
noinst_PROGRAMS = stage1flex
endif
--
2.9.4

View File

@@ -0,0 +1,58 @@
From b89b8475a5b2f9444c32f7d254b35968da3c8a23 Mon Sep 17 00:00:00 2001
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Date: Fri, 29 Sep 2017 18:03:51 +0200
Subject: [PATCH] build: make it possible to disable the build of the
documentation
When targeting embedded devices, the documentation is not needed.
Building the documentation default to whether the program is built.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Makefile.am | 8 +++++++-
configure.ac | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index fce30b2..ee75b64 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,9 +41,15 @@ EXTRA_DIST = \
.indent.pro \
autogen.sh
+MAYBE_SUBDIRS =
+
+if ENABLE_DOC
+MAYBE_SUBDIRS += doc
+endif
+
SUBDIRS = \
src \
- doc \
+ $(MAYBE_SUBDIRS) \
examples \
po \
tests \
diff --git a/configure.ac b/configure.ac
index c54e98f..b3ae450 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,12 @@ AC_ARG_ENABLE([program],
[], [enable_program=yes])
AM_CONDITIONAL([ENABLE_PROGRAM], [test "x$enable_program" = xyes])
+AC_ARG_ENABLE([doc],
+ [AS_HELP_STRING([--disable-doc],
+ [do not build the documentation])],
+ [], [enable_doc=${enable_program}])
+AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = xyes -a "x$enable_program" = xyes])
+
# --disable-bootstrap is intended only to workaround problems with bootstrap
# (e.g. when cross-compiling flex or when bootstrapping has bugs).
# Ideally we should be able to bootstrap even when cross-compiling.
--
2.11.0

View File

@@ -0,0 +1,27 @@
From 4b142954b54a57a9b0af0a9661056a9c39a8fa95 Mon Sep 17 00:00:00 2001
From: Richard Barnes <rbarnes@umn.edu>
Date: Wed, 2 Oct 2024 10:35:09 -0700
Subject: [PATCH] Match `malloc` signature to its use
Upstream: https://github.com/westes/flex/pull/674
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
lib/malloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/malloc.c b/lib/malloc.c
index 75e8ef9..701b9b3 100755
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -3,7 +3,7 @@
#include <sys/types.h>
- void *malloc ();
+ void *malloc (size_t n);
/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
--
2.39.5

View File

@@ -0,0 +1,184 @@
From 5f441f438f086553698e899fa0a475dbb0237d02 Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Wed, 8 May 2024 21:04:01 +0800
Subject: [PATCH] build: Update AX_PROG_CC_FOR_BUILD to fix BUILD_EXEEXT
problems
Upstream: 787edd41833e14e986ff093f7216e7005aca5fe2
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
m4/ax_prog_cc_for_build.m4 | 102 ++++++++++++++++++++++++++++---------
1 file changed, 77 insertions(+), 25 deletions(-)
diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4
index 77fd346..3d28252 100644
--- a/m4/ax_prog_cc_for_build.m4
+++ b/m4/ax_prog_cc_for_build.m4
@@ -1,5 +1,5 @@
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
+# https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
# ===========================================================================
#
# SYNOPSIS
@@ -32,28 +32,34 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 8
+#serial 21
+# With patches not yet merged upstream
+# <https://savannah.gnu.org/patch/index.php?10452>
AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
dnl Use the standard macros, but make them use other variable names
dnl
pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
+pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl
+pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl
+pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl
+pushdef([ac_cv_prog_cc_c23], ac_cv_build_prog_cc_c23)dnl
+pushdef([ac_cv_prog_cc_stdc], ac_cv_build_prog_cc_stdc)dnl
pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
-pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
-pushdef([ac_cv_objext], ac_cv_build_objext)dnl
+pushdef([ac_prog_cc_stdc], ac_build_prog_cc_stdc)dnl
pushdef([ac_exeext], ac_build_exeext)dnl
pushdef([ac_objext], ac_build_objext)dnl
pushdef([CC], CC_FOR_BUILD)dnl
pushdef([CPP], CPP_FOR_BUILD)dnl
+pushdef([GCC], GCC_FOR_BUILD)dnl
pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
@@ -67,27 +73,58 @@ pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
pushdef([ac_cv_host_os], ac_cv_build_os)dnl
-pushdef([ac_cpp], ac_build_cpp)dnl
-pushdef([ac_compile], ac_build_compile)dnl
-pushdef([ac_link], ac_build_link)dnl
+pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl
+pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl
+pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl
+pushdef([cross_compiling], cross_compiling_build)dnl
+dnl
+dnl These variables are problematic to rename by M4 macros, so we save
+dnl their values in alternative names, and restore the values later.
+dnl
+dnl _AC_COMPILER_EXEEXT and _AC_COMPILER_OBJEXT internally call
+dnl AC_SUBST which prevents the renaming of EXEEXT and OBJEXT
+dnl variables. It's not a good idea to rename ac_cv_exeext and
+dnl ac_cv_objext either as they're related.
+dnl Renaming ac_exeext and ac_objext is safe though.
+dnl
+ac_cv_host_exeext=$ac_cv_exeext
+AS_VAR_SET_IF([ac_cv_build_exeext],
+ [ac_cv_exeext=$ac_cv_build_exeext],
+ [AS_UNSET([ac_cv_exeext])])
+ac_cv_host_objext=$ac_cv_objext
+AS_VAR_SET_IF([ac_cv_build_objext],
+ [ac_cv_objext=$ac_cv_build_objext],
+ [AS_UNSET([ac_cv_objext])])
+dnl
+dnl ac_cv_c_compiler_gnu is used in _AC_LANG_COMPILER_GNU (called by
+dnl AC_PROG_CC) indirectly.
+dnl
+ac_cv_host_c_compiler_gnu=$ac_cv_c_compiler_gnu
+AS_VAR_SET_IF([ac_cv_build_c_compiler_gnu],
+ [ac_cv_c_compiler_gnu=$ac_cv_build_c_compiler_gnu],
+ [AS_UNSET([ac_cv_c_compiler_gnu])])
+
+cross_compiling_build=no
-save_cross_compiling=$cross_compiling
-save_ac_tool_prefix=$ac_tool_prefix
-cross_compiling=no
-ac_tool_prefix=
+ac_build_tool_prefix=
+AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"],
+ [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"])
+AC_LANG_PUSH([C])
AC_PROG_CC
+_AC_COMPILER_EXEEXT
+_AC_COMPILER_OBJEXT
AC_PROG_CPP
-AC_EXEEXT
-ac_tool_prefix=$save_ac_tool_prefix
-cross_compiling=$save_cross_compiling
+BUILD_EXEEXT=$ac_cv_exeext
+BUILD_OBJEXT=$ac_cv_objext
dnl Restore the old definitions
dnl
-popdef([ac_link])dnl
-popdef([ac_compile])dnl
-popdef([ac_cpp])dnl
+popdef([cross_compiling])dnl
+popdef([am_cv_prog_cc_c_o])dnl
+popdef([am_cv_CC_dependencies_compiler_type])dnl
+popdef([ac_tool_prefix])dnl
popdef([ac_cv_host_os])dnl
popdef([ac_cv_host_vendor])dnl
popdef([ac_cv_host_cpu])dnl
@@ -101,24 +138,39 @@ popdef([host])dnl
popdef([LDFLAGS])dnl
popdef([CPPFLAGS])dnl
popdef([CFLAGS])dnl
+popdef([GCC])dnl
popdef([CPP])dnl
popdef([CC])dnl
popdef([ac_objext])dnl
popdef([ac_exeext])dnl
-popdef([ac_cv_objext])dnl
-popdef([ac_cv_exeext])dnl
+popdef([ac_prog_cc_stdc])dnl
popdef([ac_cv_prog_cc_g])dnl
popdef([ac_cv_prog_cc_cross])dnl
popdef([ac_cv_prog_cc_works])dnl
+popdef([ac_cv_prog_cc_stdc])dnl
+popdef([ac_cv_prog_cc_c23])dnl
+popdef([ac_cv_prog_cc_c11])dnl
+popdef([ac_cv_prog_cc_c99])dnl
+popdef([ac_cv_prog_cc_c89])dnl
popdef([ac_cv_prog_gcc])dnl
popdef([ac_cv_prog_CPP])dnl
+dnl
+ac_cv_exeext=$ac_cv_host_exeext
+EXEEXT=$ac_cv_host_exeext
+ac_cv_objext=$ac_cv_host_objext
+OBJEXT=$ac_cv_host_objext
+ac_cv_c_compiler_gnu=$ac_cv_host_c_compiler_gnu
+ac_compiler_gnu=$ac_cv_host_c_compiler_gnu
+
+dnl restore global variables ac_ext, ac_cpp, ac_compile,
+dnl ac_link, ac_compiler_gnu (dependant on the current
+dnl language after popping):
+AC_LANG_POP([C])
dnl Finally, set Makefile variables
dnl
-BUILD_EXEEXT=$ac_build_exeext
-BUILD_OBJEXT=$ac_build_objext
-AC_SUBST(BUILD_EXEEXT)dnl
-AC_SUBST(BUILD_OBJEXT)dnl
+AC_SUBST([BUILD_EXEEXT])dnl
+AC_SUBST([BUILD_OBJEXT])dnl
AC_SUBST([CFLAGS_FOR_BUILD])dnl
AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
AC_SUBST([LDFLAGS_FOR_BUILD])dnl
--
2.55.0

9
package/flex/Config.in Normal file
View File

@@ -0,0 +1,9 @@
config BR2_PACKAGE_FLEX
bool "flex"
help
A fast lexical analyser generator. A tool for generating
programs that perform pattern-matching on text.
Only the library is available.
https://github.com/westes/flex/

4
package/flex/flex.hash Normal file
View File

@@ -0,0 +1,4 @@
# Locally computed:
sha256 e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 flex-2.6.4.tar.gz
# License files, locally calculated
sha256 97fd685958d93be7f8dab939bb8161dbd6afb0718c63bfc337c24321aea44273 COPYING

35
package/flex/flex.mk Normal file
View File

@@ -0,0 +1,35 @@
################################################################################
#
# flex
#
################################################################################
FLEX_VERSION = 2.6.4
FLEX_SITE = https://github.com/westes/flex/files/981163
FLEX_INSTALL_STAGING = YES
FLEX_LICENSE = FLEX
FLEX_LICENSE_FILES = COPYING
FLEX_CPE_ID_VENDOR = westes
# bug does not cause stack overflows in the generated code and has been
# noted upstream as a bug in the code generator
FLEX_IGNORE_CVES = CVE-2019-6293
FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4
HOST_FLEX_DEPENDENCIES = host-m4
# 0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch
# 0002-build-make-it-possible-to-disable-the-build-of-the-f.patch
# 0003-build-make-it-possible-to-disable-the-build-of-the-d.patch
FLEX_AUTORECONF = YES
FLEX_AUTOPOINT = YES
FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 \
ac_cv_func_reallocarray=no
# Don't enable programs, they are not needed on the target, and
# require MMU support.
# Don't enable the doc, it's not needed on the target and requires
# special tools (help2man) to build.
FLEX_CONF_OPTS += --disable-program --disable-doc
HOST_FLEX_CONF_OPTS = --disable-doc
$(eval $(autotools-package))
$(eval $(host-autotools-package))