1 dnl SPDX-License-Identifier: GPL-2.0-only
2 dnl SPDX-FileCopyrightText: EfficiOS Inc.
4 AC_INIT([argpar], [0.1.0])
5 AC_USE_SYSTEM_EXTENSIONS
7 AM_INIT_AUTOMAKE([foreign])
10 AC_CONFIG_MACRO_DIRS([m4])
12 # Depend on glib just for the tests.
13 PKG_CHECK_MODULES([GLIB], [glib-2.0])
15 # When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS.
17 AE_FEATURE_DEFAULT_DISABLE
18 AE_FEATURE([Werror],[Treat compiler warnings as errors.])
20 # Detect warning flags supported by the C compiler and append them to
23 m4_define([WARN_FLAGS_LIST], [ dnl
26 -Wmissing-prototypes dnl
27 -Wmissing-declarations dnl
28 -Wnull-dereference dnl
32 -Wjump-misses-init dnl
33 -Wsuggest-attribute=format dnl
34 -Wtautological-constant-out-of-range-compare dnl
39 -Wmissing-noreturn dnl
42 -Wduplicated-branches dnl
46 AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CFLAGS], [-Werror])
47 AE_IF_FEATURE_ENABLED([Werror], [WARN_CFLAGS="${WARN_CFLAGS} -Werror"])
48 AM_CFLAGS="${AM_CFLAGS} ${WARN_CFLAGS}"