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