3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

build: Use default compiler flags

This commit is contained in:
Marcel Holtmann 2014-07-15 22:18:59 +02:00
parent 188917cc29
commit c11be930ea
2 changed files with 31 additions and 0 deletions

26
acinclude.m4 Normal file
View File

@ -0,0 +1,26 @@
AC_DEFUN([AC_PROG_CC_PIE], [
AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then
ac_cv_prog_cc_pie=yes
else
ac_cv_prog_cc_pie=no
fi
rm -rf conftest*
])
])
AC_DEFUN([COMPILER_FLAGS], [
if (test "${CFLAGS}" = ""); then
CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2 -fsigned-char"
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"
fi
])

View File

@ -14,7 +14,12 @@ AM_MAINTAINER_MODE
AC_PREFIX_DEFAULT(/usr/local)
COMPILER_FLAGS
AC_LANG_C
AC_PROG_CC
AC_PROG_CC_PIE
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_LN_S