summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-04-03 07:01:17 (GMT)
committerAlexey Neyman <stilor@att.net>2018-04-07 19:03:17 (GMT)
commitbb6c97551f7cfafea811367de0a6f382d9aec36b (patch)
tree15291810af95d2e19be89a14be669a532f69c31b
parent56d785bd006ab823caf39fc16e2ae6833ef2d780 (diff)
User manual installation
... when running from a release tarball. Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r--Makefile.am25
-rw-r--r--configure.ac12
-rw-r--r--docs/MANUAL_ONLINE5
-rwxr-xr-xmaintainer/download-docs.sh30
-rw-r--r--samples/samples.mk1
5 files changed, 64 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index e89523c..a331832 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,14 +7,33 @@ SUBDIRS = kconfig
bin_SCRIPTS = ct-ng
CLEANFILES = $(bin_SCRIPTS)
-EXTRA_DIST = ct-ng.in bootstrap
+EXTRA_DIST = ct-ng.in bootstrap docs/ct-ng.1.in
man1_MANS = docs/ct-ng.1
# paths.sh generated by configure
nobase_dist_pkgdata_DATA = $(verbatim_data) paths.sh
-
+USER_MANUAL_FILES = \
+ docs/manual/1_Introduction.md \
+ docs/manual/2_Installation.md \
+ docs/manual/3_Configuration.md \
+ docs/manual/4_Building.md \
+ docs/manual/5_Toolchain_Usage.md \
+ docs/manual/6_Toolchain_Types.md \
+ docs/manual/7_Contributing.md \
+ docs/manual/8_Internals.md \
+ docs/manual/9_Toolchain_Construction.md \
+ docs/manual/A_Credits.md \
+ docs/manual/B_Known_issues.md \
+ docs/manual/C_Setup_OS.md \
+ docs/manual/D_Tutorials_features.md
+
+if INSTALL_USER_MANUAL
+doc_DATA = $(USER_MANUAL_FILES)
+else
+doc_DATA = docs/MANUAL_ONLINE
+endif
do_subst = ( @SED@ \
-e 's,[@]docdir[@],$(docdir),g' \
@@ -30,4 +49,4 @@ docs/ct-ng.1: docs/ct-ng.1.in
$(AM_V_GEN)$(MKDIR_P) docs && $(do_subst) < $< >$@-t && mv -f $@-t $@
dist-hook: maintainer/download-docs.sh
- $< $(top_distdir)
+ $< $(top_distdir) $(USER_MANUAL_FILES)
diff --git a/configure.ac b/configure.ac
index 51e582e..c7b6f5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
AC_PREREQ([2.67])
# FIXME Temporary hack until the next release (we'll switch to plain numeric tags then)
-# TBD need to quote sed expression
+# FIXME need to quote sed expression
AC_INIT(
[crosstool-NG],
[m4_esyscmd_s([git describe --always --dirty | sed s,^crosstool-ng-,,])],
@@ -14,13 +14,16 @@ AC_INIT(
AC_CONFIG_AUX_DIR([scripts])
AC_CONFIG_MACRO_DIR([m4])
-# TBD try to use gnu strictness? Just add the missing files?
+# FIXME try to use gnu strictness? Just add the missing files?
# Set automake defaults:
# - Tarballs are compressed with xz and bzip2
# - Object files are generated in a subdirectory (new default in automake)
# - Request new tar format (old, tar-v7, breaks on long paths we have)
AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz dist-bzip2 subdir-objects tar-pax])
+# Safety check per autoconf best practices
+AC_CONFIG_SRCDIR([ct-ng.in])
+
#--------------------------------------------------------------------
# Allow dummy --{en,dis}able-{static,shared}
AC_ARG_ENABLE(
@@ -274,6 +277,11 @@ AH_BOTTOM([
AX_BUILD_DATE_EPOCH(DATE, [%c])
AC_SUBST([DATE])
+AM_CONDITIONAL([INSTALL_USER_MANUAL], [test ! -f "${srcdir}/docs/MANUAL_ONLINE"])
+AC_MSG_CHECKING([if the manual needs to be installed])
+AM_COND_IF([INSTALL_USER_MANUAL], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+
+# FIXME Retire? We don't want to debug a version that has been mislabeled by a user
# Decorate the version string per user-supplied version.sh, if any
AS_IF(
[test -f version.sh -a -x version.sh],
diff --git a/docs/MANUAL_ONLINE b/docs/MANUAL_ONLINE
index 3f36b42..8457b20 100644
--- a/docs/MANUAL_ONLINE
+++ b/docs/MANUAL_ONLINE
@@ -1 +1,4 @@
-http://crosstool-ng.github.io/docs
+This is a development version of crosstool-NG. It does not ship with
+a user manual; please refer to the online documentation at:
+
+ http://crosstool-ng.github.io/docs
diff --git a/maintainer/download-docs.sh b/maintainer/download-docs.sh
index 5ef3c6a..3514a57 100755
--- a/maintainer/download-docs.sh
+++ b/maintainer/download-docs.sh
@@ -1,6 +1,9 @@
#!/bin/bash
-distdir=${1:-.}
+# Usage:
+# download-docs.sh TOP-LEVEL-DIR MANUAL-FILES...
+distdir=${1}
+shift
# Configurable portions
docs_git=https://github.com/crosstool-ng/crosstool-ng.github.io.git
@@ -12,7 +15,16 @@ git clone --depth=1 "${docs_git}" "${distdir}/site-docs"
# Copy the docs instead of the MANUAL_ONLINE placeholder
mkdir -p "${distdir}/docs/manual"
-for i in "${distdir}/site-docs/${docs_subdir}/"*.md; do
+while [ -n "${1}" ]; do
+ case "${1}" in
+ docs/manual/*) ;;
+ *) echo "Expected file not in docs/manual/: $1" >&2; exit 1;;
+ esac
+ input="${distdir}/site-docs/${docs_subdir}/${1#docs/manual/}"
+ if [ ! -r "${input}" ]; then
+ echo "Not found: ${1}" >&2
+ exit 1
+ fi
awk '
BEGIN { skip=0; }
{
@@ -30,6 +42,18 @@ BEGIN { skip=0; }
print $0
}
}
-' < "${i}" > "${distdir}/docs/manual/${i##*/}"
+ ' < "${input}" > "${distdir}/${1}"
+ rm -f "${input}"
+ shift
+done
+extra_md_pages=false
+for i in "${distdir}/site-docs/${docs_subdir}/"*.md; do
+ if [ -r "${i}" ]; then
+ echo "Unpackaged page in the manual: ${i#${distdir}/site-docs/${docs_subdir}/}"
+ extra_md_files=true
+ fi
done
+if [ "${extra_md_files}" = "true" ]; then
+ exit 1
+fi
rm -rf "${distdir}/site-docs"
diff --git a/samples/samples.mk b/samples/samples.mk
index 178e537..aafac48 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -19,6 +19,7 @@ CT_UPDATE_SAMPLES := no
# This part deals with the samples help entries
help-config::
+ @echo ' show-config - show a brief overview of current configuration'
@echo ' saveconfig - Save current config as a preconfigured target'
help-samples::