From 7e1d77bcd0aad54957d1d426a1d31f8398604f90 Mon Sep 17 00:00:00 2001 From: Johan Oudinet Date: Wed, 8 Jan 2014 17:27:50 +0100 Subject: [PATCH] Improve project configuration. * configure.ac: Add option disable-documentation and define HAVE_TCL_H if tcl8.5/.tcl.h is found. * include/Makefile.am: Compile qdft_wrap.cxx iff. HAVE_TCL_H is defined. --- configure.ac | 18 +++++++++++++----- include/Makefile.am | 35 +++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index cff7e38..4bfd572 100644 --- a/configure.ac +++ b/configure.ac @@ -26,10 +26,16 @@ LT_INIT([disable-static]) AC_PROG_CXX # Documentation -AC_CHECK_PROGS([DOXYGEN], [doxygen]) -if test -z "$DOXYGEN"; - then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) -fi +AC_ARG_ENABLE([documentation], + [AS_HELP_STRING([--disable-documentation], + [Do not build documentation])]) +AS_IF([test "x$enable_documentation" != xno], + [AC_CHECK_PROGS([DOXYGEN], [doxygen]) + if test -z "$DOXYGEN"; then + AC_MSG_WARN( + [Doxygen not found - continuing without Doxygen support]) + fi + ]) # Attempt to use strict language conformance checking. AC_CXX_FLAGS @@ -44,7 +50,9 @@ BOOST_REQUIRE([1.47.0]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST -AC_CHECK_HEADER([tcl8.5/tcl.h], [], [AC_MSG_ERROR([tcl8.5-dev not found])]) +dnl AC_CHECK_HEADER([tcl8.5/tcl.h], [], [AC_MSG_ERROR([tcl8.5-dev not found])]) +AC_CHECK_HEADERS_ONCE([tcl8.5/tcl.h]) +AM_CONDITIONAL([HAVE_TCL_H], [test "${ac_cv_header_tcl8_5_tcl_h}" = yes]) AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])]) diff --git a/include/Makefile.am b/include/Makefile.am index 8ab5f66..db0ce03 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2011, 2012 Johan Oudinet +# Copyright (C) 2011, 2012, 2014 Johan Oudinet # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,22 +19,25 @@ AM_CPPFLAGS = -I$(srcdir)/../include $(BOOST_CPPFLAGS) lib_LTLIBRARIES = libqdftgraph.la -libqdftgraph_la_SOURCES = \ -qdft/action.hh \ -qdft/graph.hh \ -qdft/manager.hh \ -qdft/manager.hxx \ -qdft/qdft.hh \ -qdft/qdft.hxx \ -qdft/types.hh \ -qdft/qdft_wrap.cxx +libqdftgraph_la_SOURCES = \ +qdft/action.hh \ +qdft/graph.hh \ +qdft/manager.hh \ +qdft/manager.hxx \ +qdft/qdft.hh \ +qdft/qdft.hxx \ +qdft/types.hh + +if HAVE_TCL_H +libqdftgraph_la_SOURCES += qdft/qdft_wrap.cxx +endif libqdftgraph_la_LDFLAGS = -no-undefined -nobase_include_HEADERS = \ -qdft/qdft.i \ -qdft/libqdftgraph.cs \ -qdft/libqdftgraphPINVOKE.cs \ -qdft/dataManagers.cs \ -qdft/mode_type.cs \ +nobase_include_HEADERS = \ +qdft/qdft.i \ +qdft/libqdftgraph.cs \ +qdft/libqdftgraphPINVOKE.cs \ +qdft/dataManagers.cs \ +qdft/mode_type.cs \ qdft/SWIGTYPE_p_std__ostream.cs