Skip to content

Commit b083e44

Browse files
committed
Fix host-gawk build in new systems
Signed-off-by: falkTX <falktx@falktx.com>
1 parent e25ccbb commit b083e44

3 files changed

Lines changed: 81 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
config BR2_PACKAGE_GAWK
2+
bool "gawk"
3+
depends on BR2_USE_WCHAR
4+
depends on BR2_USE_MMU # fork()
5+
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
6+
help
7+
A special-purpose programming language which is data driven
8+
rather than procedural. Allows for simple data-reformatting
9+
jobs with just a few lines of code.
10+
11+
http://www.gnu.org/software/gawk/
12+
13+
comment "gawk needs a toolchain w/ wchar"
14+
depends on BR2_USE_MMU
15+
depends on !BR2_USE_WCHAR
16+
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Locally calculated after checking pgp signature
2+
# https://ftp.gnu.org/gnu/gawk/gawk-5.2.2.tar.xz.sig
3+
# Primary key fingerprint: D196 7C63 7887 1317 7D86 1ED7 DF59 7815 937E C0D2
4+
sha256 3c1fce1446b4cbee1cd273bd7ec64bc87d89f61537471cd3e05e33a965a250e9 gawk-5.2.2.tar.xz
5+
# Locally calculated
6+
sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
################################################################################
2+
#
3+
# gawk
4+
#
5+
################################################################################
6+
7+
GAWK_VERSION = 5.2.2
8+
GAWK_SOURCE = gawk-$(GAWK_VERSION).tar.xz
9+
GAWK_SITE = $(BR2_GNU_MIRROR)/gawk
10+
GAWK_DEPENDENCIES = host-gawk
11+
GAWK_LICENSE = GPL-3.0+
12+
GAWK_LICENSE_FILES = COPYING
13+
14+
ifeq ($(BR2_PACKAGE_LIBSIGSEGV),y)
15+
GAWK_DEPENDENCIES += libsigsegv
16+
endif
17+
18+
# --with-mpfr requires an argument so just let
19+
# configure find it automatically
20+
ifeq ($(BR2_PACKAGE_MPFR),y)
21+
GAWK_DEPENDENCIES += mpfr
22+
else
23+
GAWK_CONF_OPTS += --without-mpfr
24+
endif
25+
26+
# --with-readline requires an argument so just let
27+
# configure find it automatically
28+
ifeq ($(BR2_PACKAGE_READLINE),y)
29+
GAWK_DEPENDENCIES += readline
30+
else
31+
GAWK_CONF_OPTS += --without-readline
32+
endif
33+
34+
# gcc-15 defaults to -std=gnu23 which is incorrectly detected and
35+
# generates build failures in the gnulib copy included in
36+
# m4-1.4.19. We workaround this by forcing the previous gcc default
37+
# standard, which is -std=gnu17 only when host gcc is >= 15. This
38+
# workaround can be removed when m4 will be updated to a version
39+
# including a fix for gcc-15.
40+
ifeq ($(BR2_HOST_GCC_AT_LEAST_11),y)
41+
HOST_GAWK_CONF_ENV = CFLAGS="$(HOST_CFLAGS) -std=gnu17"
42+
endif
43+
44+
HOST_GAWK_CONF_OPTS = --without-readline --without-mpfr
45+
46+
define GAWK_CREATE_SYMLINK
47+
ln -sf gawk $(TARGET_DIR)/usr/bin/awk
48+
endef
49+
50+
GAWK_POST_INSTALL_TARGET_HOOKS += GAWK_CREATE_SYMLINK
51+
52+
define HOST_GAWK_CREATE_SYMLINK
53+
ln -sf gawk $(HOST_DIR)/bin/awk
54+
endef
55+
56+
HOST_GAWK_POST_INSTALL_HOOKS += HOST_GAWK_CREATE_SYMLINK
57+
58+
$(eval $(autotools-package))
59+
$(eval $(host-autotools-package))

0 commit comments

Comments
 (0)