Revision efd6d12b

View differences:

aclocal.m4
133 133
fi
134 134
])
135 135

  
136
AC_DEFUN(BIRD_CHECK_GCC_OPTIONS,
137
[AC_CACHE_VAL(bird_cv_c_option_no_pointer_sign, [
138
cat >conftest.c <<EOF
139
int main(void)
140
{ return 0; }
141
EOF
142
if $CC -Wall -Wno-pointer-sign conftest.c >&AS_MESSAGE_LOG_FD 2>&1 ; then
143
	bird_cv_c_option_no_pointer_sign=yes
144
else
145
	bird_cv_c_option_no_pointer_sign=no
146
fi
147
rm -rf conftest* a.out
148
])])
136
AC_DEFUN(BIRD_CHECK_GCC_OPTION,
137
[
138
  bird_tmp_cflags="$CFLAGS"
139

  
140
  CFLAGS="$3 $2"
141
  AC_CACHE_CHECK([whether CC supports $2], $1,
142
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [$1=yes], [$1=no])])
143

  
144
  CFLAGS="$bird_tmp_cflags"
145
])
146

  
147
AC_DEFUN(BIRD_ADD_GCC_OPTION,
148
[
149
  if test "$$1" = yes ; then
150
    CFLAGS="$CFLAGS $2"
151
  fi
152
])
149 153

  
150 154
# BIRD_CHECK_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE])
151 155
# copied autoconf internal _AC_PATH_PROG_FLAVOR_GNU
configure.in
87 87
	AC_MSG_ERROR([This program requires the GNU C Compiler.])
88 88
fi
89 89

  
90
AC_MSG_CHECKING([what CFLAGS should we use])
91 90
if test "$bird_cflags_default" = yes ; then
92
	BIRD_CHECK_GCC_OPTIONS
91
	BIRD_CHECK_GCC_OPTION(bird_cv_c_option_wno_pointer_sign, -Wno-pointer-sign, -Wall)
92
	BIRD_CHECK_GCC_OPTION(bird_cv_c_option_fno_strict_aliasing, -fno-strict-aliasing)
93
	BIRD_CHECK_GCC_OPTION(bird_cv_c_option_fno_strict_overflow, -fno-strict-overflow)
93 94

  
94 95
	CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wno-parentheses"
95
	if test "$bird_cv_c_option_no_pointer_sign" = yes ; then
96
		CFLAGS="$CFLAGS -Wno-pointer-sign"
97
	fi
96
	BIRD_ADD_GCC_OPTION(bird_cv_c_option_wno_pointer_sign, -Wno-pointer-sign)
97
	BIRD_ADD_GCC_OPTION(bird_cv_c_option_fno_strict_aliasing, -fno-strict-aliasing)
98
	BIRD_ADD_GCC_OPTION(bird_cv_c_option_fno_strict_overflow, -fno-strict-overflow)
98 99
fi
100
AC_MSG_CHECKING([CFLAGS])
99 101
AC_MSG_RESULT($CFLAGS)
100 102

  
101 103

  

Also available in: Unified diff