From 37b5f1105f69c9d5b170ccc8382af4a75ec61e5d Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Mon, 26 Jul 2010 21:31:12 +0200 Subject: [PATCH] build: minor build improvements Add --enable switch for documentation build, build documentation by default and add a few more configure tests. Signed-off-by: Patrick McHardy --- Makefile.defs.in | 2 +- Makefile.in | 4 +--- configure.ac | 12 +++++++++++- doc/Makefile.in | 6 +++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Makefile.defs.in b/Makefile.defs.in index 1c48a98..af20d76 100644 --- a/Makefile.defs.in +++ b/Makefile.defs.in @@ -6,7 +6,7 @@ YACC = @YACC@ MKDIR_P = @MKDIR_P@ LN_S = @LN_S@ INSTALL = @INSTALL@ -DOXYGEN = doxygen +DOXYGEN = @DOXYGEN@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_VERSION = @PACKAGE_VERSION@ diff --git a/Makefile.in b/Makefile.in index ebf99bb..5763e73 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,6 @@ SUBDIRS += include SUBDIRS += src SUBDIRS += example - -docs: - make SUBDIRS=doc +SUBDIRS += doc include Makefile.rules diff --git a/configure.ac b/configure.ac index ab12a40..121e900 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ AC_DEFINE([_GNU_SOURCE], [], [Enable various GNU extensions]) AC_DEFINE([_STDC_FORMAT_MACROS], [], [printf-style format macros]) AC_ARG_ENABLE([debug], - AS_HELP_STRING([--enable-debug], [Enable debugging]), + AS_HELP_STRING([--enable-debug], [enable debugging [yes]]), [CONFIG_DEBUG="$(echo $enableval | cut -b1)"], [CONFIG_DEBUG="y"]) AC_SUBST([CONFIG_DEBUG]) @@ -24,6 +24,13 @@ AC_PROG_CC AC_PROG_MKDIR_P AC_PROG_INSTALL AC_PROG_LN_S +AC_PROG_SED + +AC_ARG_ENABLE([doc], + AS_HELP_STRING([--enable-doc], [build documentation [no]]), + AC_CHECK_PROG(DOXYGEN, doxygen, doxygen), + AC_MSG_NOTICE([Documentation build disabled]) + DOXYGEN=/bin/true) # Checks for libraries. AC_CHECK_LIB([nl], [nl_socket_alloc], , @@ -63,8 +70,11 @@ AC_SUBST(EVENT_CFLAGS) AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE +AC_C_TYPEOF + AC_TYPE_OFF_T AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T AC_TYPE_UID_T AC_TYPE_INT8_T AC_TYPE_INT16_T diff --git a/doc/Makefile.in b/doc/Makefile.in index 000c9d5..5419d76 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,4 +1,8 @@ all: doxygen doxygen: - $(DOXYGEN) $(SUBDIR)Doxyfile + if test -n "$(DOXYGEN)"; then \ + $(DOXYGEN) $(SUBDIR)Doxyfile; \ + else \ + echo "Doxygen not found, can not build documentation"; \ + fi