From 95529d52609cfbfc7df137d5bb50a0f7e4a2ddba Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Thu, 26 Apr 2007 00:01:06 +0000 Subject: * Make APR/"posix" configurable using --disable-apr * Make "posix" code build (but not run correctly) * By default still build APR version, which works as before git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@532543 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/configure.ac | 21 ++++++++++++++++----- cpp/src/Makefile.am | 12 +++++++++--- cpp/src/qpid/sys/posix/PosixAcceptor.cpp | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-) (limited to 'cpp') diff --git a/cpp/configure.ac b/cpp/configure.ac index da84a48357..c2b33170de 100644 --- a/cpp/configure.ac +++ b/cpp/configure.ac @@ -101,16 +101,27 @@ CPPUNIT_CXXFLAGS=$CPPUNIT_CFLAGS AC_SUBST(CPPUNIT_LIBS) AC_SUBST(CPPUNIT_CXXFLAGS) -# Removed --enable-apr option as we currently don't build without APR. - +AC_ARG_ENABLE([apr], + [AS_HELP_STRING([--enable-apr], + [use the Apache Portable Runtime library (default yes)])], + [case $enableval in + yes|no) enable_APR=$enableval;; + *) AC_MSG_ERROR([Invalid value for --enable-apr: $enableval]);; + esac], + [enable_APR=yes] +) +AM_CONDITIONAL([USE_APR], [test x$enable_APR = xyes]) + APR_MINIMUM_VERSION=1.2.2 AC_SUBST(APR_MINIMUM_VERSION) AC_SUBST(APR_CXXFLAGS) AC_SUBST(USE_APR) -PKG_CHECK_MODULES([APR], [apr-1 >= $APR_MINIMUM_VERSION]) -APR_CXXFLAGS="$APR_CFLAGS -DUSE_APR=1" -USE_APR=1 +if test "$enable_APR" = yes; then + PKG_CHECK_MODULES([APR], [apr-1 >= $APR_MINIMUM_VERSION]) + APR_CXXFLAGS="$APR_CFLAGS -DUSE_APR=1" + USE_APR=1 +fi AC_ARG_ENABLE([valgrind], [AS_HELP_STRING([--enable-valgrind], diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index 2c95033661..99250e15ad 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -43,9 +43,15 @@ posix_hdr = \ qpid/sys/posix/EventChannel.h \ qpid/sys/posix/EventChannelThreads.h -EXTRA_DIST=$(posix_src) $(posix_hdr) -platform_src = $(apr_src) -platform_hdr = $(apr_hdr) +if USE_APR + EXTRA_DIST=$(posix_src) $(posix_hdr) + platform_src = $(apr_src) + platform_hdr = $(apr_hdr) +else + EXTRA_DIST=$(apr_src) $(apr_hdr) + platform_src = $(posix_src) + platform_hdr = $(posix_hdr) +endif lib_LTLIBRARIES = libqpidcommon.la libqpidbroker.la libqpidclient.la diff --git a/cpp/src/qpid/sys/posix/PosixAcceptor.cpp b/cpp/src/qpid/sys/posix/PosixAcceptor.cpp index b5f6c6ee83..af200d393d 100644 --- a/cpp/src/qpid/sys/posix/PosixAcceptor.cpp +++ b/cpp/src/qpid/sys/posix/PosixAcceptor.cpp @@ -31,7 +31,7 @@ void fail() { throw qpid::Exception("PosixAcceptor not implemented"); } class PosixAcceptor : public Acceptor { public: - virtual int16_t getPort() const { fail(); return 0; } + virtual uint16_t getPort() const { fail(); return 0; } virtual void run(qpid::sys::ConnectionInputHandlerFactory* ) { fail(); } virtual void shutdown() { fail(); } }; -- cgit v1.2.1