package/dhcp: fix build with gcc-15.x

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Bernd Kuhls
2025-05-13 22:05:38 +02:00
committed by Julien Olivain
parent 778da2b719
commit 140f8fc628

View File

@@ -27,10 +27,17 @@ define DHCP_LIBTOOL_AUTORECONF
cp $(@D)/configure.ac+lt $(@D)/configure.ac
endef
# gcc-15 defaults to -std=gnu23 which introduces build failures.
# We force "-std=gnu17" for gcc version supporting it. Earlier gcc
# versions will work, since they are using the older standard.
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y)
DHCP_GCC_OPTS = -std=gnu17
endif
DHCP_CONF_ENV = \
CPPFLAGS='-D_PATH_DHCPD_CONF=\"/etc/dhcp/dhcpd.conf\" \
-D_PATH_DHCLIENT_CONF=\"/etc/dhcp/dhclient.conf\"' \
CFLAGS='$(TARGET_CFLAGS) -DISC_CHECK_NONE=1'
CFLAGS='$(TARGET_CFLAGS) -DISC_CHECK_NONE=1 $(DHCP_GCC_OPTS)'
DHCP_BIND_EXTRA_CONFIG = \
--build=$(GNU_HOST_NAME) \