From 244588a43c20da024a009108bd7219da8420d824 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 22 Aug 2012 14:06:31 +0200 Subject: [PATCH] Make documentation optional. --- ChangeLog | 8 ++++++++ Makefile.in | 5 +++-- configure.ac | 28 ++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88a767aa..451f4b3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-08-22 Niels Möller + + From Sam Thursfield : + * configure.ac: Make documentation optional, to avoid requiring + TeX. New option --disable-documentation, and Makefile substitution + IF_DOCUMENTATION. + * Makefile.in: Use IF_DOCUMENTATION. + 2012-07-12 Niels Möller * asm.m4 (ALIGN): Use << operator rather than **, with m4 eval. diff --git a/Makefile.in b/Makefile.in index be0de3cd..cf935939 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,7 +35,7 @@ TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) twofishdata$(EXEEXT) \ $(LIBTARGETS) @IF_SHARED@ $(SHLIBTARGETS) IMPLICIT_TARGETS = @IF_DLL@ $(LIBNETTLE_FILE) $(LIBHOGWEED_FILE) -DOCTARGETS = nettle.info nettle.html nettle.pdf +DOCTARGETS = @IF_DOCUMENTATION@ nettle.info nettle.html nettle.pdf PKGCONFIG_FILES = nettle.pc @IF_HOGWEED@ hogweed.pc pkgconfigdir = $(libdir)/pkgconfig @@ -302,7 +302,8 @@ hogweed.pc: hogweed.pc.in config.status ./config.status $@ # Installation -install-here: install-info install-headers install-static install-pkgconfig \ +install-doc: @IF_DOCUMENTATION@ install-info +install-here: install-doc install-headers install-static install-pkgconfig \ @IF_SHARED@ install-shared-nettle @IF_HOGWEED@ install-shared-hogweed install-static: $(LIBTARGETS) diff --git a/configure.ac b/configure.ac index 41526764..f6b6d83d 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,10 @@ AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov], [Instrument for gcov (requires a modern gcc)]),, [enable_gcov=no]) +AC_ARG_ENABLE(documentation, + AC_HELP_STRING([--enable-documentation], [Generate TeX documentation (default=auto)]),, + [enable_documentation=auto]) + LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \ `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \ /usr/local/lib /sw/local/lib /sw/lib \ @@ -572,8 +576,31 @@ else IF_SHARED='#' fi +# Documentation tools +if test "x$enable_documentation" != "xno"; then + AC_PATH_PROG(MAKEINFO, makeinfo, not-found) + + if test "x$MAKEINFO" != "xnot-found"; then + enable_documentation=yes + AC_SUBST(MAKEINFO) + else + if test "x$enable_documentation" == "xauto" ; then + enable_documentation=no + else + AC_MSG_ERROR([Cannot find 'makeinfo', required for documentation.]) + fi + fi +fi + +if test "x$enable_documentation" = "xyes" ; then + IF_DOCUMENTATION='' +else + IF_DOCUMENTATION='#' +fi + AC_SUBST(IF_HOGWEED) AC_SUBST(IF_SHARED) +AC_SUBST(IF_DOCUMENTATION) AC_SUBST(IF_DLL) OPENSSL_LIBFLAGS='' @@ -656,4 +683,5 @@ AC_MSG_NOTICE([summary of build options: Compiler: ${CC} Shared libraries: ${enable_shared} Public key crypto: ${enable_public_key} + Documentation: ${enable_documentation} ]) -- GitLab