From 93496e108c124e2770e826609a0891d57f5d42b5 Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Tue, 9 Apr 2019 21:56:18 +0200 Subject: [PATCH] configure: change manual installation Introduce a configure option controlling the installation and build the documentation during the build instead of the install phase. Targets for installation of the html version have also been added. Fixes #482. --- src/Makefile.in | 6 ++- src/configure | 103 ++++++++++++++++++++++++++++++++++------ src/configure.ac | 47 ++++++++++++++---- src/doc/Makefile.in | 41 ++++++++++------ src/doc/manual/Makefile | 11 +++-- 5 files changed, 164 insertions(+), 44 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 1ec2f5437..18f0af21f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -72,7 +72,7 @@ LSP_LIBRARIES = @LSP_LIBRARIES@ TARGETS = @TARGETS@ ECL_CMPDIR = @ECL_CMPDIR@ -all: $(TARGETS) bin/ecl-config .git/tags TAGS +all: $(TARGETS) bin/ecl-config .git/tags TAGS doc .PHONY: all .SUFFIXES: .c .o .d .s @@ -186,6 +186,10 @@ build-stamp: config.status echo "#" `uname -a` > $@ head -8 config.log | tail -6 >> $@ +doc: + $(MAKE) -C doc +.PHONY: doc + install: # Here we would use the option -s but the install program in sourceforge-solaris # is broken. diff --git a/src/configure b/src/configure index 049864912..c92a0d0cb 100755 --- a/src/configure +++ b/src/configure @@ -653,8 +653,11 @@ ECL_CMPDIR ECL_GMP_HEADER EGREP GREP +MANUAL_UNINSTALL_TARGET +MANUAL_INSTALL_TARGET +MANUAL_MAKE_TARGET +MAKEINFO INSTALL_INFO -INFOEXT ECL_GC_DIR thehost INSTALL_TARGET @@ -809,13 +812,13 @@ with_debug_cflags with_profile_cflags with_extra_files with_init_form +enable_manual with_x ' ac_precious_vars='build_alias host_alias target_alias ecldir -docdir CC CFLAGS LDFLAGS @@ -1483,6 +1486,8 @@ Optional Features: save externalizable objects in compiled files (EXPERIMENTAL). (no|yes, default=NO) --enable-debug enable various debugging features (default=NO) + --with-manual={auto|html|info|no} + Enable building of the manual (default=AUTO) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1548,7 +1553,6 @@ Optional Packages: Some influential environment variables: ecldir the directory where *.fas files are installed - docdir the directory where documentation is installed CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a @@ -3055,11 +3059,16 @@ else fi +# Check whether --enable-manual was given. +if test "${enable_manual+set}" = set; then : + enableval=$enable_manual; enable_manual=${enableval} +else + enable_manual=auto +fi -test -z "${ecldir}" && ecldir="${libdir}/ecl-${PACKAGE_VERSION}" -test -z "${docdir}" && docdir="${datadir}/doc/ecl-${PACKAGE_VERSION}" +test -z "${ecldir}" && ecldir="${libdir}/ecl-${PACKAGE_VERSION}" boehm_configure_flags="" @@ -5258,9 +5267,8 @@ SOFTWARE_VERSION="" $as_echo "${SOFTWARE_TYPE} / ${SOFTWARE_VERSION}" >&6; } - - -# Extract the first word of "install-info", so it can be a program name with args. +if test "${enable_manual}" != "no"; then + # Extract the first word of "install-info", so it can be a program name with args. set dummy install-info; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -5273,8 +5281,7 @@ else ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/sbin:/usr/sbin:/usr/etc" -for as_dir in $as_dummy +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. @@ -5288,7 +5295,6 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_INSTALL_INFO" && ac_cv_path_INSTALL_INFO="/bin/true" ;; esac fi @@ -5302,10 +5308,79 @@ $as_echo "no" >&6; } fi -if test -z `which gzip`; then - INFOEXT=info.gz + if test "x${INSTALL_INFO}" = "x"; then + if test "${enable_manual}" = "auto"; then + enable_manual=no + elif test "${enable_manual}" = "info"; then + as_fn_error $? "Unable to build the manual: install-info not found." "$LINENO" 5 + fi + fi + # Extract the first word of "makeinfo", so it can be a program name with args. +set dummy makeinfo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MAKEINFO+:} false; then : + $as_echo_n "(cached) " >&6 else - INFOEXT=info + case $MAKEINFO in + [\\/]* | ?:[\\/]*) + ac_cv_path_MAKEINFO="$MAKEINFO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MAKEINFO="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MAKEINFO=$ac_cv_path_MAKEINFO +if test -n "$MAKEINFO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5 +$as_echo "$MAKEINFO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x${MAKEINFO}" = "x"; then + if test "${enable_manual}" = "auto"; then + enable_manual=no + else + as_fn_error $? "Unable to build the manual: makeinfo not found." "$LINENO" 5 + fi + fi +fi +if test "${enable_manual}" != "no"; then + + + if test "${enable_manual}" = "html"; then + MANUAL_MAKE_TARGET='html' + + MANUAL_INSTALL_TARGET='install-html' + + MANUAL_UNINSTALL_TARGET='uninstall-html' + + else + MANUAL_MAKE_TARGET='info' + + MANUAL_INSTALL_TARGET='install-info' + + MANUAL_UNINSTALL_TARGET='uninstall-info' + + fi fi if test "x$GMP_INCDIR" != "x"; then diff --git a/src/configure.ac b/src/configure.ac index 1656defb0..590d270b2 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -293,14 +293,18 @@ AC_ARG_WITH(init-form, [lisp forms to execute at startup (default="(si::top-level t)")]), [with_init_form="${withval}"], [with_init_form=""]) +AC_ARG_ENABLE(manual, + AS_HELP_STRING( [--with-manual={auto|html|info|no}], + [Enable building of the manual] + [(default=AUTO)]), + [enable_manual=${enableval}], + [enable_manual=auto]) + dnl ----------------------------------------------------------------------- dnl Installation directories AC_ARG_VAR([ecldir], [the directory where *.fas files are installed]) test -z "${ecldir}" && ecldir="${libdir}/ecl-${PACKAGE_VERSION}" AC_SUBST([ecldir]) -AC_ARG_VAR([docdir], [the directory where documentation is installed]) -test -z "${docdir}" && docdir="${datadir}/doc/ecl-${PACKAGE_VERSION}" -AC_SUBST([docdir]) dnl ----------------------------------------------------------------------- dnl Initialize variables. @@ -353,13 +357,36 @@ ECL_MAKE_ABSOLUTE_SRCDIR ECL_CROSS_CONFIG ECL_GUESS_HOST_OS -AC_SUBST(INFOEXT) -AC_SUBST(INSTALL_INFO) -AC_PATH_PROG([INSTALL_INFO], [install-info], [/bin/true], [$PATH:/sbin:/usr/sbin:/usr/etc]) -if test -z `which gzip`; then - INFOEXT=info.gz -else - INFOEXT=info +if test "${enable_manual}" != "no"; then + AC_PATH_PROG([INSTALL_INFO], [install-info], []) + if test "x${INSTALL_INFO}" = "x"; then + if test "${enable_manual}" = "auto"; then + enable_manual=no + elif test "${enable_manual}" = "info"; then + AC_MSG_ERROR([Unable to build the manual: install-info not found.]) + fi + fi + AC_PATH_PROG([MAKEINFO], [makeinfo], []) + if test "x${MAKEINFO}" = "x"; then + if test "${enable_manual}" = "auto"; then + enable_manual=no + else + AC_MSG_ERROR([Unable to build the manual: makeinfo not found.]) + fi + fi +fi +if test "${enable_manual}" != "no"; then + AC_SUBST(INSTALL_INFO) + AC_SUBST(MAKEINFO) + if test "${enable_manual}" = "html"; then + AC_SUBST(MANUAL_MAKE_TARGET, ['html']) + AC_SUBST(MANUAL_INSTALL_TARGET, ['install-html']) + AC_SUBST(MANUAL_UNINSTALL_TARGET, ['uninstall-html']) + else + AC_SUBST(MANUAL_MAKE_TARGET, ['info']) + AC_SUBST(MANUAL_INSTALL_TARGET, ['install-info']) + AC_SUBST(MANUAL_UNINSTALL_TARGET, ['uninstall-info']) + fi fi dnl ====================================================================== diff --git a/src/doc/Makefile.in b/src/doc/Makefile.in index 4502d261e..5660f41a7 100644 --- a/src/doc/Makefile.in +++ b/src/doc/Makefile.in @@ -9,42 +9,55 @@ docdir=@docdir@ datarootdir = @datarootdir@ manext=1 -INFOEXT = @INFOEXT@ SHELL = @SHELL@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_INFO = @INSTALL_INFO@ mkinstalldirs = $(top_srcdir)/bdwgc/install-sh -d -INFO_FILE = ecl.$(INFOEXT) +INFO_FILE = ecl.info.gz +MAKEINFO = @MAKEINFO@ +MANUAL_MAKE_TARGET = @MANUAL_MAKE_TARGET@ +MANUAL_INSTALL_TARGET = @MANUAL_INSTALL_TARGET@ +MANUAL_UNINSTALL_TARGET = @MANUAL_UNINSTALL_TARGET@ VERSION=@PACKAGE_VERSION@ -all: manual - $(MAKE) -C manual +all: $(MANUAL_MAKE_TARGET) manual: cp -r $(srcdir)/manual . -install: install-manual +info: manual + $(MAKE) MAKEINFO=$(MAKEINFO) -C manual info + +html: manual + $(MAKE) MAKEINFO=$(MAKEINFO) -C manual html + +install: $(MANUAL_INSTALL_TARGET) $(mkinstalldirs) $(DESTDIR)$(mandir)/man$(manext) $(INSTALL_DATA) ecl.man $(DESTDIR)$(mandir)/man$(manext)/ecl.$(manext) $(INSTALL_DATA) ecl-config.man $(DESTDIR)$(mandir)/man$(manext)/ecl-config.$(manext) -install-manual: manual - $(MAKE) -C manual info +install-info: $(mkinstalldirs) $(DESTDIR)$(infodir) - gzip < manual/$(INFO_FILE) > manual/$(INFO_FILE).gz - $(INSTALL_DATA) manual/$(INFO_FILE).gz $(DESTDIR)$(infodir) - $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) manual/$(INFO_FILE); + $(INSTALL_DATA) manual/$(INFO_FILE) $(DESTDIR)$(infodir) + $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) manual/$(INFO_FILE) -uninstall: uninstall-manual +install-html: + $(mkinstalldirs) $(DESTDIR)$(docdir)/ecl-$(VERSION) + cp -r manual/html/ $(DESTDIR)$(docdir)/ecl-$(VERSION) + +uninstall: $(MANUAL_UNINSTALL_TARGET) $(RM) $(DESTDIR)$(mandir)/man$(manext)/ecl.$(manext) $(RM) $(DESTDIR)$(mandir)/man$(manext)/ecl-config.$(manext) -uninstall-manual: - $(RM) $(DESTDIR)$(infodir)/$(INFO_FILE).gz - $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) --remove manual/$(INFO_FILE); +uninstall-info: + $(RM) $(DESTDIR)$(infodir)/$(INFO_FILE) + $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) --remove manual/$(INFO_FILE) + +uninstall-html: + $(RM) -r $(DESTDIR)$(docdir)/ecl-$(VERSION) clean: $(MAKE) -C manual clean diff --git a/src/doc/manual/Makefile b/src/doc/manual/Makefile index c377f6163..e7ab5c127 100644 --- a/src/doc/manual/Makefile +++ b/src/doc/manual/Makefile @@ -5,20 +5,21 @@ FILES= *.txi */*.txi figures/* all: pdf info html pdf: manual.pdf -info: ecl.info +info: ecl.info.gz html: html/index.html manual.pdf: $(FILES) texi2pdf manual.txi -ecl.info: $(FILES) - makeinfo --no-split manual.txi +ecl.info.gz: $(FILES) + $(MAKEINFO) --no-split manual.txi + gzip < ecl.info > ecl.info.gz html/index.html: $(FILES) - makeinfo --html --css-include=ecl.css --split=chapter manual.txi + $(MAKEINFO) --html --css-include=ecl.css --split=chapter manual.txi rm -rf html mv ecl html cp -r figures html clean: - rm -rf *.{aux,cf,cfs,cp,cpp,cpps,cps,ex,exs,fn,fns,ft,fts,log,lsp,lsps,toc,tp,tps,vr,vrs,pdf,info,info-1,info-2,html} html + rm -rf *.{aux,cf,cfs,cp,cpp,cpps,cps,ex,exs,fn,fns,ft,fts,log,lsp,lsps,toc,tp,tps,vr,vrs,pdf,info,info-1,info-2,info.gz,html} html -- GitLab