bgarrigues pushed a commit to branch automake3 in repository groff. commit 433ff3689e42b3cbc38846d808ee7a286bf94a31 Author: Bertrand Garrigues <bertrand.garrig...@laposte.net> Date: Mon Sep 15 00:25:22 2014 +0200
Detect if built-in variable RM is supported by make. Generate test-groff script. --- Makefile.am | 5 +++++ TESTS | 3 --- configure.ac | 5 +++++ m4/groff.m4 | 15 +++++++++++++++ test-groff.in | 28 +++++----------------------- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/Makefile.am b/Makefile.am index f9db407..1f8bad2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -562,6 +562,11 @@ PDFMOMBIN = $(abs_top_builddir)/pdfmom FFLAG=-F$(abs_top_builddir)/font -F$(abs_top_srcdir)/font TFLAG=-M$(abs_top_builddir)/tmac -M$(abs_top_srcdir)/tmac +# make builtin variable RM +if MAKE_DONT_HAVE_RM +RM = rm -f +endif + # Non-recursive makefile system. See Automake manual '7.3 An # Alternative Approach to Subdirectories'. We use a single Makefile.am # that includes other .am files, rather than using SUBDIRS. Note that diff --git a/TESTS b/TESTS index 9a09950..91cb08b 100644 --- a/TESTS +++ b/TESTS @@ -447,9 +447,6 @@ TODO: README.git TESTS - - Missing files/directories (TODO): - test-groff.in - - Files/directories not present in the git tree that are distributed: build-aux/ diff --git a/configure.ac b/configure.ac index 63541c1..86cc2e4 100644 --- a/configure.ac +++ b/configure.ac @@ -169,6 +169,7 @@ GROFF_TARGET_PATH_SEPARATOR GROFF_HTML_PROGRAMS GROFF_PDFDOC_PROGRAMS GROFF_PNMTOPS_NOSETPAGE +GROFF_MAKE_RM gl_GLIBC21 gl_LOCALCHARSET @@ -182,6 +183,9 @@ gl_LOCALCHARSET # src/libs/libxutil AM_CONDITIONAL([WITHOUT_X11], [test "x$groff_no_x" = "xyes"]) +# make builtin variable RM +AM_CONDITIONAL([MAKE_DONT_HAVE_RM], [test "x$groff_is_rm_defined" = "xno"]) + # Some programs have a "g" prefix if an existing groff installation is detected AM_CONDITIONAL([USEPROGRAMPREFIX], [test x$g = xg]) @@ -195,6 +199,7 @@ AM_CONDITIONAL([BUILD_EXAMPLES], [test -n "$make_examples"]) AM_CONDITIONAL([INSTALL_SHIPPED_HTML], [test -n "$make_install_shipped_htmldoc"]) AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([test-groff], [chmod +x test-groff]) AC_OUTPUT echo " diff --git a/m4/groff.m4 b/m4/groff.m4 index 6579d6f..4f88af3 100644 --- a/m4/groff.m4 +++ b/m4/groff.m4 @@ -1342,3 +1342,18 @@ AC_DEFUN([GROFF_REFERDIR_DEFAULT], # Check for xpmtoppm, for gnu.eps generation AC_DEFUN([GROFF_PROG_XPMTOPPM], [AC_CHECK_PROG([XPMTOPPM], [xpmtoppm], [found], [missing])]) + +# Check for make builtin variable RM +AC_DEFUN([GROFF_MAKE_RM], + [AC_MSG_CHECKING(whether make has builtin variable RM) +cat <<EOF > test_make_rm.mk +all: + @if test -n "\$(RM)"; then \ + echo "yes"; \ + else \ + echo "no"; \ + fi +EOF + groff_is_rm_defined=`make -sf test_make_rm.mk` + AC_MSG_RESULT([$groff_is_rm_defined]) + rm -f test_make_rm.mk]) diff --git a/test-groff.in b/test-groff.in index bf24c60..eb13e01 100644 --- a/test-groff.in +++ b/test-groff.in @@ -20,35 +20,17 @@ # This script runs groff without requiring that it be installed. SEP='@PATH_SEPARATOR@' -builddir=@abs_top_builddir@/src +builddir=@abs_top_builddir@ srcdir=@abs_top_srcdir@ -GROFF_BIN_PATH=\ -$builddir/roff/groff$SEP\ -$builddir/roff/troff$SEP\ -$builddir/preproc/preconv$SEP\ -$builddir/preproc/pic$SEP\ -$builddir/preproc/eqn$SEP\ -$builddir/preproc/tbl$SEP\ -$builddir/preproc/grn$SEP\ -$builddir/preproc/refer$SEP\ -$builddir/preproc/soelim$SEP\ -$builddir/preproc/html$SEP\ -$builddir/devices/grops$SEP\ -$builddir/devices/grodvi$SEP\ -$builddir/devices/grotty$SEP\ -$builddir/devices/grolj4$SEP\ -$builddir/devices/grolbp$SEP\ -$builddir/devices/grohtml$SEP\ -$builddir/devices/gropdf$SEP\ -$builddir/devices/xditview +GROFF_BIN_PATH=$builddir XENVIRONMENT=$srcdir/src/devices/xditview/GXditview.ad export XENVIRONMENT GROFF_COMMAND_PREFIX= -GROFF_FONT_PATH=$builddir/../font$SEP$srcdir/font -GROFF_TMAC_PATH=$srcdir/tmac +GROFF_FONT_PATH=$builddir/font$SEP$srcdir/font +GROFF_TMAC_PATH=$srcdir/tmac$SEP$builddir/tmac$SEP$srcdir/contrib/mom$SEP$builddir/contrib/mom export GROFF_BIN_PATH GROFF_COMMAND_PREFIX GROFF_FONT_PATH GROFF_TMAC_PATH -exec $builddir/roff/groff/groff ${1+"$@"} +exec $builddir/groff ${1+"$@"} _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit