• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1dnl SPDX-License-Identifier: GPL-2.0-or-later
2dnl Copyright (c) 2013 Cyril Hrubis <chrubis@suse.cz>
3
4AC_DEFUN([LTP_CHECK_FORTIFY_SOURCE],[
5	AC_MSG_CHECKING(whether to define _FORTIFY_SOURCE=2)
6	AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7#include <stdio.h>
8
9int main(void)
10{
11#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
12	return 0;
13#else
14# error Compiling without optimalizations
15#endif
16}
17])],[CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
18AC_MSG_RESULT(yes)],
19[AC_MSG_RESULT(no)])
20])
21