aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-05-11 12:20:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-05-11 12:20:11 +0200
commit2e501c68a8641a2b3c430b55f13491a9c1c5d0f5 (patch)
tree49c2748443fe3c1f01108756b647440e0647a11b /build
parent161beba6cdb0d91b15ad19fa8b3e51d986203915 (diff)
Add support for custom allocators
New example: examples/cxx/hybrid/allocator.
Diffstat (limited to 'build')
-rw-r--r--build/configuration.make4
-rwxr-xr-xbuild/configure15
-rwxr-xr-xbuild/dist8
-rw-r--r--build/xsde/hybrid/xsd-cxx.make4
-rw-r--r--build/xsde/parser/xsd-cxx.make4
-rw-r--r--build/xsde/serializer/xsd-cxx.make4
6 files changed, 39 insertions, 0 deletions
diff --git a/build/configuration.make b/build/configuration.make
index 49624e5..0de6d47 100644
--- a/build/configuration.make
+++ b/build/configuration.make
@@ -20,6 +20,8 @@ xsde_snprintf :=
xsde_parser_validation :=
xsde_serializer_validation :=
xsde_reuse_style :=
+xsde_custom_allocator :=
+xsde_default_allocator :=
xsde_xdr :=
xsde_cdr :=
xsde_polymorphic :=
@@ -46,6 +48,8 @@ $(out_root)/%: xsde_snprintf := $(xsde_snprintf)
$(out_root)/%: xsde_parser_validation := $(xsde_parser_validation)
$(out_root)/%: xsde_serializer_validation := $(xsde_serializer_validation)
$(out_root)/%: xsde_reuse_style := $(xsde_reuse_style)
+$(out_root)/%: xsde_custom_allocator := $(xsde_custom_allocator)
+$(out_root)/%: xsde_default_allocator := $(xsde_default_allocator)
$(out_root)/%: xsde_xdr := $(xsde_xdr)
$(out_root)/%: xsde_cdr := $(xsde_cdr)
$(out_root)/%: xsde_polymorphic := $(xsde_polymorphic)
diff --git a/build/configure b/build/configure
index 8295e76..7e37c13 100755
--- a/build/configure
+++ b/build/configure
@@ -108,6 +108,19 @@ $echo
reuse_style=`read_option "mixin tiein none" "tiein"`
$echo
+$echo "Would you like to enable support for custom memory allocator?"
+$echo
+
+allocator=`read_y_n n`
+
+$echo
+$echo "Would you like to include the default implementation of the"
+$echo "memory allocator functions into the XSD/e runtime library?"
+$echo
+
+allocator_default=`read_y_n n`
+
+$echo
$echo "Would you like to build support for serialization in XDR format?"
$echo "This requires the XDR API that is part of Sun RPC (rpc/xdr.h)."
$echo
@@ -185,6 +198,8 @@ echo "xsde_snprintf := $snprintf" >>
echo "xsde_parser_validation := $parser_validation" >>$1
echo "xsde_serializer_validation := $serializer_validation" >>$1
echo "xsde_reuse_style := $reuse_style" >>$1
+echo "xsde_custom_allocator := $allocator" >>$1
+echo "xsde_default_allocator := $allocator_default" >>$1
echo "xsde_xdr := $xdr" >>$1
echo "xsde_cdr := $cdr" >>$1
echo "xsde_polymorphic := $polymorphic" >>$1
diff --git a/build/dist b/build/dist
index cbb9678..bcc7c60 100755
--- a/build/dist
+++ b/build/dist
@@ -263,6 +263,10 @@ gen 'ifeq ($(XSDE_POLYMORPHIC),y)'
gen 'EXTRA_XSDFLAGS += --runtime-polymorphic'
gen 'endif'
gen
+gen 'ifeq ($(XSDE_CUSTOM_ALLOCATOR),y)'
+gen 'EXTRA_XSDFLAGS += --custom-allocator'
+gen 'endif'
+gen
gen "$driver: $obj" '$(root)/libxsde/xsde/libxsde.a'
gen
@@ -414,6 +418,10 @@ gen '!if "$(XSDE_POLYMORPHIC)" == "y"'
gen 'EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic'
gen '!endif'
gen
+gen '!if "$(XSDE_CUSTOM_ALLOCATOR)" == "y"'
+gen 'EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --custom-allocator'
+gen '!endif'
+gen
gen "$driver: $obj" '$(root)\\libxsde\\xsde\\xsde.lib'
gen
diff --git a/build/xsde/hybrid/xsd-cxx.make b/build/xsde/hybrid/xsd-cxx.make
index 540fa1f..57420f0 100644
--- a/build/xsde/hybrid/xsd-cxx.make
+++ b/build/xsde/hybrid/xsd-cxx.make
@@ -94,6 +94,10 @@ ifeq ($(xsde_reuse_style),none)
$(error Hybrid mapping requires support for base parser/serializer reuse)
endif
+ifeq ($(xsde_custom_allocator),y)
+ops += $(xsde_options) --custom-allocator
+endif
+
$(xsd_hybrid_pattern): xsde_options := $(ops)
.PRECIOUS: $(xsd_hybrid_pattern)
diff --git a/build/xsde/parser/xsd-cxx.make b/build/xsde/parser/xsd-cxx.make
index f9c87e9..3a246ff 100644
--- a/build/xsde/parser/xsd-cxx.make
+++ b/build/xsde/parser/xsd-cxx.make
@@ -68,6 +68,10 @@ ifeq ($(xsde_reuse_style),none)
ops += $(xsde_options) --reuse-style-none
endif
+ifeq ($(xsde_custom_allocator),y)
+ops += $(xsde_options) --custom-allocator
+endif
+
$(xsd_parser_pattern): xsde_options := $(ops)
diff --git a/build/xsde/serializer/xsd-cxx.make b/build/xsde/serializer/xsd-cxx.make
index a042ef9..86101c6 100644
--- a/build/xsde/serializer/xsd-cxx.make
+++ b/build/xsde/serializer/xsd-cxx.make
@@ -68,6 +68,10 @@ ifeq ($(xsde_reuse_style),none)
ops += $(xsde_options) --reuse-style-none
endif
+ifeq ($(xsde_custom_allocator),y)
+ops += $(xsde_options) --custom-allocator
+endif
+
$(xsd_serializer_pattern): xsde_options := $(ops)