#!/usr/bin/make -f

# gcc-15 defaults to -std=gnu23 (C23): in C23 an empty parameter list ()
# is a strict zero-parameter prototype, which breaks the old K&R-style
# GNU regex code in src/regex/regex.c ("too many arguments to function").
# Force -std=gnu17 to restore the C standard used by the previously
# successful gcc-12 based builds (arm64/loong64/riscv64).
override_dh_auto_configure:
	dh_auto_configure -- CFLAGS="$(CFLAGS) -std=gnu17"

# src/regex/Makefile hardcodes CFLAGS = -g and ignores configure-time
# CFLAGS, so pass the dialect through CPPFLAGS (used in its compile rule).
override_dh_auto_build:
	dh_auto_build -- CPPFLAGS="-std=gnu17"

%:
	dh $@ --with autotools_dev
