diff --git a/package/enscript/0002-Add-CFLAG-std-c89-so-it-compiles-with-the-old-standa.patch b/package/enscript/0002-Add-CFLAG-std-c89-so-it-compiles-with-the-old-standa.patch new file mode 100644 index 0000000000..a75454af7b --- /dev/null +++ b/package/enscript/0002-Add-CFLAG-std-c89-so-it-compiles-with-the-old-standa.patch @@ -0,0 +1,29 @@ +From c0c7e9ad51b2e9aebea46f0179446fcf896f8d63 Mon Sep 17 00:00:00 2001 +From: Wim Stockman +Date: Fri, 20 Feb 2026 10:51:37 +0100 +Subject: [PATCH] Add CFLAG=-std=c89 so it compiles with the old standard, + modern standard gives problems + +Upstream: https://git.savannah.gnu.org/cgit/enscript.git/commit/?id=111ad375a6e598c896441e10f4cf1e2fc1496c42 +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 465100a..b867912 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -10,6 +10,9 @@ AC_PROG_INSTALL + + AC_PROG_CC + ++# Force C89 standard and fix modern GCC global variable handling ++CFLAGS="$CFLAGS -std=c89" ++ + AC_USE_SYSTEM_EXTENSIONS + AM_C_PROTOTYPES + +-- +2.55.0 + diff --git a/package/enscript/0002-enscript-c23.patch b/package/enscript/0002-enscript-c23.patch deleted file mode 100644 index 707674935d..0000000000 --- a/package/enscript/0002-enscript-c23.patch +++ /dev/null @@ -1,19 +0,0 @@ -Fix build with gcc 15.x - -Upstream: https://savannah.gnu.org/bugs/?66845 - -Signed-off-by: Bernd Kuhls - -diff --git a/compat/regex.c b/compat/regex.c -index c6907f3..87f2840 100644 ---- a/compat/regex.c -+++ b/compat/regex.c -@@ -336,7 +336,7 @@ typedef char boolean; - #define false 0 - #define true 1 - --static int re_match_2_internal (); -+static int re_match_2_internal (struct re_pattern_buffer*, const char*, int, const char*, int, int, struct re_registers*, int); - - /* These are the command codes that appear in compiled regular - expressions. Some opcodes are followed by argument bytes. A diff --git a/package/enscript/0003-Automake-1.12-and-up-no-longer-supports-pre-ANSI.patch b/package/enscript/0003-Automake-1.12-and-up-no-longer-supports-pre-ANSI.patch new file mode 100644 index 0000000000..241c87493f --- /dev/null +++ b/package/enscript/0003-Automake-1.12-and-up-no-longer-supports-pre-ANSI.patch @@ -0,0 +1,28 @@ +From d74ef70aec3fe9e5e27468f31532eb41188707cf Mon Sep 17 00:00:00 2001 +From: Werner Fink +Date: Tue, 23 Jan 2018 15:26:45 +0100 +Subject: [PATCH] Automake 1.12 and up no longer supports pre-ANSI + +Signed-off-by: Werner Fink +Signed-off-by: James Cloos +Upstream: https://git.savannah.gnu.org/cgit/enscript.git/commit/?id=a356d343aa9db52b75432cde927b6f9bad6a7c44 +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index b867912..4431cb1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -14,7 +14,6 @@ AC_PROG_CC + CFLAGS="$CFLAGS -std=c89" + + AC_USE_SYSTEM_EXTENSIONS +-AM_C_PROTOTYPES + + AC_C_CONST + AC_FUNC_ALLOCA +-- +2.55.0 + diff --git a/package/enscript/0004-Fix-prototype-detection-when-__STDC__-is-defined-but.patch b/package/enscript/0004-Fix-prototype-detection-when-__STDC__-is-defined-but.patch new file mode 100644 index 0000000000..e7eff1c180 --- /dev/null +++ b/package/enscript/0004-Fix-prototype-detection-when-__STDC__-is-defined-but.patch @@ -0,0 +1,107 @@ +From 83238ba35f966bb35a065e6d141f3ccf714f4324 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 22 Aug 2026 14:50:56 +0200 +Subject: [PATCH] Fix prototype detection when __STDC__ is defined but + PROTOTYPES is not + +Commit a356d343aa9db52b75432cde927b6f9bad6a7c44 ("Automake 1.12 and up +no longer supports pre-ANSI") dropped the AM_C_PROTOTYPES call from +configure.ac, so PROTOTYPES is no longer defined by configure. The +headers' fallback to K&R-style prototypes breaks compilation with +modern compilers. + +Check for __STDC__ directly as a fallback, which is defined by all +conforming C89/C99 compilers. + +Upstream: https://savannah.gnu.org/bugs/index.php?68633 +Signed-off-by: Thomas Petazzoni +--- + afmlib/afm.h | 2 +- + afmlib/afmint.h | 2 +- + afmlib/strhash.h | 2 +- + compat/xalloc.h | 2 +- + src/gsint.h | 2 +- + states/defs.h | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/afmlib/afm.h b/afmlib/afm.h +index 19855ce..a79648d 100644 +--- a/afmlib/afm.h ++++ b/afmlib/afm.h +@@ -24,7 +24,7 @@ + #define AFM_H + + #ifndef ___P +-#if PROTOTYPES ++#if defined(__STDC__) || defined(PROTOTYPES) + #define ___P(protos) protos + #else /* no PROTOTYPES */ + #define ___P(protos) () +diff --git a/afmlib/afmint.h b/afmlib/afmint.h +index 7995ae5..aee449a 100644 +--- a/afmlib/afmint.h ++++ b/afmlib/afmint.h +@@ -34,7 +34,7 @@ + #include + + #ifndef ___P +-#if PROTOTYPES ++#if defined(__STDC__) || defined(PROTOTYPES) + #define ___P(protos) protos + #else /* no PROTOTYPES */ + #define ___P(protos) () +diff --git a/afmlib/strhash.h b/afmlib/strhash.h +index 938b2de..a91c0a9 100644 +--- a/afmlib/strhash.h ++++ b/afmlib/strhash.h +@@ -24,7 +24,7 @@ + #define STRHASH_H + + #ifndef ___P +-#if PROTOTYPES ++#if defined(__STDC__) || defined(PROTOTYPES) + #define ___P(protos) protos + #else /* no PROTOTYPES */ + #define ___P(protos) () +diff --git a/compat/xalloc.h b/compat/xalloc.h +index 203bcb8..fd50b68 100644 +--- a/compat/xalloc.h ++++ b/compat/xalloc.h +@@ -28,7 +28,7 @@ + #define XALLOC_H + + #ifndef ___P +-#if PROTOTYPES ++#if defined(__STDC__) || defined(PROTOTYPES) + #define ___P(protos) protos + #else /* no PROTOTYPES */ + #define ___P(protos) () +diff --git a/src/gsint.h b/src/gsint.h +index 3c2527a..001961c 100644 +--- a/src/gsint.h ++++ b/src/gsint.h +@@ -39,7 +39,7 @@ + #include + + #ifndef ___P +-#if PROTOTYPES ++#if defined(__STDC__) || defined(PROTOTYPES) + #define ___P(protos) protos + #else /* no PROTOTYPES */ + #define ___P(protos) () +diff --git a/states/defs.h b/states/defs.h +index 2808900..63155a9 100644 +--- a/states/defs.h ++++ b/states/defs.h +@@ -37,7 +37,7 @@ + #include + + #ifndef ___P +-#if PROTOTYPES ++#if defined(__STDC__) || defined(PROTOTYPES) + #define ___P(protos) protos + #else /* no PROTOTYPES */ + #define ___P(protos) () +-- +2.55.0 + diff --git a/package/enscript/0005-Use-std-gnu89-instead-of-std-c89.patch b/package/enscript/0005-Use-std-gnu89-instead-of-std-c89.patch new file mode 100644 index 0000000000..4e42d75aa5 --- /dev/null +++ b/package/enscript/0005-Use-std-gnu89-instead-of-std-c89.patch @@ -0,0 +1,35 @@ +From be920933dbe1fb73c27fecb280200f6f06abfdc2 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 22 Aug 2026 15:19:17 +0200 +Subject: [PATCH] Use -std=gnu89 instead of -std=c89 + +-std=c89 suppresses feature test macros, which causes to +not define PATH_MAX on certain C libraries (e.g. musl). Using +-std=gnu89 enables _GNU_SOURCE and other extensions, ensuring +PATH_MAX and other POSIX constants are available. + +This most notably fixes the build with the musl C library. + +Upstream: https://savannah.gnu.org/bugs/index.php?68634 +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 4431cb1..46ea59d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -11,7 +11,8 @@ AC_PROG_INSTALL + AC_PROG_CC + + # Force C89 standard and fix modern GCC global variable handling +-CFLAGS="$CFLAGS -std=c89" ++# Use GNU89 to access PATH_MAX in ++CFLAGS="$CFLAGS -std=gnu89" + + AC_USE_SYSTEM_EXTENSIONS + +-- +2.55.0 + diff --git a/package/enscript/enscript.mk b/package/enscript/enscript.mk index 441ae3dad4..1eb5d6d854 100644 --- a/package/enscript/enscript.mk +++ b/package/enscript/enscript.mk @@ -9,6 +9,10 @@ ENSCRIPT_SITE = $(BR2_GNU_MIRROR)/enscript ENSCRIPT_LICENSE = GPL-3.0+ ENSCRIPT_LICENSE_FILES = COPYING ENSCRIPT_CPE_ID_VENDOR = gnu +# 0002-Add-CFLAG-std-c89-so-it-compiles-with-the-old-standa.patch +# 0003-Automake-1.12-and-up-no-longer-supports-pre-ANSI.patch +# 0005-Use-std-gnu89-instead-of-std-c89.patch +ENSCRIPT_AUTORECONF = YES # Enable pthread threads if toolchain supports threads ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)