amatrix

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
git clone git://git.kocotian.pl/amatrix.git
Log | Files | Refs | README | LICENSE

commit c85f375bebf0a1f3b97f0a8e7da28d5249b1b85c
parent 33cae7f639316d24d85faf57a11de3f894713f90
Author: Abishek V Ashok <abishekvashok@gmail.com>
Date:   Sat,  5 Aug 2017 20:53:57 +0530

Enables building without matrix fonts

Fixes bugs caused due to the disabling of matrix fonts option provided
by commit:2869565.

Adds a conditional variable (MATRIX_FONTS) whose value becomes true or
false depending on whether enable_fonts variable has true as it's
value which in turn depends whether the user has passed the
--without-fonts flag. (enable_font is true if --without-fonts flag is
not passed along with configure). The value of MATRIX_FONTS is checked
in Makefile.am and another variable BUILD_FONTS to 0 or 1.
install-data-local in Makefile.am checks for BUILD_FONTS and installs
fonts if BUILD_FONTS is set to 1.

Diffstat:
MMakefile.am | 67+++++++++++++++++++++++++++++++++++++++----------------------------
MMakefile.in | 62++++++++++++++++++++++++++++++++++----------------------------
Mconfigure | 35+++++++++++++++++++++++++++--------
Mconfigure.ac | 7++++---
4 files changed, 104 insertions(+), 67 deletions(-)

