-SUBDIRS = www
+SUBDIRS =
+if BUILD_WWW
+SUBDIRS += www
+endif
if USE_NLS
SUBDIRS += po
endif
AC_DEFINE(HAVE_DTLS1_STOP_TIMER, [1], [OpenSSL has dtls1_stop_timer() function]),
,,${OPENSSL_LIBS})
-AC_OUTPUT(Makefile openconnect.pc po/Makefile.in)
+AC_PATH_PROG(PYTHON, [python], [], $PATH:/bin:/usr/bin)
+if (test -n "${ac_cv_path_PYTHON}"); then
+ AC_SUBST(PYTHON, ${ac_cv_path_PYTHON})
+else
+ AC_MSG_NOTICE([Python not found; not building HTML pages])
+fi
+AM_CONDITIONAL(BUILD_WWW, [test -n "${ac_cv_path_PYTHON}"])
+
+AC_OUTPUT(Makefile openconnect.pc po/Makefile.in www/Makefile \
+ www/styles/Makefile www/inc/Makefile www/images/Makefile)
+++ /dev/null
-#
-CONV = "./html.py"
-
-FTR_PAGES := csd.html features.html gui.html nonroot.html
-START_PAGES := building.html connecting.html manual.html started.html vpnc-script.html
-MAIN_PAGES := changelog.html download.html index.html packages.html platforms.html
-TARGETS = $(FTR_PAGES) $(START_PAGES) $(MAIN_PAGES)
-
-all: $(TARGETS)
-
-$(TARGETS): %.html: %.xml inc/*.tmpl menu1.xml
- $(CONV) -f $< || (rm $@; exit 1)
-
-clean:
- rm -f $(TARGETS) openconnect.8.inc
-
-$(FTR_PAGES): menu2-features.xml
-$(START_PAGES): menu2-started.xml
-$(MAIN_PAGES): menu2.xml
-
-manual.html: openconnect.8.inc
-openconnect.8.inc: ../openconnect.8
- groff -t -K UTF-8 -mandoc -Txhtml $^ | sed -e '1,/<body>/d' -e '/<\/body>/,$$d' > $@
--- /dev/null
+#
+
+SUBDIRS = styles inc images
+CONV = "./html.py"
+
+FTR_PAGES = csd.html features.html gui.html nonroot.html
+START_PAGES = building.html connecting.html manual.html started.html vpnc-script.html
+INDEX_PAGES = changelog.html download.html index.html packages.html platforms.html
+TOPLEVEL_PAGES = contribute.html mail.html technical.html
+
+ALL_PAGES = $(FTR_PAGES) $(START_PAGES) $(INDEX_PAGES) $(TOPLEVEL_PAGES)
+
+pkgdata_DATA = $(ALL_PAGES)
+
+.xml.html:
+ $(PYTHON) $(CONV) -f $< || (rm $@; exit 1)
+
+clean-local:
+ rm -f $(ALL_PAGES) openconnect.8.inc
+
+$(ALL_PAGES): menu1.xml inc/*.tmpl
+$(FTR_PAGES): menu2-features.xml
+$(START_PAGES): menu2-started.xml
+$(MAIN_PAGES): menu2.xml
+
+manual.html: openconnect.8.inc
+openconnect.8.inc: ../openconnect.8
+ groff -t -K UTF-8 -mandoc -Txhtml $^ | sed -e '1,/<body>/d' -e '/<\/body>/,$$d' > $@
+
+EXTRA_DIST = $(patsubst %.html,%.xml,$(ALL_PAGES)) menu1.xml menu2*.xml html.py
--- /dev/null
+imagesdir = $(pkgdatadir)/images
+dist_images_DATA = *.png *.svg
+
--- /dev/null
+tmpldatadir = $(pkgdatadir)/inc
+dist_tmpldata_DATA = *.tmpl
+
--- /dev/null
+stylesdatadir = $(pkgdatadir)/styles
+dist_stylesdata_DATA = main.css
+