summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2007-04-26 00:01:06 +0000
committerAndrew Stitcher <astitcher@apache.org>2007-04-26 00:01:06 +0000
commitc72af535c741ad0dc057199c5d9e20f1a7341cf4 (patch)
treeeb42becec5db48a32b597fd97f409571060d6f63 /qpid/cpp
parent891d06f45401fc051dc7641f8a3e0c20d1f49adb (diff)
downloadqpid-python-c72af535c741ad0dc057199c5d9e20f1a7341cf4.tar.gz
* 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@532543 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/configure.ac21
-rw-r--r--qpid/cpp/src/Makefile.am12
-rw-r--r--qpid/cpp/src/qpid/sys/posix/PosixAcceptor.cpp2
3 files changed, 26 insertions, 9 deletions
diff --git a/qpid/cpp/configure.ac b/qpid/cpp/configure.ac
index da84a48357..c2b33170de 100644
--- a/qpid/cpp/configure.ac
+++ b/qpid/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/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am
index 2c95033661..99250e15ad 100644
--- a/qpid/cpp/src/Makefile.am
+++ b/qpid/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/qpid/cpp/src/qpid/sys/posix/PosixAcceptor.cpp b/qpid/cpp/src/qpid/sys/posix/PosixAcceptor.cpp
index b5f6c6ee83..af200d393d 100644
--- a/qpid/cpp/src/qpid/sys/posix/PosixAcceptor.cpp
+++ b/qpid/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(); }
};