summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2006-10-24 21:13:01 +0000
committerAlan Conway <aconway@apache.org>2006-10-24 21:13:01 +0000
commitb2b4d120e145687358e3e448678619079798fb77 (patch)
tree8aa5a2a7af785516abcdc2c4fae0796dd5e32086 /cpp
parent6920d8261ca0cdbb7e547a756a32dfd067cd15bc (diff)
downloadqpid-python-b2b4d120e145687358e3e448678619079798fb77.tar.gz
Makefile support for optimized release build. Do make BUILD=RELEASE.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@467486 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/README23
-rw-r--r--cpp/options.mk12
-rw-r--r--cpp/src/qpid/io/LFProcessor.cpp4
-rw-r--r--cpp/test/unit/qpid/broker/ChannelTest.cpp2
4 files changed, 24 insertions, 17 deletions
diff --git a/cpp/README b/cpp/README
index e8eb16965c..a887991f56 100644
--- a/cpp/README
+++ b/cpp/README
@@ -5,22 +5,25 @@ See DESIGN for design notes, Makefile comment for build system notes.
== Prerequisites ==
Required to build:
- * Apache Portable Runtime 1.2.7: http://apr.apache.org/
- * CppUnit: http://cppunit.sourceforge.net
- * boost: http://www.boost.org
+ * Apache Portable Runtime 1.2.7: http://apr.apache.org
+ * CppUnit 1.11.4: http://cppunit.sourceforge.net
+ * boost 1.33.1: http://www.boost.org
Optional: to generate source code documentation you need:
- * doxygen: http://sourceforge.net/projects/doxygen/
- * graphviz - http://www.graphviz.org/
+ * doxygen 1.4.6: http://sourceforge.net/projects/doxygen/
+ * graphviz 2.8: http://www.graphviz.org/
-On Fedora: yum install apr apr-devel cppunit cppunit-devel boost boost-devel doxygen graphviz
+If you use yum to install packages:
+# yum install apr apr-devel cppunit cppunit-devel boost boost-devel doxygen graphviz
== Build and test ==
+For a debug build:
+> make
+For an optimized release build:
+> make BUILD=RELEASE
-make
-
-Default target builds and tests everything, see Makefile for other
-targets.
+The default target "test" builds everything and runs all tests. See
+the Makefile for more targets.
=== Unit tests ===
Unit tests are built as .so files containing CppUnit plugins.
diff --git a/cpp/options.mk b/cpp/options.mk
index df9e2d62d1..563e232eee 100644
--- a/cpp/options.mk
+++ b/cpp/options.mk
@@ -23,7 +23,10 @@ EXTRA_LIBDIRS := -L/usr/local/apr/lib
## Compile flags
-DEBUG := -ggdb3 -O0
+# Release vs. debug flags, default to debug
+DEBUG := -ggdb3
+RELEASE := -O3 -DNDEBUG
+BUILD := DEBUG
# _USE_APR_IO_ set when APR IO build is desired.
DEFINES := -D _USE_APR_IO_
@@ -33,11 +36,12 @@ DEFINES := -D _USE_APR_IO_
# qpid-dev list.
#
# The following warnings deliberately omitted, they warn on valid code.
-# -Wno-unreachable-code -Wpadded
+# -Wno-unreachable-code -Wpadded -Winline
#
-WARN := -Werror -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Winline
+WARN := -Werror -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch
+
INCLUDES := -Isrc -Igen $(EXTRA_INCLUDES)
-CXXFLAGS := $(DEBUG) $(DEFINES) $(WARN) -MMD -fpic $(INCLUDES)
+CXXFLAGS := $($(BUILD)) $(DEFINES) $(WARN) -MMD -fpic $(INCLUDES)
## Link flags
# Allow exes to find libs without env changes. Remove for release builds.
LDFLAGS := -Llib $(EXTRA_LIBDIRS)
diff --git a/cpp/src/qpid/io/LFProcessor.cpp b/cpp/src/qpid/io/LFProcessor.cpp
index dba5d6c962..dabbdbecae 100644
--- a/cpp/src/qpid/io/LFProcessor.cpp
+++ b/cpp/src/qpid/io/LFProcessor.cpp
@@ -102,8 +102,8 @@ bool LFProcessor::empty(){
return count == 0;
}
-void LFProcessor::poll(){
- apr_status_t status;
+void LFProcessor::poll() {
+ apr_status_t status = APR_EGENERAL;
do{
current = 0;
if(!stopped){
diff --git a/cpp/test/unit/qpid/broker/ChannelTest.cpp b/cpp/test/unit/qpid/broker/ChannelTest.cpp
index 967ec0388f..b0907a40f3 100644
--- a/cpp/test/unit/qpid/broker/ChannelTest.cpp
+++ b/cpp/test/unit/qpid/broker/ChannelTest.cpp
@@ -76,7 +76,7 @@ class ChannelTest : public CppUnit::TestCase
Channel channel(0, 0, 0);
CPPUNIT_ASSERT(!channel.exists("my_consumer"));
- ConnectionToken* owner;
+ ConnectionToken* owner = 0;
string tag("my_consumer");
channel.consume(tag, queue, false, false, owner);
string tagA;