From 3136946851953ab7c8364563430d97064f78b5ae Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Fri, 25 Feb 2011 01:44:32 +0000 Subject: [PATCH] (trunk) #2338 "Add uTP support" -- have the autoconf system default to build uTP support iff a C++ compiler can be found by AC_PROG_CXX --- configure.ac | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 8ca7a3d5e..34206e383 100644 --- a/configure.ac +++ b/configure.ac @@ -219,18 +219,31 @@ dnl ---------------------------------------------------------------------------- dnl dnl utp +AC_MSG_CHECKING([µTP]) +build_utp="no" +if test "x$CXX" = "x" ; then + have_utp="no" +else + have_utp="yes" +fi AC_ARG_ENABLE([utp], AS_HELP_STRING([--enable-utp],[build µTP support]), - [build_utp=${enableval}], - [build_utp=no]) -if test "x$build_utp" = "xyes" ; then - LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/" - LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a -lrt" - AC_DEFINE([WITH_UTP],[1]) -fi + [want_utp=${enableval}], + [want_utp=${have_utp}]) +if test "x$want_utp" = "xyes" ; then + if test "x$have_utp" = "xyes"; then + LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/" + LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a -lrt" + AC_DEFINE([WITH_UTP],[1]) + build_utp="yes" + else + AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found") + fi +fi AC_SUBST(LIBUTP_CFLAGS) AC_SUBST(LIBUTP_LIBS) AM_CONDITIONAL([BUILD_UTP],[test "x$build_utp" = "xyes"]) +AC_MSG_RESULT([$build_utp]) dnl ----------------------------------------------------------------------------