aboutsummaryrefslogtreecommitdiff
path: root/build/configure
blob: fbcfe92f9e7d082fbac1dcb49c1b6b480265a330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#! /usr/bin/env bash

# file      : build/configure
# copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
# license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

# $1  out file
#
# bld_root     - build root
# project_name - project name
#

source $bld_root/dialog.bash


$echo
$echo
$echo "configuring '$project_name'"
$echo
$echo

$echo
$echo "Please specify your platform architecture width in bits:"
$echo

arch_width=`read_value 32`

$echo
$echo "Is your platform little-endian?"
$echo

little=`read_y_n y`

if [ "$little" == "y" ]; then
  byteorder=l
else
  byteorder=b
fi

$echo
$echo "Please select the application character encoding:"
$echo
$echo "(1) UTF-8"
$echo "(2) ISO-8859-1"
$echo

encoding=`read_option "utf8 iso8859-1" "utf8"`

$echo
$echo "Would you like the generated code and runtime to use STL?"
$echo

stl=`read_y_n y`

$echo
$echo "Would you like the generated code and runtime to provide STL-"
$echo "conforming iterators?"
$echo

stl_iter=`read_y_n y`

$echo
$echo "Would you like the generated code and runtime to use IO streams?"
$echo

iostream=`read_y_n y`

$echo
$echo "Would you like the generated code and runtime to use C++ exceptions?"
$echo

exceptions=`read_y_n y`

$echo
$echo "Is the long long int type available on your platform?"
$echo

longlong=`read_y_n y`

$echo
$echo "Is the snprintf/_snprintf function available on your platform?"
$echo

snprintf=`read_y_n y`

$echo
$echo "Would you like the parser runtime to validate against XML Schema?"
$echo

parser_validation=`read_y_n y`

$echo
$echo "Would you like the serializer runtime to validate against XML Schema?"
$echo

serializer_validation=`read_y_n y`

$echo
$echo "Would you like to include regexp support for xs:pattern validation?"
$echo

regexp=`read_y_n y`

$echo
$echo "Please select the base parser/serializer reuse style you would"
$echo "like to use:"
$echo
$echo "(1) mixin (virtual inheritance-based reuse)"
$echo "(2) tiein (delegation-based reuse)"
$echo "(3) none  (no reuse support)"
$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

xdr=`read_y_n n`

$echo
$echo "Would you like to build support for serialization in CDR format?"
$echo "This requires the ACE library."
$echo

cdr=`read_y_n n`


$echo
$echo "Would you like the runtime library to support XML Schema polymorphism"
$echo "(xsi:type and substitution groups)?"
$echo

polymorphic=`read_y_n n`

parser_smap_buckets=0
parser_imap_buckets=0
serializer_smap_buckets=0
serializer_smap_bucket_buckets=0
serializer_imap_buckets=0

if [ "$polymorphic" = "y" ]; then
$echo
$echo "Enter the substitution and inheritance hashmaps bucket counts."
$echo "Prime numbers are recommended: 53 97 193 389 769 1543 3079 6151"
$echo "12289 24593 49157 98317 196613 393241."
$echo

$echo
$echo "Parser substitution hashmap buckets:"
$echo
parser_smap_buckets=`read_value 53`

if [ "$parser_validation" = "y" ]; then
$echo
$echo "Parser inheritance hashmap buckets:"
$echo
parser_imap_buckets=`read_value 97`
fi

$echo
$echo "Serializer substitution hashmap buckets:"
$echo
serializer_smap_buckets=`read_value 53`

$echo
$echo "Serializer inner substitution hashmap buckets:"
$echo
serializer_smap_bucket_buckets=`read_value 53`

if [ "$serializer_validation" = "y" ]; then
$echo
$echo "Serializer inheritance hashmap buckets:"
$echo
serializer_imap_buckets=`read_value 97`
fi

fi

echo "xsde_arch_width                     := $arch_width"                     >$1
echo "xsde_byteorder                      := $byteorder"                      >>$1
echo "xsde_encoding                       := $encoding"                       >>$1
echo "xsde_stl                            := $stl"                            >>$1
echo "xsde_stl_iterator                   := $stl_iter"                       >>$1
echo "xsde_iostream                       := $iostream"                       >>$1
echo "xsde_exceptions                     := $exceptions"                     >>$1
echo "xsde_longlong                       := $longlong"                       >>$1
echo "xsde_snprintf                       := $snprintf"                       >>$1
echo "xsde_parser_validation              := $parser_validation"              >>$1
echo "xsde_serializer_validation          := $serializer_validation"          >>$1
echo "xsde_regexp                         := $regexp"                         >>$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
echo "xsde_parser_smap_buckets            := $parser_smap_buckets"            >>$1
echo "xsde_parser_imap_buckets            := $parser_imap_buckets"            >>$1
echo "xsde_serializer_smap_buckets        := $serializer_smap_buckets"        >>$1
echo "xsde_serializer_smap_bucket_buckets := $serializer_smap_bucket_buckets" >>$1
echo "xsde_serializer_imap_buckets        := $serializer_imap_buckets"        >>$1