Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ htmldir = @htmldir@

default_loadpath = @default_loadpath@
enable_nls = @enable_nls@
enable_doc = @enable_doc@

all: $(TARGET) share/config tester mofiles docs

Expand Down Expand Up @@ -119,12 +120,12 @@ mofiles: _PHONY
@+(cd po && $(MAKE))

docs:
-@+(cd doc && $(MAKE))
-@+if $(enable_doc); then (cd doc && $(MAKE)); fi
man html:
-@+(cd doc && $(MAKE) $@-rec)
-@+if $(enable_doc); then (cd doc && $(MAKE) $@-rec); fi

INSTALLBINDIRS = $(DESTDIR)$(bindir)
INSTALLDATADIRS = $(DESTDIR)$(yashdatadir) $(DESTDIR)$(yashdatadir)/completion $(DESTDIR)$(yashdatadir)/initialization $(DESTDIR)$(mandir)
INSTALLDATADIRS = $(DESTDIR)$(yashdatadir) $(DESTDIR)$(yashdatadir)/completion $(DESTDIR)$(yashdatadir)/initialization@doc_mandir@
INSTALLDIRS = $(INSTALLBINDIRS) $(INSTALLDATADIRS) $(DESTDIR)$(htmldir)
install: install-binary install-data
install-strip: install-binary-strip install-data
Expand All @@ -138,14 +139,14 @@ install-data: share/config installdirs-data-main
$(INSTALL_DATA) share/$$file $(DESTDIR)$(yashdatadir)/$$file; \
done
@+if $(enable_nls); then (cd po && $(MAKE) $@); fi
@+(cd doc && $(MAKE) install-rec)
@+if $(enable_doc); then (cd doc && $(MAKE) install-rec); fi
install-html:
@+(cd doc && $(MAKE) $@-rec)
@+if $(enable_doc); then (cd doc && $(MAKE) $@-rec); fi
installdirs: installdirs-binary installdirs-data
installdirs-binary: $(INSTALLBINDIRS)
installdirs-data: installdirs-data-main
@+if $(enable_nls); then (cd po && $(MAKE) $@); fi
@+(cd doc && $(MAKE) installdirs-rec)
@+if $(enable_doc); then (cd doc && $(MAKE) installdirs-rec); fi
installdirs-data-main: $(INSTALLDATADIRS)
installdirs-html: $(DESTDIR)$(htmldir)
$(INSTALLDIRS):
Expand All @@ -163,7 +164,7 @@ uninstall-data:
-rmdir $(DESTDIR)$(yashdatadir)/initialization
-rmdir $(DESTDIR)$(yashdatadir)
@+if $(enable_nls); then (cd po && $(MAKE) $@); fi
@+(cd doc && $(MAKE) $@-rec)
@+if $(enable_doc); then (cd doc && $(MAKE) $@-rec); fi

DISTDIR = $(TARGET)-$(VERSION)
DISTS = $(DISTDIR).tar $(DISTDIR).tar.Z $(DISTDIR).tar.gz $(DISTDIR).tar.bz2 $(DISTDIR).tar.xz $(DISTDIR).shar $(DISTDIR).shar.gz $(DISTDIR).zip
Expand Down
24 changes: 24 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enable_array="true"
enable_dirstack="true"
enable_double_bracket="true"
enable_nls="true"
enable_doc="true"
enable_help="true"
enable_history="true"
enable_lineedit="true"
Expand Down Expand Up @@ -103,6 +104,7 @@ parseenable() {
history) enable_history=$val ;;
lineedit) enable_lineedit=$val ;;
nls) enable_nls=$val ;;
doc) enable_doc=$val ;;
printf) enable_printf=$val ;;
socket) enable_socket=$val ;;
test) enable_test=$val ;;
Expand Down Expand Up @@ -163,6 +165,15 @@ do
esac
done

# if docs aren't disabled and a2x isn't found, error
if [ "$enable_doc" = "true" ]; then
if ! command -v a2x >/dev/null 2>&1; then
printf 'a2x was not found!\n' >&2
printf 'you must either install asciidoc or configure with --disable-doc.\n' >&2
exit 1
fi
fi

if ${help}
then
exec cat <<END
Expand Down Expand Up @@ -195,6 +206,7 @@ Optional features:
--enable-history enable history
--enable-lineedit enable command line editing
--enable-nls enable native language support
--enable-doc enable building the documentation
--enable-printf enable the echo/printf builtins
--enable-socket enable socket redirection by /dev/tcp, /dev/udp
--enable-test enable the test builtin
Expand Down Expand Up @@ -1901,7 +1913,19 @@ s!@docdir@!${docdir}!g
s!@htmldir@!${htmldir}!g
s!@default_loadpath@!${default_loadpath}!g
s!@enable_nls@!${enable_nls}!g
s!@enable_doc@!${enable_doc}!g
"
if [ "$enable_doc" = "true" ]; then
sed_subst_cmd="
$sed_subst_cmd
s!@doc_mandir@! \$\(DESTDIR\)\$\(mandir\)!g
"
else
sed_subst_cmd="
$sed_subst_cmd
s!@doc_mandir@!!g
"
fi
printf '\n\n===== Output variables =====\n%s\n' "${sed_subst_cmd}" >&5


Expand Down
Loading