diff --git a/Makefile.am b/Makefile.am index 98ae1ef2..6a3ed9e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,7 +42,11 @@ endif nodist_include_HEADERS = include/libunwind-common.h -SUBDIRS = src tests doc +SUBDIRS = src tests + +if CONFIG_DOCS +SUBDIRS += doc +endif noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \ include/compiler.h include/libunwind_i.h include/mempool.h \ diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000..b08bc831 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. +( + cd "$srcdir" && + autoreconf --force -v --install +) || exit +test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/configure.ac b/configure.ac index c59f5268..85d78f89 100644 --- a/configure.ac +++ b/configure.ac @@ -125,6 +125,10 @@ AC_ARG_ENABLE(setjmp, [AS_IF([test x$target_arch == x$host_arch], [enable_setjmp=yes], [enable_setjmp=no])] ) +AC_ARG_ENABLE(documentation, + AS_HELP_STRING([--disable-documentation],[Disable generating the man pages]),, + [enable_documentation=yes]) + AC_MSG_CHECKING([if we should build libunwind-setjmp]) AC_MSG_RESULT([$enable_setjmp]) @@ -381,8 +385,19 @@ AC_SUBST(enable_cxx_exceptions) AC_SUBST(enable_debug_frame) AC_SUBST(DLLIB) +AC_PATH_PROG([LATEX2MAN],[latex2man]) +if test "x$LATEX2MAN" = "x"; then + AC_MSG_WARN([latex2man not found. Install latex2man. Disabling docs.]) + enable_documentation="no"; +fi + +AM_CONDITIONAL([CONFIG_DOCS], [test x$enable_documentation = xyes]) +if test "x$enable_documentation" = "xyes"; then + AC_CONFIG_FILES(doc/Makefile doc/common.tex) +fi + AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile tests/check-namespace.sh - doc/Makefile doc/common.tex include/libunwind-common.h + include/libunwind-common.h include/libunwind.h include/tdep/libunwind_i.h) AC_CONFIG_FILES(src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc