1 : //=============================================================================
2 : // File <$/src/cpp/prod/tool/Version.cpp>
3 : // This file is part of YaOrb : Yet Another Object Request Broker,
4 : // Copyright (c) 2000-2003, Marc Alff.
5 : //
6 : // This program is free software; you can redistribute it and/or
7 : // modify it under the terms of the GNU General Public License
8 : // as published by the Free Software Foundation; either version 2
9 : // of the License, or (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License
17 : // along with this program; if not, write to the Free Software
18 : // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 : //
20 : //=============================================================================
21 :
22 : #include <stdio.h>
23 :
24 : #include "yaorb/config.h"
25 : #include "src/cpp/prod/tool/Version.h"
26 :
27 :
28 : static const char* const version =
29 : PACKAGE_STRING ;
30 :
31 : static const char* const specs =
32 : "Build platform = xxx\n" ;
33 :
34 : static const char* const compile_specs =
35 :
36 : #ifdef CLOSEDIR_VOID
37 : " - CLOSEDIR_VOID is defined,\n"
38 : #else
39 : " - CLOSEDIR_VOID is not defined,\n"
40 : #endif
41 :
42 : #ifdef HAVE_ATEXIT
43 : " - HAVE_ATEXIT is defined,\n"
44 : #else
45 : " - HAVE_ATEXIT is not defined,\n"
46 : #endif
47 :
48 : #ifdef HAVE_DIRENT_H
49 : " - HAVE_DIRENT_H is defined,\n"
50 : #else
51 : " - HAVE_DIRENT_H is not defined,\n"
52 : #endif
53 :
54 : #ifdef HAVE_INTTYPES_H
55 : " - HAVE_INTTYPES_H is defined,\n"
56 : #else
57 : " - HAVE_INTTYPES_H is not defined,\n"
58 : #endif
59 :
60 : #ifdef HAVE_LONG_LONG
61 : " - HAVE_LONG_LONG is defined,\n"
62 : #else
63 : " - HAVE_LONG_LONG is not defined,\n"
64 : #endif
65 :
66 : #ifdef HAVE_MALLOC
67 : " - HAVE_MALLOC is defined,\n"
68 : #else
69 : " - HAVE_MALLOC is not defined,\n"
70 : #endif
71 :
72 : #ifdef HAVE_MEMORY_H
73 : " - HAVE_MEMORY_H is defined,\n"
74 : #else
75 : " - HAVE_MEMORY_H is not defined,\n"
76 : #endif
77 :
78 : #ifdef HAVE_MEMSET
79 : " - HAVE_MEMSET is defined,\n"
80 : #else
81 : " - HAVE_MEMSET is not defined,\n"
82 : #endif
83 :
84 : #ifdef HAVE_MKDIR
85 : " - HAVE_MKDIR is defined,\n"
86 : #else
87 : " - HAVE_MKDIR is not defined,\n"
88 : #endif
89 :
90 : #ifdef HAVE_NDIR_H
91 : " - HAVE_NDIR_H is defined,\n"
92 : #else
93 : " - HAVE_NDIR_H is not defined,\n"
94 : #endif
95 :
96 : #ifdef HAVE_REALLOC
97 : " - HAVE_REALLOC is defined,\n"
98 : #else
99 : " - HAVE_REALLOC is not defined,\n"
100 : #endif
101 :
102 : #ifdef HAVE_SELECT
103 : " - HAVE_SELECT is defined,\n"
104 : #else
105 : " - HAVE_SELECT is not defined,\n"
106 : #endif
107 :
108 : #ifdef HAVE_SOCKET
109 : " - HAVE_SOCKET is defined,\n"
110 : #else
111 : " - HAVE_SOCKET is not defined,\n"
112 : #endif
113 :
114 : #ifdef HAVE_STAT_EMPTY_STRING_BUG
115 : " - HAVE_STAT_EMPTY_STRING_BUG is defined,\n"
116 : #else
117 : " - HAVE_STAT_EMPTY_STRING_BUG is not defined,\n"
118 : #endif
119 :
120 : #ifdef HAVE_STDBOOL_H
121 : " - HAVE_STDBOOL_H is defined,\n"
122 : #else
123 : " - HAVE_STDBOOL_H is not defined,\n"
124 : #endif
125 :
126 : #ifdef HAVE_STDDEF_H
127 : " - HAVE_STDDEF_H is defined,\n"
128 : #else
129 : " - HAVE_STDDEF_H is not defined,\n"
130 : #endif
131 :
132 : #ifdef HAVE_STDINT_H
133 : " - HAVE_STDINT_H is defined,\n"
134 : #else
135 : " - HAVE_STDINT_H is not defined,\n"
136 : #endif
137 :
138 : #ifdef HAVE_STDLIB_H
139 : " - HAVE_STDLIB_H is defined,\n"
140 : #else
141 : " - HAVE_STDLIB_H is not defined,\n"
142 : #endif
143 :
144 : #ifdef HAVE_STRCASECMP
145 : " - HAVE_STRCASECMP is defined,\n"
146 : #else
147 : " - HAVE_STRCASECMP is not defined,\n"
148 : #endif
149 :
150 : #ifdef HAVE_STRDUP
151 : " - HAVE_STRDUP is defined,\n"
152 : #else
153 : " - HAVE_STRDUP is not defined,\n"
154 : #endif
155 :
156 : #ifdef HAVE_STRERROR
157 : " - HAVE_STRERROR is defined,\n"
158 : #else
159 : " - HAVE_STRERROR is not defined,\n"
160 : #endif
161 :
162 : #ifdef HAVE_STRINGS_H
163 : " - HAVE_STRINGS_H is defined,\n"
164 : #else
165 : " - HAVE_STRINGS_H is not defined,\n"
166 : #endif
167 :
168 : #ifdef HAVE_STRING_H
169 : " - HAVE_STRING_H is defined,\n"
170 : #else
171 : " - HAVE_STRING_H is not defined,\n"
172 : #endif
173 :
174 : #ifdef HAVE_STRSTR
175 : " - HAVE_STRSTR is defined,\n"
176 : #else
177 : " - HAVE_STRSTR is not defined,\n"
178 : #endif
179 :
180 : #ifdef HAVE_STRTOULL
181 : " - HAVE_STRTOULL is defined,\n"
182 : #else
183 : " - HAVE_STRTOULL is not defined,\n"
184 : #endif
185 :
186 : #ifdef HAVE_SYS_DIR_H
187 : " - HAVE_SYS_DIR_H is defined,\n"
188 : #else
189 : " - HAVE_SYS_DIR_H is not defined,\n"
190 : #endif
191 :
192 : #ifdef HAVE_SYS_NDIR_H
193 : " - HAVE_SYS_NDIR_H is defined,\n"
194 : #else
195 : " - HAVE_SYS_NDIR_H is not defined,\n"
196 : #endif
197 :
198 : #ifdef HAVE_SYS_SELECT_H
199 : " - HAVE_SYS_SELECT_H is defined,\n"
200 : #else
201 : " - HAVE_SYS_SELECT_H is not defined,\n"
202 : #endif
203 :
204 : #ifdef HAVE_SYS_SOCKET_H
205 : " - HAVE_SYS_SOCKET_H is defined,\n"
206 : #else
207 : " - HAVE_SYS_SOCKET_H is not defined,\n"
208 : #endif
209 :
210 : #ifdef HAVE_SYS_STAT_H
211 : " - HAVE_SYS_STAT_H is defined,\n"
212 : #else
213 : " - HAVE_SYS_STAT_H is not defined,\n"
214 : #endif
215 :
216 : #ifdef HAVE_SYS_TIME_H
217 : " - HAVE_SYS_TIME_H is defined,\n"
218 : #else
219 : " - HAVE_SYS_TIME_H is not defined,\n"
220 : #endif
221 :
222 : #ifdef HAVE_SYS_TYPES_H
223 : " - HAVE_SYS_TYPES_H is defined,\n"
224 : #else
225 : " - HAVE_SYS_TYPES_H is not defined,\n"
226 : #endif
227 :
228 : #ifdef HAVE_UNISTD_H
229 : " - HAVE_UNISTD_H is defined,\n"
230 : #else
231 : " - HAVE_UNISTD_H is not defined,\n"
232 : #endif
233 :
234 : #ifdef HAVE_WCHAR_H
235 : " - HAVE_WCHAR_H is defined,\n"
236 : #else
237 : " - HAVE_WCHAR_H is not defined,\n"
238 : #endif
239 :
240 : #ifdef HAVE__BOOL
241 : " - HAVE__BOOL is defined,\n"
242 : #else
243 : " - HAVE__BOOL is not defined,\n"
244 : #endif
245 :
246 : #ifdef LSTAT_FOLLOWS_SLASHED_SYMLINK
247 : " - LSTAT_FOLLOWS_SLASHED_SYMLINK is defined,\n"
248 : #else
249 : " - LSTAT_FOLLOWS_SLASHED_SYMLINK is not defined,\n"
250 : #endif
251 :
252 : #ifdef MAJOR_IN_MKDEV
253 : " - MAJOR_IN_MKDEV is defined,\n"
254 : #else
255 : " - MAJOR_IN_MKDEV is not defined,\n"
256 : #endif
257 :
258 : #ifdef MAJOR_IN_SYSMACROS
259 : " - MAJOR_IN_SYSMACROS is defined,\n"
260 : #else
261 : " - MAJOR_IN_SYSMACROS is not defined,\n"
262 : #endif
263 :
264 : #ifdef PACKAGE
265 : " - PACKAGE is defined,\n"
266 : #else
267 : " - PACKAGE is not defined,\n"
268 : #endif
269 :
270 : #ifdef PACKAGE_BUGREPORT
271 : " - PACKAGE_BUGREPORT is defined,\n"
272 : #else
273 : " - PACKAGE_BUGREPORT is not defined,\n"
274 : #endif
275 :
276 : #ifdef PACKAGE_NAME
277 : " - PACKAGE_NAME is defined,\n"
278 : #else
279 : " - PACKAGE_NAME is not defined,\n"
280 : #endif
281 :
282 : #ifdef PACKAGE_STRING
283 : " - PACKAGE_STRING is defined,\n"
284 : #else
285 : " - PACKAGE_STRING is not defined,\n"
286 : #endif
287 :
288 : #ifdef PACKAGE_TARNAME
289 : " - PACKAGE_TARNAME is defined,\n"
290 : #else
291 : " - PACKAGE_TARNAME is not defined,\n"
292 : #endif
293 :
294 : #ifdef PACKAGE_VERSION
295 : " - PACKAGE_VERSION is defined,\n"
296 : #else
297 : " - PACKAGE_VERSION is not defined,\n"
298 : #endif
299 :
300 : #ifdef RETSIGTYPE
301 : " - RETSIGTYPE is defined,\n"
302 : #else
303 : " - RETSIGTYPE is not defined,\n"
304 : #endif
305 :
306 : #ifdef SELECT_TYPE_ARG1
307 : " - SELECT_TYPE_ARG1 is defined,\n"
308 : #else
309 : " - SELECT_TYPE_ARG1 is not defined,\n"
310 : #endif
311 :
312 : #ifdef SELECT_TYPE_ARG234
313 : " - SELECT_TYPE_ARG234 is defined,\n"
314 : #else
315 : " - SELECT_TYPE_ARG234 is not defined,\n"
316 : #endif
317 :
318 : #ifdef SELECT_TYPE_ARG5
319 : " - SELECT_TYPE_ARG5 is defined,\n"
320 : #else
321 : " - SELECT_TYPE_ARG5 is not defined,\n"
322 : #endif
323 :
324 : #ifdef STDC_HEADERS
325 : " - STDC_HEADERS is defined,\n"
326 : #else
327 : " - STDC_HEADERS is not defined,\n"
328 : #endif
329 :
330 : #ifdef TIME_WITH_SYS_TIME
331 : " - TIME_WITH_SYS_TIME is defined,\n"
332 : #else
333 : " - TIME_WITH_SYS_TIME is not defined,\n"
334 : #endif
335 :
336 : #ifdef VERSION
337 : " - VERSION is defined,\n"
338 : #else
339 : " - VERSION is not defined,\n"
340 : #endif
341 :
342 : #ifdef YYTEXT_POINTER
343 : " - YYTEXT_POINTER is defined,\n"
344 : #else
345 : " - YYTEXT_POINTER is not defined,\n"
346 : #endif
347 :
348 : #ifdef const
349 : " - const is defined,\n"
350 : #else
351 : " - const is not defined,\n"
352 : #endif
353 :
354 : #ifdef inline
355 : " - inline is defined,\n"
356 : #else
357 : " - inline is not defined,\n"
358 : #endif
359 :
360 : #ifdef malloc
361 : " - malloc is defined,\n"
362 : #else
363 : " - malloc is not defined,\n"
364 : #endif
365 :
366 : #ifdef realloc
367 : " - realloc is defined,\n"
368 : #else
369 : " - realloc is not defined,\n"
370 : #endif
371 :
372 : #ifdef size_t
373 : " - size_t is defined,\n"
374 : #else
375 : " - size_t is not defined,\n"
376 : #endif
377 :
378 : #ifdef volatile
379 : " - volatile is defined,\n"
380 : #else
381 : " - volatile is not defined,\n"
382 : #endif
383 :
384 : ;
385 :
386 : void
387 0 : PrintVersion(FILE * where)
388 : {
389 0 : fprintf(where, "%s\n", version) ;
390 : }
391 :
392 : void
393 0 : PrintSpecs(FILE * where)
394 : {
395 0 : fprintf(where, "Build info:\n") ;
396 0 : fprintf(where, "%s", specs) ;
397 0 : fprintf(where, "Compiling options:\n") ;
398 0 : fprintf(where, "%s", compile_specs) ;
399 : }
400 :
|