X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=configure.ac;h=89b34ae7313ef0b183a625cc2692bd22902ec423;hp=e6b9211c87a76ecf44884768b8c446a7f2cbf768;hb=2388c075d46055bd33ee824c399d72c219b98d90;hpb=0614a2e61ccbf150cc51d4fd3073b285983417c5 diff --git a/configure.ac b/configure.ac index e6b9211..89b34ae 100644 --- a/configure.ac +++ b/configure.ac @@ -6,9 +6,9 @@ dnl Process this file with autoconf to produce a configure script. # Project version information m4_define([urcu_version_major], [0]) -m4_define([urcu_version_minor], [12]) +m4_define([urcu_version_minor], [13]) m4_define([urcu_version_patch], [0]) -m4_define([urcu_version_dev_stage], []) +m4_define([urcu_version_dev_stage], [-pre]) m4_define([urcu_version], urcu_version_major[.]urcu_version_minor[.]urcu_version_patch[]urcu_version_dev_stage) # Library version information of "liburcu" @@ -96,6 +96,39 @@ AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T +# Detect warning flags supported by the C compiler and append them to +# WARN_CFLAGS. +m4_define([WARN_FLAGS_LIST], [ dnl + -Wall dnl + -Wextra dnl + -Wmissing-prototypes dnl + -Wmissing-declarations dnl + -Wnull-dereference dnl + -Wundef dnl + -Wshadow dnl + -Wjump-misses-init dnl + -Wsuggest-attribute=format dnl + -Wtautological-constant-out-of-range-compare dnl + -Wnested-externs dnl + -Wwrite-strings dnl + -Wformat=2 dnl + -Wstrict-aliasing dnl + -Wmissing-noreturn dnl + -Winit-self dnl + -Wduplicated-cond dnl + -Wduplicated-branches dnl + -Wlogical-op dnl + dnl + dnl-Wredundant-decls dnl + -Wno-null-dereference dnl +]) + +# Pass -Werror as an extra flag during the test: this is needed to make the +# -Wunknown-warning-option diagnostic fatal with clang. +AC_LANG_PUSH([C]) +AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CFLAGS], [-Werror]) +AC_LANG_POP([C]) + ## ## ## Header checks ## @@ -118,7 +151,7 @@ AC_PROG_AWK AC_PROG_GREP AC_PROG_MAKE_SET AC_CHECK_PROGS(NPROC, [nproc gnproc]) -AC_CHECK_PROG(GETCONF, [getconf]) +AC_CHECK_PROGS(GETCONF, [getconf]) AS_IF([test "x$NPROC" != "x"], [NPROC_CMD=$NPROC], [AS_IF([test "x$GETCONF" != "x"], @@ -238,10 +271,13 @@ AC_SUBST([URCU_LIBRARY_VERSION], [urcu_lib_version]) AC_SUBST(LT_NO_UNDEFINED) -AM_CPPFLAGS="-include config.h" +# The order in which the include folders are searched is important. +# The top_builddir should always be searched first in the event that a build +# time generated file is included. +AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -include config.h" AC_SUBST(AM_CPPFLAGS) -AM_CFLAGS="-Wall -Wextra -Wno-unused-parameter $PTHREAD_CFLAGS" +AM_CFLAGS="$WARN_CFLAGS $PTHREAD_CFLAGS" AC_SUBST(AM_CFLAGS)