Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 11 additions & 6 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,16 @@ 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)
ifeq ($(enable_doc),true)
INSTALLDATADIRS = $(DESTDIR)$(yashdatadir) $(DESTDIR)$(yashdatadir)/completion $(DESTDIR)$(yashdatadir)/initialization $(DESTDIR)$(mandir)
else
INSTALLDATADIRS = $(DESTDIR)$(yashdatadir) $(DESTDIR)$(yashdatadir)/completion $(DESTDIR)$(yashdatadir)/initialization
endif
INSTALLDIRS = $(INSTALLBINDIRS) $(INSTALLDATADIRS) $(DESTDIR)$(htmldir)
install: install-binary install-data
install-strip: install-binary-strip install-data
Expand All @@ -138,14 +143,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 +168,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
14 changes: 14 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,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 +164,17 @@ do
esac
done

# if the user didn't explicitly specify whether they want docs
# or not, enable them if a2x is found, otherwise disable.
if [ -z "$enable_doc" ]; then
if command -v a2x >/dev/null 2>&1; then
enable_doc="true"
else
printf 'Warning: a2x was not found, documentation will not be built!\n' >&2
enable_doc="false"
fi
fi

if ${help}
then
exec cat <<END
Expand Down Expand Up @@ -195,6 +207,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,6 +1914,7 @@ 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
"
printf '\n\n===== Output variables =====\n%s\n' "${sed_subst_cmd}" >&5

Expand Down
Loading