From c9a1d21352154dbd7a306823af411420dae94ade Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Wed, 12 Feb 2025 08:15:53 -0500 Subject: [PATCH] meson: Fix failure to detect bsd_auth.h presence bsd_auth.h file needs to be included after 'sys/types.h', as documented in https://man.openbsd.org/authenticate.3 The reason a similar looking stanza works for autoconf is that autoconf automatically adds AC_INCLUDES_DEFAULT, which in turn includes sys/types.h. Backpatch to all versions with meson support. Author: Nazir Bilal Yavuz Discussion: https://postgr.es/m/637haqqyhg2wlz7q6wq25m2qupe67g7f2uupngzui64zypy4x2@ysr2xnmynmu4 Backpatch-through: 16 --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 55aa329bcaa..1696d68fde6 100644 --- a/meson.build +++ b/meson.build @@ -547,7 +547,8 @@ test_c_args = cppflags + cflags bsd_authopt = get_option('bsd_auth') bsd_auth = not_found_dep if cc.check_header('bsd_auth.h', required: bsd_authopt, - args: test_c_args, include_directories: postgres_inc) + args: test_c_args, prefix: '#include ', + include_directories: postgres_inc) cdata.set('USE_BSD_AUTH', 1) bsd_auth = declare_dependency() endif