Re: [PATCH 07/33] build-sys: add --disable-setterm to ./configure

Karel Zak
2013-04-26T11:53:10Z

On Sat, Apr 13, 2013 at 08:54:35PM +0100, Sami Kerola wrote:
> +AC_ARG_ENABLE([setterm],
> + AS_HELP_STRING([--disable-setterm], [do not build setterm]),
> + [], enable_setterm=yes
> +)
> +UL_BUILD_INIT([setterm])
> +AM_CONDITIONAL(BUILD_SETTERM, test "x$build_setterm" = xyes)
>
> AC_ARG_ENABLE([schedutils],
> AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
> diff --git a/term-utils/Makemodule.am b/term-utils/Makemodule.am
> index f4fa92d..fdf4d98 100644
> --- a/term-utils/Makemodule.am
> +++ b/term-utils/Makemodule.am
> @@ -24,7 +24,7 @@ agetty_LDADD = $(LDADD) libcommon.la
> endif # BUILD_AGETTY
>
>
> -# TODO: add BUILD_SETTERM to configure.am
> +if BUILD_SETTERM
> if HAVE_NCURSES
> if LINUX
> usrbin_exec_PROGRAMS += setterm
> @@ -37,6 +37,7 @@ else
> setterm_LDADD = $(LDADD) @NCURSES_LIBS@
> endif
> endif
> +endif

I have applied a little different version.

The reason for BUILD_* is to describe and evaluate dependencies
in ./configure rather than in makefiles. So if you have
BUILD_SETTERM than "if LINUX" or "if HAVE_NCURSES" is usually
unwanted, because you can use

UL_BUILD_INIT([setterm])
UL_REQUIRES_LINUX([setterm])
UL_REQUIRES_HAVE([setterm], [ncurses], [ncurses library])
AM_CONDITIONAL(BUILD_SETTERM, test "x$build_setterm" = xyes)

in the configure file.

Karel

--
Karel Zak <kzak@redhat.com>