blob: fbc7660dfb6742209191f85422a470037e060dad [file] [log] [blame] [edit]
AC_DEFUN([NEARD_PROG_CC_PIE], [
AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], neard_cv_prog_cc_pie, [
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then
neard_cv_prog_cc_pie=yes
else
neard_cv_prog_cc_pie=no
fi
rm -rf conftest*
])
])
AC_DEFUN([NEARD_COMPILER_FLAGS], [
if (test "${CFLAGS}" = ""); then
CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2"
fi
if (test "$USE_MAINTAINER_MODE" = "yes"); then
CFLAGS+=" -Werror -Wextra"
CFLAGS+=" -Wno-unused-parameter"
CFLAGS+=" -Wno-missing-field-initializers"
CFLAGS+=" -Wdeclaration-after-statement"
CFLAGS+=" -Wmissing-declarations"
CFLAGS+=" -Wredundant-decls"
CFLAGS+=" -Wcast-align"
CFLAGS+=" -DG_DISABLE_DEPRECATED"
fi
])