You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/04/14 18:38:04 UTC
svn commit: r528835 - in /incubator/qpid/trunk/qpid/cpp: ./ docs/api/ gen/
src/ src/gen/ src/tests/
Author: aconway
Date: Sat Apr 14 09:38:02 2007
New Revision: 528835
URL: http://svn.apache.org/viewvc?view=rev&rev=528835
Log:
* Moved code generation into top-level gen/ dir with own Makefile.am
to correctly install generated headers.
* Fixed gen-src.mk/Makefile dependency loop, bootstrap no longer needs
to pre-create gen-src.mk.
Added:
incubator/qpid/trunk/qpid/cpp/gen/ (props changed)
- copied from r528814, incubator/qpid/trunk/qpid/cpp/src/gen/
incubator/qpid/trunk/qpid/cpp/gen/Makefile.am
incubator/qpid/trunk/qpid/cpp/gen/gen-src-mk.sh
- copied, changed from r528814, incubator/qpid/trunk/qpid/cpp/src/make-gen-src-mk.sh
Removed:
incubator/qpid/trunk/qpid/cpp/src/gen/
incubator/qpid/trunk/qpid/cpp/src/make-gen-src-mk.sh
Modified:
incubator/qpid/trunk/qpid/cpp/ (props changed)
incubator/qpid/trunk/qpid/cpp/Makefile.am
incubator/qpid/trunk/qpid/cpp/bootstrap
incubator/qpid/trunk/qpid/cpp/configure.ac
incubator/qpid/trunk/qpid/cpp/docs/api/user.doxygen.in
incubator/qpid/trunk/qpid/cpp/qpidc.spec.in
incubator/qpid/trunk/qpid/cpp/src/Makefile.am
incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp
incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am
Propchange: incubator/qpid/trunk/qpid/cpp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Apr 14 09:38:02 2007
@@ -14,3 +14,8 @@
qpidc-*
qpid-config
qpidc.pc
+Makefile.am
+bootstrap
+configure.ac
+gen
+qpidc.spec.in
Modified: incubator/qpid/trunk/qpid/cpp/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/Makefile.am?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/Makefile.am Sat Apr 14 09:38:02 2007
@@ -16,7 +16,7 @@
$(SPEC) $(SPEC).in $(PC) $(PC).in\
rpm/README.qpidd-devel
-SUBDIRS = src docs/api docs/man
+SUBDIRS = gen src docs/api docs/man
# Update libtool, if needed.
libtool: $(LIBTOOL_DEPS)
Modified: incubator/qpid/trunk/qpid/cpp/bootstrap
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/bootstrap?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/bootstrap (original)
+++ incubator/qpid/trunk/qpid/cpp/bootstrap Sat Apr 14 09:38:02 2007
@@ -12,16 +12,6 @@
# If we're building in the qpid tree, we can generate
# some Makefile snippets:
-if test -d ../specs; then
- # Transform gen/Makefile.am, removing automake-constructs and the
- # contents of the sole automake-else clause (the warning), then
- # use the result to run the rules that create gen-src.mk, a file
- # that must be created before we run automake.
- (cd src && rm -f gen/gen-src.mk
- perl -ne '/warning:|^(if|else|endif|include)\b/ or print' Makefile.am \
- | make -f - srcdir=. gen/gen-src.mk > /dev/null )
-fi
-
# Generate (for automake) lots of repetitive parts of tests/Makefile.am.
(cd src/tests && rm -f gen.mk
perl -ne '/^include / or print' Makefile.am \
Modified: incubator/qpid/trunk/qpid/cpp/configure.ac
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/configure.ac?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/configure.ac (original)
+++ incubator/qpid/trunk/qpid/cpp/configure.ac Sat Apr 14 09:38:02 2007
@@ -142,6 +142,7 @@
qpidc.pc
qpidc.spec
Makefile
+ gen/Makefile
src/Makefile
src/tests/Makefile
docs/man/Makefile
Modified: incubator/qpid/trunk/qpid/cpp/docs/api/user.doxygen.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/docs/api/user.doxygen.in?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/docs/api/user.doxygen.in (original)
+++ incubator/qpid/trunk/qpid/cpp/docs/api/user.doxygen.in Sat Apr 14 09:38:02 2007
@@ -467,7 +467,7 @@
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @abs_top_srcdir@/src
+INPUT = @abs_top_srcdir@/src @abs_top_builddir@/gen
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
Propchange: incubator/qpid/trunk/qpid/cpp/gen/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Apr 14 09:38:02 2007
@@ -0,0 +1,7 @@
+*.h
+*.cpp
+timestamp
+gen-src.mk
+Makefile.in
+Makefile
+qpid
Added: incubator/qpid/trunk/qpid/cpp/gen/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/gen/Makefile.am?view=auto&rev=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/gen/Makefile.am (added)
+++ incubator/qpid/trunk/qpid/cpp/gen/Makefile.am Sat Apr 14 09:38:02 2007
@@ -0,0 +1,41 @@
+#
+# Generate code from AMQP XML specification.
+#
+-include gen-src.mk
+
+BUILT_SOURCES = gen-src.mk $(generated_cpp) $(generated_h)
+
+# Distribute the generated sources, since the code generator depends
+# on tools that may not be available in the build environment.
+EXTRA_DIST = $(BUILT_SOURCES)
+
+# Install generated headers
+nobase_include_HEADERS = $(generated_h)
+
+# Don't attempt to run the code generator unless configure has set
+# CAN_GENERATE_CODE, indicating that the amqp.xml and tools needed
+# to run the code generator are available.
+#
+if CAN_GENERATE_CODE
+gentools_dir = $(top_srcdir)/gentools
+gentools_srcdir = $(gentools_dir)/src/org/apache/qpid/gentools
+spec_dir = $(top_srcdir)/../specs
+spec = $(spec_dir)/amqp.0-9.xml $(spec_dir)/amqp-errata.0-9.xml
+
+qpid $(generated_cpp) $(generated_h): $(spec) $(java_sources) $(cxx_templates)
+ rm -rf qpid
+ mkdir -p qpid/framing
+ cd $(gentools_srcdir) && rm -f *.class && $(JAVAC) *.java
+ $(JAVA) -cp $(gentools_dir)/src org.apache.qpid.gentools.Main \
+ -c -o qpid/framing -t $(gentools_dir)/templ.cpp $(spec)
+ touch qpid
+
+gen-src.mk: qpid gen-src-mk.sh
+ ./gen-src-mk.sh $(gentools_dir) $(gentools_srcdir) > $@-t
+ mv $@-t $@
+
+endif
+
+maintainer-clean-local:
+ rm -rf qpid gen-src.mk $(gentools_srcdir)/*.class
+
Copied: incubator/qpid/trunk/qpid/cpp/gen/gen-src-mk.sh (from r528814, incubator/qpid/trunk/qpid/cpp/src/make-gen-src-mk.sh)
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/gen/gen-src-mk.sh?view=diff&rev=528835&p1=incubator/qpid/trunk/qpid/cpp/src/make-gen-src-mk.sh&r1=528814&p2=incubator/qpid/trunk/qpid/cpp/gen/gen-src-mk.sh&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/make-gen-src-mk.sh (original)
+++ incubator/qpid/trunk/qpid/cpp/gen/gen-src-mk.sh Sat Apr 14 09:38:02 2007
@@ -1,31 +1,36 @@
#!/bin/sh
-# Generates the gen-src.mk makefile fragment, to stdout.
+# Generates gen-src.mk makefile fragment, to stdout.
# Usage: <gentools_dir> <gentools_srcdir>
gentools_dir=$1
gentools_srcdir=$2
-gen=$3
-wildcard() { echo `ls $* 2>/dev/null` ; }
+backslashify() {
+ for x in $* ; do
+ echo " \\"
+ echo -n " $x"
+ done
+ echo ; echo
+}
+
+
+echo -n "generated_cpp = "
+backslashify `find * -name '*.cpp' -print`
+echo -n "generated_h = "
+backslashify `find * -name '*.h' -print`
+
+echo
+echo -n "java_sources ="
+backslashify `find $gentools_srcdir -name '*.java' -print`
+echo -n "cxx_templates ="
+backslashify `find $gentools_dir/templ.cpp -name '*.tmpl'`
cat <<EOF
-generated_sources = `wildcard $gen/*.cpp`
-
-generated_headers = `wildcard $gen/*.h`
-
-if CAN_GENERATE_CODE
-
-java_sources = `wildcard $gentools_srcdir/*.java`
-
-cxx_templates = `wildcard $gentools_dir/templ.cpp/*.tmpl`
-
# Empty rules in case one of these files is removed,
# renamed or no longer generated.
\$(spec):
\$(java_sources):
\$(cxx_templates):
-endif
-
EOF
Modified: incubator/qpid/trunk/qpid/cpp/qpidc.spec.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/qpidc.spec.in?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/qpidc.spec.in (original)
+++ incubator/qpid/trunk/qpid/cpp/qpidc.spec.in Sat Apr 14 09:38:02 2007
@@ -102,7 +102,6 @@
%_includedir/qpid/*.h
%_includedir/qpid/client
%_includedir/qpid/framing
-%_includedir/qpid/gen
%_includedir/qpid/sys
%_libdir/libqpidcommon.so
%_libdir/libqpidclient.so
Modified: incubator/qpid/trunk/qpid/cpp/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/Makefile.am?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/Makefile.am Sat Apr 14 09:38:02 2007
@@ -1,21 +1,16 @@
-include gen/gen-src.mk
-
-BUILT_SOURCES = $(generated_sources) $(generated_headers)
-
SUBDIRS = . tests
AM_CXXFLAGS = $(WARNING_CFLAGS) $(APR_CXXFLAGS)
-gen = gen/qpid/framing
+gen_framing = $(top_builddir)/gen/qpid/framing
framing= qpid/framing
broker = qpid/broker
client = qpid/client
apr = qpid/sys/apr
posix = qpid/sys/posix
-
# -I top_builddir for config.h
-INCLUDES = -I$(top_builddir) -I$(srcdir)/qpid -Igen
+INCLUDES = -I$(top_builddir) -I$(top_builddir)/gen
qpidd_LDADD = \
libqpidbroker.la \
@@ -95,10 +90,10 @@
$(framing)/Correlator.cpp \
$(framing)/Value.cpp \
$(framing)/Proxy.cpp \
- $(gen)/AMQP_ClientProxy.cpp \
- $(gen)/AMQP_HighestVersion.h \
- $(gen)/AMQP_MethodVersionMap.cpp \
- $(gen)/AMQP_ServerProxy.cpp \
+ $(gen_framing)/AMQP_ClientProxy.cpp \
+ $(gen_framing)/AMQP_HighestVersion.h \
+ $(gen_framing)/AMQP_MethodVersionMap.cpp \
+ $(gen_framing)/AMQP_ServerProxy.cpp \
qpid/Exception.cpp \
qpid/ExceptionHolder.cpp \
qpid/QpidError.cpp \
@@ -158,7 +153,6 @@
$(client)/ResponseHandler.cpp \
$(client)/ReturnedMessageHandler.cpp
-include_HEADERS = gen/qpid
nobase_include_HEADERS = \
$(platform_hdr) \
$(broker)/AccumulatedAck.h \
@@ -284,38 +278,5 @@
qpid/SharedObject.h \
qpid/shared_ptr.h
-# Distribute the generated sources, at least for now, since
-# the generator code is in java.
-EXTRA_DIST += $(BUILT_SOURCES)
-
-# Don't attempt to run the code generator unless configure has set
-# CAN_GENERATE_CODE, indicating that the amqp.xml and tools needed
-# to run the code generator are available.
-#
-if CAN_GENERATE_CODE
-
-gentools_dir = $(srcdir)/../gentools
-spec_dir = $(srcdir)/../../specs
-spec = $(spec_dir)/amqp.0-9.xml $(spec_dir)/amqp-errata.0-9.xml
-gentools_srcdir = $(gentools_dir)/src/org/apache/qpid/gentools
-
-$(BUILT_SOURCES) $(gen): $(spec) $(java_sources) $(cxx_templates) Makefile.am
- rm -rf $(gen)
- mkdir -p $(gen)
- cd $(gentools_srcdir) && rm -f *.class && $(JAVAC) *.java
- $(JAVA) -cp $(gentools_dir)/src org.apache.qpid.gentools.Main \
- -c -o $(gen) -t $(gentools_dir)/templ.cpp $(spec)
- touch $(gen)
-
-gen/gen-src.mk: $(gen)
- ./make-gen-src-mk.sh $(gentools_dir) $(gentools_srcdir) $(gen) > $@-t
- mv $@-t $@
-
-endif
-
-maintainer-clean:
- rm -f $(gentools_srcdir)/*.class
- rm -f $(gen)
-
-# Force build during dist phase so help2man will work.
-dist-hook: $(lib_LTLIBRARIES) $(sbin_PROGRAMS)
+# Force build of qpidd during dist phase so help2man will work.
+dist-hook: qpidd
Modified: incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp Sat Apr 14 09:38:02 2007
@@ -18,8 +18,8 @@
* under the License.
*
*/
-#include "broker/Broker.h"
-#include "broker/Configuration.h"
+#include "qpid/broker/Broker.h"
+#include "qpid/broker/Configuration.h"
#include <signal.h>
#include <iostream>
#include <memory>
Modified: incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am?view=diff&rev=528835&r1=528834&r2=528835
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am Sat Apr 14 09:38:02 2007
@@ -1,5 +1,5 @@
AM_CXXFLAGS = $(WARNING_CFLAGS) $(CPPUNIT_CXXFLAGS) $(APR_CXXFLAGS)
-INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../gen
+INCLUDES = -I$(srcdir)/.. -I$(top_builddir)/gen
# Unit tests
broker_unit_tests = \