diff --git a/Makefile.am b/Makefile.am index 01d3838..cdf1447 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = src tests examples cxxmph man +SUBDIRS = src tests examples man $(CXXMPH) EXTRA_DIST = cmph.spec configure.ac cmph.pc.in LGPL-2 MPL-1.1 pkgconfigdir = $(libdir)/pkgconfig diff --git a/acinclude.m4 b/acinclude.m4 index f216360..b49a92b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,3 +1,11 @@ +AC_DEFUN([AC_ENABLE_CXXMPH], [AC_ARG_ENABLE([cxxmph], + [ --enable-cxxmph enable the c++ cxxmph library ], + [case "${enableval}" in + yes) cxxmph=true ;; + no) cxxmph=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-cxxmph]) ;; + esac],[cxxmph=false])]) + AC_DEFUN([AC_CHECK_SPOON], [ AC_ARG_WITH(spoon, [ --with-spoon=SPOON this is inocuous, since the truth is that there is no spoon ]) AC_MSG_CHECKING(if there is spoon) diff --git a/configure.ac b/configure.ac index 59eb358..aa947ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,16 +1,16 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(Makefile.am) -AM_INIT_AUTOMAKE(cmph, 1.1) -AM_CONFIG_HEADER(config.h) +AC_INIT +AC_CONFIG_SRCDIR([Makefile.am]) +AM_INIT_AUTOMAKE(cmph, 1.0) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) dnl Checks for programs. AC_PROG_AWK AC_PROG_CC -AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_LIBTOOL +LT_INIT AC_SYS_EXTRA_LARGEFILE if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then ac_cv_sys_largefile_CFLAGS="" @@ -26,17 +26,23 @@ CXXFLAGS='-std=c++0x' LDFLAGS="$LDFLAGS $ac_cv_sys_largefile_LDFLAGS" LIBS="$LIBS $ac_cv_sys_largefile_LIBS" - dnl Checks for headers AC_CHECK_HEADERS([getopt.h math.h]) dnl Checks for libraries. -AC_CHECK_LIBM +LT_LIB_M LDFLAGS="$LIBM $LDFLAGS" CFLAGS="-Wall -Werror" -dnl Checks for library functions. +AC_PROG_CXX +AC_ENABLE_CXXMPH +if test x$cxxmph = xtrue; then + CXXFLAGS="$CXXFLAGS -std=c++0x" + AC_SUBST([CXXMPH], "cxxmph") +fi AC_CHECK_SPOON -dnl AC_OUTPUT(Makefile tests/Makefile samples/Makefile) -AC_OUTPUT(Makefile src/Makefile cxxmph/Makefile tests/Makefile examples/Makefile man/Makefile cmph.pc) +dnl AC_CONFIG_FILES([Makefile tests/Makefile samples/Makefile]) +AC_OUTPUT +AC_CONFIG_FILES([Makefile src/Makefile cxxmph/Makefile tests/Makefile examples/Makefile man/Makefile cmph.pc]) +AC_OUTPUT