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>
This commit is contained in:
parent
b7faf99128
commit
7697771d8f
|
@ -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
|
||||
|
||||
|
|
|
@ -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"])])
|
||||
])
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue