wireguard: Fix struct sockaddr usage
[platform/upstream/connman.git] / acinclude.m4
1 AC_DEFUN([AC_PROG_CC_PIE], [
2         AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [
3                 echo 'void f(){}' > conftest.c
4                 if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then
5                         ac_cv_prog_cc_pie=yes
6                 else
7                         ac_cv_prog_cc_pie=no
8                 fi
9                 rm -rf conftest*
10         ])
11 ])
12
13 AC_DEFUN([COMPILER_FLAGS], [
14         if (test "${CFLAGS}" = ""); then
15                 CFLAGS="-Wall -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
16         fi
17         if (test "$USE_MAINTAINER_MODE" = "yes"); then
18                 CFLAGS+=" -Werror -Wextra"
19                 CFLAGS+=" -Wno-unused-parameter"
20                 CFLAGS+=" -Wno-missing-field-initializers"
21                 CFLAGS+=" -Wdeclaration-after-statement"
22                 CFLAGS+=" -Wmissing-declarations"
23                 CFLAGS+=" -Wredundant-decls"
24                 CFLAGS+=" -Wcast-align"
25                 CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
26         fi
27 ])