Conditional compilation of the cxxmph directory.

This commit is contained in:
Davi Reis 2011-05-15 19:38:31 -03:00
parent 05eaf15d53
commit 4482c8f39b
3 changed files with 25 additions and 11 deletions

View File

@ -1,5 +1,5 @@
SUBDIRS = src tests examples cxxmph man SUBDIRS = src tests examples man $(CXXMPH)
EXTRA_DIST = cmph.spec configure.ac cmph.pc.in EXTRA_DIST = cmph.spec configure.ac cmph.pc.in LGPL-2 MPL-1.1
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = cmph.pc pkgconfig_DATA = cmph.pc

View File

@ -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_DEFUN([AC_CHECK_SPOON], [
AC_ARG_WITH(spoon, [ --with-spoon=SPOON this is inocuous, since the truth is that there is no 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) AC_MSG_CHECKING(if there is spoon)

View File

@ -1,16 +1,16 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am) AC_INIT
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE(cmph, 1.0) AM_INIT_AUTOMAKE(cmph, 1.0)
AM_CONFIG_HEADER(config.h) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
dnl Checks for programs. dnl Checks for programs.
AC_PROG_AWK AC_PROG_AWK
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_LIBTOOL LT_INIT
AC_SYS_EXTRA_LARGEFILE AC_SYS_EXTRA_LARGEFILE
if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then
ac_cv_sys_largefile_CFLAGS="" ac_cv_sys_largefile_CFLAGS=""
@ -25,16 +25,22 @@ CFLAGS="$CFLAGS $ac_cv_sys_largefile_CFLAGS"
LDFLAGS="$LDFLAGS $ac_cv_sys_largefile_LDFLAGS" LDFLAGS="$LDFLAGS $ac_cv_sys_largefile_LDFLAGS"
LIBS="$LIBS $ac_cv_sys_largefile_LIBS" LIBS="$LIBS $ac_cv_sys_largefile_LIBS"
dnl Checks for headers dnl Checks for headers
AC_CHECK_HEADERS([getopt.h math.h]) AC_CHECK_HEADERS([getopt.h math.h])
dnl Checks for libraries. dnl Checks for libraries.
AC_CHECK_LIBM LT_LIB_M
LDFLAGS="$LIBM $LDFLAGS" LDFLAGS="$LIBM $LDFLAGS"
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 AC_CHECK_SPOON
dnl AC_OUTPUT(Makefile tests/Makefile samples/Makefile) dnl AC_CONFIG_FILES([Makefile tests/Makefile samples/Makefile])
AC_OUTPUT(Makefile src/Makefile cxxmph/Makefile tests/Makefile examples/Makefile man/Makefile cmph.pc) AC_OUTPUT
AC_CONFIG_FILES([Makefile src/Makefile cxxmph/Makefile tests/Makefile examples/Makefile man/Makefile cmph.pc])
AC_OUTPUT