Commit 93496e10 authored by Marius Gerbershagen's avatar Marius Gerbershagen

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.
parent 1ad91df1
......@@ -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.
......
......@@ -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<lib dir> 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
......
......@@ -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 ======================================================================
......
......@@ -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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment