Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

build-sys: use -Wno-clobbered for some BSD crap

 * extend UL_WARN_ADD() for accept non-default CFLAGS variable
 * add BSD_WARN_CFLAGS with -Wno-clobbered
 * use all this for pg(1) and more(1)

Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information...
commit 7697771d8f1df3576c73153f392285bb8973c117 1 parent b7faf99
@karelzak authored
Showing with 9 additions and 3 deletions.
  1. +3 −0  configure.ac
  2. +4 −3 m4/compiler.m4
  3. +2 −0  text-utils/Makemodule.am
View
3  configure.ac
@@ -120,6 +120,9 @@ UL_WARN_ADD([-Wstrict-prototypes])
UL_WARN_ADD([-Wformat-security])
AC_SUBST([WARN_CFLAGS])
+UL_WARN_ADD([-Wno-clobbered], BSD_WARN_CFLAGS)
+AC_SUBST([BSD_WARN_CFLAGS])
+
dnl libtool-2
LT_INIT
View
7 m4/compiler.m4
@@ -14,10 +14,11 @@ m4_ifdef([AS_VAR_APPEND],
[m4_define([UL_AS_VAR_APPEND],
[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
-# UL_ADD_WARN([parameter])
+# UL_ADD_WARN(COMPILER_OPTION [, VARNAME])
# ------------------------
-# Adds parameter to WARN_CFLAGS if the compiler supports it.
+# Adds parameter to WARN_CFLAGS (or to $VARNAME) if the compiler supports it.
AC_DEFUN([UL_WARN_ADD], [
+ m4_define([warnvarname], m4_default([$2],WARN_CFLAGS))
AS_VAR_PUSHDEF([ul_Warn], [ul_cv_warn_$1])dnl
AC_CACHE_CHECK([whether compiler handles $1], m4_defn([ul_Warn]), [
ul_save_CPPFLAGS="$CPPFLAGS"
@@ -27,6 +28,6 @@ AC_DEFUN([UL_WARN_ADD], [
[AS_VAR_SET(ul_Warn, [no])])
CPPFLAGS="$ul_save_CPPFLAGS"
])
- AS_VAR_IF(ul_Warn, [yes], [UL_AS_VAR_APPEND([WARN_CFLAGS], [" $1"])])
+ AS_VAR_IF(ul_Warn, [yes], [UL_AS_VAR_APPEND(warnvarname, [" $1"])])
])
View
2  text-utils/Makemodule.am
@@ -53,6 +53,7 @@ if BUILD_PG
usrbin_exec_PROGRAMS += pg
dist_man_MANS += text-utils/pg.1
pg_SOURCES = text-utils/pg.c
+pg_CFLAGS = $(AM_CFLAGS) $(BSD_WARN_CFLAGS)
pg_LDADD = $(LDADD) libcommon.la @NCURSES_LIBS@
if HAVE_TINFO
pg_LDADD += -ltinfo
@@ -77,6 +78,7 @@ if BUILD_MORE
bin_PROGRAMS += more
dist_man_MANS += text-utils/more.1
more_SOURCES = text-utils/more.c
+more_CFLAGS = $(AM_CFLAGS) $(BSD_WARN_CFLAGS)
more_LDADD = $(LDADD)
if HAVE_TINFO
more_LDADD += -ltinfo
Please sign in to comment.
Something went wrong with that request. Please try again.