Skip to content

Commit

Permalink
configure: add configure check for GCC -Wold-style-definition
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
  • Loading branch information
akodanev authored and metan-ucw committed Apr 14, 2014
1 parent e61ddba commit 20eb071
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ fi

# END testsuites knobs
LTP_CHECK_FORTIFY_SOURCE
LTP_CHECK_CC_WARN_OLDSTYLE
LTP_CHECK_MKDTEMP
LTP_CHECK_CAPABILITY_SUPPORT
LTP_CHECK_CRYPTO
Expand Down
2 changes: 1 addition & 1 deletion include/mk/config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ DEBUG_CXXFLAGS ?= $(DEBUG_CFLAGS)
OPT_CFLAGS ?= -O2 -fno-strict-aliasing -pipe
OPT_CXXFLAGS ?= $(OPT_CFLAGS)

WCFLAGS ?= -Wall -W -Wold-style-definition
WCFLAGS ?= -Wall -W @GCC_WARN_OLDSTYLE@
WCXXFLAGS ?= $(WCFLAGS)

LDFLAGS += $(WLDFLAGS)
Expand Down
37 changes: 37 additions & 0 deletions m4/ltp-warn_oldstyle.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
dnl Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
dnl
dnl This program is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public License as
dnl published by the Free Software Foundation; either version 2 of
dnl the License, or (at your option) any later version.
dnl
dnl This program is distributed in the hope that it would be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write the Free Software Foundation,
dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
dnl
dnl Author: Alexey Kodanev <alexey.kodanev@oracle.com>
dnl

AC_DEFUN([LTP_CHECK_CC_WARN_OLDSTYLE],[dnl
AC_MSG_CHECKING([if $CC supports -Wold-style-definition])
backup_cflags="$CFLAGS"
CFLAGS="-Wold-style-definition"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([])],
[GCC_WARN_OLDSTYLE="$CFLAGS"]
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
AC_SUBST(GCC_WARN_OLDSTYLE)
CFLAGS="$backup_cflags"
])

0 comments on commit 20eb071

Please sign in to comment.