diff --git a/Makefile.am b/Makefile.am @@ -3,37 +3,48 @@ cmatrix_SOURCES = cmatrix.c man_MANS = cmatrix.1 -EXTRA_DIST = COPYING INSTALL install-sh\ +if MATRIX_FONTS +BUILD_FONTS = 1 +else +BUILD_FONTS = 0 +endif + +EXTRA_DIST = COPYING INSTALL install-sh \ missing mkinstalldirs matrix.fnt \ matrix.psf.gz mtx.pcf cmatrix.1 cmatrix.spec install-data-local: - @if test -d /usr/share/consolefonts; then \ - echo " Installing matrix fonts in /usr/share/consolefonts..."; \ - $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/share/consolefonts; \ - $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/share/consolefonts; \ - fi - @if test -d /usr/lib/kbd/consolefonts; then \ - echo " Installing matrix fonts in /usr/lib/kbd/consolefonts..."; \ - $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/lib/kbd/consolefonts; \ - $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/lib/kbd/consolefonts; \ - fi - @if test -d /usr/lib/X11/fonts/misc; then \ - echo " Installing X window matrix fonts in /usr/lib/X11/fonts/misc..."; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ - echo " Running mkfontdir /usr/lib/X11/fonts/misc..."; \ - $(MKFONTDIR) /usr/lib/X11/fonts/misc; \ - echo " Done. If this is the first time you have installed CMatrix you will"; \ - echo " probably have to restart X window in order to use the mtx.pcf font."; \ + if test $(BUILD_FONTS) = 1; then \ + if test -d /usr/share/consolefonts; then \ + echo " Installing matrix fonts in /usr/share/consolefonts..."; \ + $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/share/consolefonts; \ + $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/share/consolefonts; \ + fi; \ + if test -d /usr/lib/kbd/consolefonts; then \ + echo " Installing matrix fonts in /usr/lib/kbd/consolefonts..."; \ + $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/lib/kbd/consolefonts; \ + $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/lib/kbd/consolefonts; \ + fi; \ + if test -d /usr/lib/X11/fonts/misc; then \ + echo " Installing X window matrix fonts in /usr/lib/X11/fonts/misc..."; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ + echo " Running mkfontdir /usr/lib/X11/fonts/misc..."; \ + $(MKFONTDIR) /usr/lib/X11/fonts/misc; \ + echo " Done. If this is the first time you have installed CMatrix you will"; \ + echo " probably have to restart X window in order to use the mtx.pcf font."; \ + else \ + if test -d /usr/X11R6/lib/X11/fonts/misc; then \ + echo " Installing X window matrix fonts in /usr/X11R6/lib/X11/fonts/misc..."; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ + echo " Running mkfontdir /usr/X11R6/lib/X11/fonts/misc..."; \ + $(MKFONTDIR) /usr/X11R6/lib/X11/fonts/misc; \ + echo " Done. If this is the first time you have installed CMatrix you will"; \ + echo " probably have to restart X window in order to use the mtx.pcf font."; \ + fi \ + fi; \ else \ - if test -d /usr/X11R6/lib/X11/fonts/misc; then \ - echo " Installing X window matrix fonts in /usr/X11R6/lib/X11/fonts/misc..."; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ - echo " Running mkfontdir /usr/X11R6/lib/X11/fonts/misc..."; \ - $(MKFONTDIR) /usr/X11R6/lib/X11/fonts/misc; \ - echo " Done. If this is the first time you have installed CMatrix you will"; \ - echo " probably have to restart X window in order to use the mtx.pcf font."; \ - fi \ + echo "Not installing matrix fonts"; \ fi + diff --git a/Makefile.in b/Makefile.in @@ -307,7 +307,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ cmatrix_SOURCES = cmatrix.c man_MANS = cmatrix.1 -EXTRA_DIST = COPYING INSTALL install-sh\ +@MATRIX_FONTS_FALSE@BUILD_FONTS = 0 +@MATRIX_FONTS_TRUE@BUILD_FONTS = 1 +EXTRA_DIST = COPYING INSTALL install-sh \ missing mkinstalldirs matrix.fnt \ matrix.psf.gz mtx.pcf cmatrix.1 cmatrix.spec @@ -835,34 +837,38 @@ uninstall-man: uninstall-man1 install-data-local: - @if test -d /usr/share/consolefonts; then \ - echo " Installing matrix fonts in /usr/share/consolefonts..."; \ - $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/share/consolefonts; \ - $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/share/consolefonts; \ - fi - @if test -d /usr/lib/kbd/consolefonts; then \ - echo " Installing matrix fonts in /usr/lib/kbd/consolefonts..."; \ - $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/lib/kbd/consolefonts; \ - $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/lib/kbd/consolefonts; \ - fi - @if test -d /usr/lib/X11/fonts/misc; then \ - echo " Installing X window matrix fonts in /usr/lib/X11/fonts/misc..."; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ - echo " Running mkfontdir /usr/lib/X11/fonts/misc..."; \ - $(MKFONTDIR) /usr/lib/X11/fonts/misc; \ - echo " Done. If this is the first time you have installed CMatrix you will"; \ - echo " probably have to restart X window in order to use the mtx.pcf font."; \ + if test $(BUILD_FONTS) = 1; then \ + if test -d /usr/share/consolefonts; then \ + echo " Installing matrix fonts in /usr/share/consolefonts..."; \ + $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/share/consolefonts; \ + $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/share/consolefonts; \ + fi; \ + if test -d /usr/lib/kbd/consolefonts; then \ + echo " Installing matrix fonts in /usr/lib/kbd/consolefonts..."; \ + $(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/lib/kbd/consolefonts; \ + $(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/lib/kbd/consolefonts; \ + fi; \ + if test -d /usr/lib/X11/fonts/misc; then \ + echo " Installing X window matrix fonts in /usr/lib/X11/fonts/misc..."; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \ + echo " Running mkfontdir /usr/lib/X11/fonts/misc..."; \ + $(MKFONTDIR) /usr/lib/X11/fonts/misc; \ + echo " Done. If this is the first time you have installed CMatrix you will"; \ + echo " probably have to restart X window in order to use the mtx.pcf font."; \ + else \ + if test -d /usr/X11R6/lib/X11/fonts/misc; then \ + echo " Installing X window matrix fonts in /usr/X11R6/lib/X11/fonts/misc..."; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ + $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ + echo " Running mkfontdir /usr/X11R6/lib/X11/fonts/misc..."; \ + $(MKFONTDIR) /usr/X11R6/lib/X11/fonts/misc; \ + echo " Done. If this is the first time you have installed CMatrix you will"; \ + echo " probably have to restart X window in order to use the mtx.pcf font."; \ + fi \ + fi; \ else \ - if test -d /usr/X11R6/lib/X11/fonts/misc; then \ - echo " Installing X window matrix fonts in /usr/X11R6/lib/X11/fonts/misc..."; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ - $(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \ - echo " Running mkfontdir /usr/X11R6/lib/X11/fonts/misc..."; \ - $(MKFONTDIR) /usr/X11R6/lib/X11/fonts/misc; \ - echo " Done. If this is the first time you have installed CMatrix you will"; \ - echo " probably have to restart X window in order to use the mtx.pcf font."; \ - fi \ + echo "Not installing matrix fonts"; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/configure b/configure @@ -627,6 +627,8 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS CURSES_LIB +MATRIX_FONTS_FALSE +MATRIX_FONTS_TRUE MKFONTDIR SETFONT CONSOLECHARS @@ -721,7 +723,7 @@ ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking -enable_fonts +with_fonts enable_debug ' ac_precious_vars='build_alias @@ -1364,9 +1366,13 @@ Optional Features: do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build - --disable-fonts Disable the cmatrix font --enable-debug Enable debugging (def disabled) +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --without-fonts Install cmatrix without cmatrix font + Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -4635,14 +4641,16 @@ if test "$ac_cv_prog_CC" = gcc -o "$ac_cv_prog_CC" = g++; then CFLAGS="$CFLAGS -Wall -Wno-comment" fi -# Check whether --enable-fonts was given. -if test "${enable_fonts+set}" = set; then : - enableval=$enable_fonts; -fi +# Check whether --with-fonts was given. +if test "${with_fonts+set}" = set; then : + withval=$with_fonts; enable_fonts=false +else + enable_fonts=true +fi -if test "x$enable_fonts" != "xno"; then : +if test "x$enable_fonts" != xfalse; then # Extract the first word of "consolechars", so it can be a program name with args. set dummy consolechars; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -4941,7 +4949,6 @@ $as_echo "$as_me: WARNING: " >&2;} fi fi - fi @@ -4951,6 +4958,14 @@ if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi + if test x$enable_fonts = xtrue; then + MATRIX_FONTS_TRUE= + MATRIX_FONTS_FALSE='#' +else + MATRIX_FONTS_TRUE='#' + MATRIX_FONTS_FALSE= +fi + @@ -5088,6 +5103,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${MATRIX_FONTS_TRUE}" && test -z "${MATRIX_FONTS_FALSE}"; then + as_fn_error $? "conditional \"MATRIX_FONTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 diff --git a/configure.ac b/configure.ac @@ -60,9 +60,9 @@ if test "$ac_cv_prog_CC" = gcc -o "$ac_cv_prog_CC" = g++; then fi dnl cmatrix terminal font disable option (default enabled) -AC_ARG_ENABLE([fonts], AS_HELP_STRING([--disable-fonts], [Disable the cmatrix font])) +AC_ARG_WITH([fonts], AS_HELP_STRING([--without-fonts], [Install cmatrix without cmatrix font]), [enable_fonts=false], [enable_fonts=true]) -AS_IF([test "x$enable_fonts" != "xno"], [ +if test "x$enable_fonts" != xfalse; then dnl Check for consolechars and setfonts AC_PATH_PROG(CONSOLECHARS, consolechars, "", $PATH:/usr/bin:/usr/local/bin/sbin:/usr/sbin) AC_PATH_PROG(SETFONT, setfont, "", $PATH:/usr/bin:/usr/local/bin/sbin:/usr/sbin) @@ -121,12 +121,13 @@ AS_IF([test "x$enable_fonts" != "xno"], [ ]) fi fi -]) +fi dnl Parse any configure options LIBS="$LIBS $CURSES_LIB" AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging (def disabled)],) +AM_CONDITIONAL([MATRIX_FONTS], [test x$enable_fonts = xtrue]) AC_SUBST(CURSES_LIB)