Browse code

core: move version strings to a separate file

- moved version strings to variables (instead of macros) and in a
separate file (ver.c). This will require re-compiling only one
small file and re-linking on version or repository changes (e.g.
new commit or local uncommitted changes), instead of recompiling
main.c and core_cmd.c.
- more detailed info about the repository state is now available via
repo_hash (hash of the top commit) and repo_state (dirty or "").
- the core.version rpc reports now directly the version number
(complete with repository hash and state), without prefixing it
with "Server:", e.g.:
ser 3.0.99-dev1 (i386/linux) dd9681-dirty
instead of
Server: ser (3.0.99-dev1 (i386/freebsd)) d89437-dirty

Andrei Pelinescu-Onciul authored on 13/07/2010 17:59:26
Showing 9 changed files
... ...
@@ -491,12 +491,11 @@ modules_search_path=$(subst $(space),:,$(strip\
491 491
 		#				$(addprefix $(modules_target),$(modules_dirs))))
492 492
 
493 493
 # special depends for main.o
494
-main.d main.o: autover.h
495 494
 main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
496 495
 
497 496
 
498
-#special depends for core_cmd.o
499
-core_cmd.d core_cmd.o: autover.h
497
+#special depends for ver.c
498
+ver.d ver.o: autover.h
500 499
 
501 500
 include Makefile.shared
502 501
 
... ...
@@ -564,10 +563,14 @@ repo_ver=$(shell  RV=`git rev-parse --verify --short=6 HEAD 2>/dev/null`;\
564 564
 							; git diff-index --name-only HEAD 2>/dev/null | \
565 565
 								grep -v Makefile`" &&\
566 566
 						RV="$$RV"-dirty; echo "$$RV")
567
+repo_hash=$(subst -dirty,,$(repo_ver))
568
+repo_state=$(patsubst %-dirty,dirty,$(repo_ver))
567 569
 autover_h_dep=.git $(filter-out $(auto_gen), $(sources)) cfg.y cfg.lex
568 570
 else
569 571
 # else if .git/ does not exist
570 572
 repo_ver=
573
+repo_hash="unknown"
574
+repo_state=
571 575
 autover_h_dep=
572 576
 endif
573 577
 
... ...
@@ -579,6 +582,8 @@ autover.h: $(autover_h_dep)
579 579
 	@echo " */" >>$@
580 580
 	@echo "" >>$@
581 581
 	@echo "#define REPO_VER \"$(repo_ver)\"" >>$@
582
+	@echo "#define REPO_HASH \"$(repo_hash)\"" >>$@
583
+	@echo "#define REPO_STATE \"$(repo_state)\"" >>$@
582 584
 
583 585
 .PHONY: all
584 586
 all: $(NAME) every-module
... ...
@@ -20,18 +20,16 @@
20 20
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 21
  */
22 22
 
23
-/*!
24
- * \file
25
- * \brief SIP-router core :: 
26
- * \ingroup core
27
- * Module: \ref core
23
+/** core rpcs.
24
+ * @file core_cmd.c
25
+ * @ingroup core
28 26
  */
29 27
 
30 28
 
31 29
 #include <time.h>
32 30
 #include <sys/types.h>
33 31
 #include <signal.h>
34
-#include "autover.h"
32
+#include "ver.h"
35 33
 #include "mem/mem.h"
36 34
 #include "mem/shm_mem.h"
37 35
 #include "sr_module.h"
... ...
@@ -336,7 +334,7 @@ static const char* core_version_doc[] = {
336 336
 
337 337
 static void core_version(rpc_t* rpc, void* c)
338 338
 {
339
-	rpc->add(c, "s", SERVER_HDR " " REPO_VER );
339
+	rpc->add(c, "s", full_version);
340 340
 }
341 341
 
342 342
 
... ...
@@ -73,23 +73,20 @@
73 73
  * 2008-08-08  sctp support (andrei)
74 74
  * 2008-08-19  -l support for mmultihomed addresses/addresses lists
75 75
  *                (e.g. -l (eth0, 1.2.3.4, foo.bar) ) (andrei)
76
- *  2010-04-19 added daemon_status_fd pipe to communicate the parent process with
77
-               the main process in daemonize mode, so the parent process can return
78
-               the proper exit status code (ibc)
76
+ *  2010-04-19 added daemon_status_fd pipe to communicate the parent process
77
+ *             with the main process in daemonize mode, so the parent process
78
+ *             can return the proper exit status code (ibc)
79 79
  */
80 80
 
81
-/*!
82
- * \file
83
- * \brief SIP-router core :: 
84
- * \ingroup core
85
- * Module: \ref core
81
+/** main file (init, daemonize, startup) 
82
+ * @file main.c
83
+ * @ingroup core
84
+ * Module: core
86 85
  */
87 86
 
88
-/*! \defgroup core SIP-router core
89
- *
90
- * This modules implements a SIP server with a module interface
91
- * for extendability.
87
+/*! @defgroup core SIP-router core
92 88
  *
89
+ * sip router core part.
93 90
  */
94 91
 
95 92
 #include <stdio.h>
... ...
@@ -190,8 +187,7 @@
190 190
 #ifdef DEBUG_DMALLOC
191 191
 #include <dmalloc.h>
192 192
 #endif
193
-#include "autover.h"
194
-#include "version.h"
193
+#include "ver.h"
195 194
 
196 195
 /* define SIG_DEBUG by default */
197 196
 #ifdef NO_SIG_DEBUG
... ...
@@ -200,10 +196,6 @@
200 200
 #define SIG_DEBUG
201 201
 #endif
202 202
 
203
-static char id[]="@(#) $Id$";
204
-static char* version=SER_FULL_VERSION " " REPO_VER;
205
-static char* flags=SER_COMPILE_FLAGS;
206
-char compiled[]= __TIME__ " " __DATE__ ;
207 203
 
208 204
 
209 205
 static char help_msg[]= "\
... ...
@@ -1688,7 +1680,7 @@ int main(int argc, char** argv)
1688 1688
 	opterr = 0;
1689 1689
 	while((c=getopt(argc,argv,options))!=-1) {
1690 1690
 		if (c == 'h' || (optarg && strcmp(optarg, "-h") == 0)) {
1691
-			printf("version: %s\n", version);
1691
+			printf("version: %s\n", full_version);
1692 1692
 			printf("%s",help_msg);
1693 1693
 			exit(0);
1694 1694
 			break;
... ...
@@ -1724,8 +1716,8 @@ int main(int argc, char** argv)
1724 1724
 					default_core_cfg.debug++;
1725 1725
 					break;
1726 1726
 			case 'V':
1727
-					printf("version: %s\n", version);
1728
-					printf("flags: %s\n", flags );
1727
+					printf("version: %s\n", full_version);
1728
+					printf("flags: %s\n", ver_flags );
1729 1729
 					print_ct_constants();
1730 1730
 #ifdef USE_SCTP
1731 1731
 					tmp=malloc(256);
... ...
@@ -1733,9 +1725,9 @@ int main(int argc, char** argv)
1733 1733
 						printf("sctp unsupported socket options: %s\n", tmp);
1734 1734
 					if (tmp) free(tmp);
1735 1735
 #endif
1736
-					printf("%s\n",id);
1737
-					printf("%s compiled on %s with %s\n", __FILE__,
1738
-							compiled, COMPILER );
1736
+					printf("id: %s\n", ver_id);
1737
+					printf("compiled on %s with %s\n",
1738
+							ver_compiled_time, ver_compiler );
1739 1739
 
1740 1740
 					exit(0);
1741 1741
 					break;
... ...
@@ -47,7 +47,7 @@
47 47
 #include "../../pt.h"
48 48
 #include "../../mem/mem.h"
49 49
 #include "../../lib/kmi/mi.h"
50
-#include "../../version.h"
50
+#include "../../ver.h"
51 51
 #include "../../cfg/cfg.h"
52 52
 #include "../../cfg/cfg_ctx.h"
53 53
 
... ...
@@ -139,12 +139,8 @@ static struct mi_root *mi_version(struct mi_root *cmd, void *param)
139 139
 	if (node==0) 
140 140
 		goto error;
141 141
 
142
-#ifndef KAMAILIO_COMPILE_FLAGS
143
-#define KAMAILIO_COMPILE_FLAGS SER_COMPILE_FLAGS
144
-#endif
145
-
146
-	node = add_mi_node_child( rpl, 0, MI_SSTR("Flags"), KAMAILIO_COMPILE_FLAGS,
147
-			sizeof(KAMAILIO_COMPILE_FLAGS)-1);
142
+	node = add_mi_node_child( rpl, 0, MI_SSTR("Flags"), (char*)ver_flags,
143
+				strlen(ver_flags));
148 144
 	if (node==0) 
149 145
 		goto error;	
150 146
 	
... ...
@@ -61,7 +61,7 @@
61 61
 #include <dlfcn.h>
62 62
 
63 63
 #include "parser/msg_parser.h" /* for sip_msg */
64
-#include "version.h"
64
+#include "ver_defs.h"
65 65
 #include "rpc.h"
66 66
 #include "route_struct.h"
67 67
 #include "route.h"
68 68
new file mode 100644
... ...
@@ -0,0 +1,46 @@
0
+/* 
1
+ * $Id$
2
+ * 
3
+ * Copyright (C) 2010 iptelorg GmbH
4
+ *
5
+ * Permission to use, copy, modify, and distribute this software for any
6
+ * purpose with or without fee is hereby granted, provided that the above
7
+ * copyright notice and this permission notice appear in all copies.
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+ */
17
+/** version strings.
18
+ * @file ver.c
19
+ * @ingroup: core
20
+ */
21
+/*
22
+ * History:
23
+ * --------
24
+ *  2010-07-13  initial version (andrei)
25
+*/
26
+
27
+#include "ver_defs.h"
28
+#include "autover.h" /* REPO_VER, REPO_STATE */
29
+
30
+
31
+const char full_version[] = SER_FULL_VERSION " " REPO_VER;
32
+const char ver_id[] = REPO_HASH " " REPO_STATE;
33
+const char ver_compiled_time[] =  __TIME__ " " __DATE__ ;
34
+const char ver_compiler[] = COMPILER;
35
+
36
+const char ver_flags[] = SER_COMPILE_FLAGS;
37
+
38
+/** hash-state. */
39
+const char repo_ver[] = REPO_VER;
40
+/** git hash. */
41
+const char repo_hash[] = REPO_HASH;
42
+/** state of the repository: dirty (uncommited changes) or "" */
43
+const char repo_state[] = REPO_STATE;
44
+
45
+/* vi: set ts=4 sw=4 tw=79:ai:cindent: */
0 46
new file mode 100644
... ...
@@ -0,0 +1,43 @@
0
+/* 
1
+ * $Id$
2
+ * 
3
+ * Copyright (C) 2010 iptelorg GmbH
4
+ *
5
+ * Permission to use, copy, modify, and distribute this software for any
6
+ * purpose with or without fee is hereby granted, provided that the above
7
+ * copyright notice and this permission notice appear in all copies.
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+ */
17
+/** version strings.
18
+ * @file ver.h
19
+ * @ingroup: core
20
+ */
21
+/*
22
+ * History:
23
+ * --------
24
+ *  2010-07-13  initial version (andrei)
25
+*/
26
+
27
+#ifndef __ver_h
28
+#define __ver_h
29
+
30
+extern const char full_version[];
31
+extern const char ver_id[];
32
+extern const char ver_compiled_time[];
33
+extern const char ver_compiler[];
34
+extern const char ver_flags[];
35
+extern const char repo_ver[];
36
+extern const char repo_hash[];
37
+extern const char repo_state[];
38
+
39
+
40
+#endif /*__ver_h*/
41
+
42
+/* vi: set ts=4 sw=4 tw=79:ai:cindent: */
0 43
new file mode 100644
... ...
@@ -0,0 +1,353 @@
0
+/*
1
+ * $Id$
2
+ *
3
+ * version and compile flags macros 
4
+ *
5
+ *
6
+ * Copyright (C) 2004 FhG Fokus
7
+ *
8
+ * This file is part of SIP-router, a free SIP server.
9
+ *
10
+ * SIP-router is free software; you can redistribute it and/or modify
11
+ * it under the terms of the GNU General Public License as published by
12
+ * the Free Software Foundation; either version 2 of the License, or
13
+ * (at your option) any later version
14
+ *
15
+ * SIP-router is distributed in the hope that it will be useful,
16
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ * GNU General Public License for more details.
19
+ *
20
+ * You should have received a copy of the GNU General Public License 
21
+ * along with this program; if not, write to the Free Software 
22
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
+ */
24
+
25
+/** compile flags and other version related defines.
26
+ * @file ver_defs.h
27
+ * @ingroup core
28
+ */
29
+
30
+#ifndef version_h
31
+#define version_h
32
+
33
+#define SER_FULL_VERSION  NAME " " VERSION " (" ARCH "/" OS_QUOTED ")" 
34
+
35
+#ifdef STATS
36
+#define STATS_STR  "STATS: On"
37
+#else
38
+#define STATS_STR  "STATS: Off"
39
+#endif
40
+
41
+#ifdef USE_IPV6
42
+#define USE_IPV6_STR ", USE_IPV6"
43
+#else
44
+#define USE_IPV6_STR ""
45
+#endif
46
+
47
+#ifdef USE_TCP
48
+#define USE_TCP_STR ", USE_TCP"
49
+#else
50
+#define USE_TCP_STR ""
51
+#endif
52
+
53
+#ifdef USE_TLS
54
+#define USE_TLS_STR ", USE_TLS"
55
+#else 
56
+#define USE_TLS_STR ""
57
+#endif
58
+
59
+#ifdef USE_SCTP
60
+#define USE_SCTP_STR ", USE_SCTP"
61
+#else
62
+#define USE_SCTP_STR ""
63
+#endif
64
+
65
+#ifdef CORE_TLS
66
+#define CORE_TLS_STR ", CORE_TLS"
67
+#else 
68
+#define CORE_TLS_STR ""
69
+#endif
70
+
71
+#ifdef TLS_HOOKS
72
+#define TLS_HOOKS_STR ", TLS_HOOKS"
73
+#else 
74
+#define TLS_HOOKS_STR ""
75
+#endif
76
+
77
+
78
+#ifdef DISABLE_NAGLE
79
+#define DISABLE_NAGLE_STR ", DISABLE_NAGLE"
80
+#else
81
+#define DISABLE_NAGLE_STR ""
82
+#endif
83
+
84
+#ifdef USE_MCAST
85
+#define USE_MCAST_STR ", USE_MCAST"
86
+#else
87
+#define USE_MCAST_STR ""
88
+#endif
89
+
90
+
91
+#ifdef NO_DEBUG
92
+#define NO_DEBUG_STR ", NO_DEBUG"
93
+#else
94
+#define NO_DEBUG_STR ""
95
+#endif
96
+
97
+#ifdef NO_LOG
98
+#define NO_LOG_STR ", NO_LOG"
99
+#else
100
+#define NO_LOG_STR ""
101
+#endif
102
+
103
+#ifdef EXTRA_DEBUG
104
+#define EXTRA_DEBUG_STR ", EXTRA_DEBUG"
105
+#else
106
+#define EXTRA_DEBUG_STR ""
107
+#endif
108
+
109
+#ifdef DNS_IP_HACK
110
+#define DNS_IP_HACK_STR ", DNS_IP_HACK"
111
+#else
112
+#define DNS_IP_HACK_STR ""
113
+#endif
114
+
115
+#ifdef SHM_MEM
116
+#define SHM_MEM_STR ", SHM_MEM"
117
+#else
118
+#define SHM_MEM_STR ""
119
+#endif
120
+
121
+#ifdef SHM_MMAP
122
+#define SHM_MMAP_STR ", SHM_MMAP"
123
+#else
124
+#define SHM_MMAP_STR ""
125
+#endif
126
+
127
+#ifdef PKG_MALLOC
128
+#define PKG_MALLOC_STR ", PKG_MALLOC"
129
+#else
130
+#define PKG_MALLOC_STR ""
131
+#endif
132
+
133
+#ifdef F_MALLOC
134
+#define F_MALLOC_STR ", F_MALLOC"
135
+#else
136
+#define F_MALLOC_STR ""
137
+#endif
138
+
139
+#ifdef DL_MALLOC
140
+#define DL_MALLOC_STR ", DL_MALLOC"
141
+#else
142
+#define DL_MALLOC_STR ""
143
+#endif
144
+
145
+#ifdef SF_MALLOC
146
+#define SF_MALLOC_STR ", SF_MALLOC"
147
+#else
148
+#define SF_MALLOC_STR ""
149
+#endif
150
+
151
+#ifdef LL_MALLOC
152
+#define LL_MALLOC_STR ", LL_MALLOC"
153
+#else
154
+#define LL_MALLOC_STR ""
155
+#endif
156
+
157
+#ifdef USE_SHM_MEM
158
+#define USE_SHM_MEM_STR ", USE_SHM_MEM"
159
+#else
160
+#define USE_SHM_MEM_STR ""
161
+#endif
162
+
163
+#ifdef DBG_QM_MALLOC
164
+#define DBG_QM_MALLOC_STR ", DBG_QM_MALLOC"
165
+#else
166
+#define DBG_QM_MALLOC_STR ""
167
+#endif
168
+
169
+#ifdef DBG_F_MALLOC
170
+#define DBG_F_MALLOC_STR ", DBG_F_MALLOC"
171
+#else
172
+#define DBG_F_MALLOC_STR ""
173
+#endif
174
+
175
+#ifdef DEBUG_DMALLOC
176
+#define DEBUG_DMALLOC_STR ", DEBUG_DMALLOC"
177
+#else
178
+#define DEBUG_DMALLOC_STR ""
179
+#endif
180
+
181
+#ifdef DBG_SF_MALLOC
182
+#define DBG_SF_MALLOC_STR ", DBG_SF_MALLOC"
183
+#else
184
+#define DBG_SF_MALLOC_STR ""
185
+#endif
186
+
187
+#ifdef DBG_LL_MALLOC
188
+#define DBG_LL_MALLOC_STR ", DBG_SF_MALLOC"
189
+#else
190
+#define DBG_LL_MALLOC_STR ""
191
+#endif
192
+
193
+#ifdef TIMER_DEBUG
194
+#define TIMER_DEBUG_STR ", TIMER_DEBUG"
195
+#else
196
+#define TIMER_DEBUG_STR ""
197
+#endif
198
+
199
+#ifdef USE_FUTEX
200
+#define USE_FUTEX_STR ", USE_FUTEX"
201
+#else
202
+#define USE_FUTEX_STR ""
203
+#endif
204
+
205
+
206
+#ifdef FAST_LOCK
207
+#ifdef BUSY_WAIT
208
+#define FAST_LOCK_STR ", FAST_LOCK-BUSY_WAIT"
209
+#elif defined (ADAPTIVE_WAIT)
210
+#define FAST_LOCK_STR ", FAST_LOCK-ADAPTIVE_WAIT"
211
+#else
212
+#define FAST_LOCK_STR ", FAST_LOCK"
213
+#endif
214
+#else
215
+#define FAST_LOCK_STR ""
216
+#endif
217
+
218
+#ifdef USE_PTHREAD_MUTEX
219
+#define USE_PTHREAD_MUTEX_STR ", USE_PTHREAD_MUTEX"
220
+#else
221
+#define USE_PTHREAD_MUTEX_STR ""
222
+#endif
223
+
224
+#ifdef USE_POSIX_SEM
225
+#define USE_POSIX_SEM_STR ", USE_POSIX_SEM"
226
+#else
227
+#define USE_POSIX_SEM_STR ""
228
+#endif
229
+
230
+#ifdef USE_SYSV_SEM
231
+#define USE_SYSV_SEM_STR ", USE_SYSV_SEM"
232
+#else
233
+#define USE_SYSV_SEM_STR ""
234
+#endif
235
+
236
+#ifdef NOSMP
237
+#define NOSMP_STR "-NOSMP"
238
+#else
239
+#define NOSMP_STR ""
240
+#endif
241
+
242
+
243
+#ifdef USE_COMP
244
+#define USE_COMP_STR ", USE_COMP"
245
+#else
246
+#define USE_COMP_STR ""
247
+#endif
248
+
249
+
250
+#ifdef USE_DNS_CACHE
251
+#define USE_DNS_CACHE_STR ", USE_DNS_CACHE"
252
+#else
253
+#define USE_DNS_CACHE_STR ""
254
+#endif
255
+
256
+#ifdef USE_DNS_FAILOVER
257
+#define USE_DNS_FAILOVER_STR ", USE_DNS_FAILOVER"
258
+#else
259
+#define USE_DNS_FAILOVER_STR ""
260
+#endif
261
+
262
+#ifdef DNS_WATCHDOG_SUPPORT
263
+#define DNS_WATCHDOG_SUPPORT_STR ", DNS_WATCHDOG_SUPPORT"
264
+#else
265
+#define DNS_WATCHDOG_SUPPORT_STR ""
266
+#endif
267
+
268
+#ifdef USE_NAPTR
269
+#define USE_NAPTR_STR ", USE_NAPTR"
270
+#else
271
+#define USE_NAPTR_STR ""
272
+#endif
273
+
274
+#ifdef USE_DST_BLACKLIST
275
+#define USE_DST_BLACKLIST_STR ", USE_DST_BLACKLIST"
276
+#else
277
+#define USE_DST_BLACKLIST_STR ""
278
+#endif
279
+
280
+#ifdef NO_SIG_DEBUG
281
+#define NO_SIG_DEBUG_STR ", NO_SIG_DEBUG"
282
+#else
283
+#define NO_SIG_DEBUG_STR ""
284
+#endif
285
+
286
+#ifdef USE_STUN
287
+#define USE_STUN_STR ", USE_STUN"
288
+#else
289
+#define USE_STUN_STR ""
290
+#endif
291
+
292
+#ifdef HAVE_RESOLV_RES 
293
+#define HAVE_RESOLV_RES_STR ", HAVE_RESOLV_RES"
294
+#else
295
+#define HAVE_RESOLV_RES_STR ""
296
+#endif
297
+
298
+#ifdef HTTP_REPLY_HACK 
299
+#define HTTP_REPLY_HACK_STR ", HTTP_REPLY_HACK"
300
+#else
301
+#define HTTP_REPLY_HACK_STR ""
302
+#endif
303
+
304
+#ifdef QM_JOIN_FREE 
305
+#define QM_JOIN_FREE_STR ", QM_JOIN_FREE"
306
+#else
307
+#define QM_JOIN_FREE_STR ""
308
+#endif
309
+
310
+#ifdef SYSLOG_CALLBACK_SUPPORT 
311
+#define SYSLOG_CALLBACK_SUPPORT_STR, ", SYSLOG_CALLBACK_SUPPORT"
312
+#else
313
+#define SYSLOG_CALLBACK_SUPPORT_STR ""
314
+#endif
315
+
316
+#ifdef MYSQL_FAKE_NULL
317
+#define MYSQL_FAKE_NULL_STR, ", MYSQL_FAKE_NULL"
318
+#else
319
+#define MYSQL_FAKE_NULL_STR ""
320
+#endif
321
+
322
+#ifdef USE_DNS_CACHE_STATS
323
+#define USE_DNS_CACHE_STATS_STR ", USE_DNS_CACHE_STATS"
324
+#else
325
+#define USE_DNS_CACHE_STATS_STR ""
326
+#endif
327
+
328
+#ifdef USE_DST_BLACKLIST_STATS
329
+#define USE_DST_BLACKLIST_STATS_STR ", USE_DST_BLACKLIST_STATS"
330
+#else
331
+#define USE_DST_BLACKLIST_STATS_STR ""
332
+#endif
333
+
334
+#define SER_COMPILE_FLAGS \
335
+	STATS_STR EXTRA_DEBUG_STR USE_IPV6_STR USE_TCP_STR USE_TLS_STR \
336
+	USE_SCTP_STR CORE_TLS_STR TLS_HOOKS_STR \
337
+	USE_STUN_STR DISABLE_NAGLE_STR USE_MCAST_STR NO_DEBUG_STR NO_LOG_STR \
338
+	NO_SIG_DEBUG_STR DNS_IP_HACK_STR  SHM_MEM_STR SHM_MMAP_STR PKG_MALLOC_STR \
339
+	F_MALLOC_STR DL_MALLOC_STR SF_MALLOC_STR  LL_MALLOC_STR \
340
+	USE_SHM_MEM_STR \
341
+	DBG_QM_MALLOC_STR \
342
+	DBG_F_MALLOC_STR DEBUG_DMALLOC_STR DBG_SF_MALLOC_STR DBG_LL_MALLOC_STR \
343
+	TIMER_DEBUG_STR \
344
+	USE_FUTEX_STR \
345
+	FAST_LOCK_STR NOSMP_STR USE_PTHREAD_MUTEX_STR USE_POSIX_SEM_STR \
346
+	USE_SYSV_SEM_STR USE_COMP_STR USE_DNS_CACHE_STR USE_DNS_FAILOVER_STR \
347
+	DNS_WATCHDOG_SUPPORT_STR USE_NAPTR_STR USE_DST_BLACKLIST_STR \
348
+	HAVE_RESOLV_RES_STR HTTP_REPLY_HACK_STR SYSLOG_CALLBACK_SUPPORT_STR \
349
+	MYSQL_FAKE_NULL_STR USE_DST_BLACKLIST_STATS_STR USE_DNS_CACHE_STATS_STR
350
+
351
+
352
+#endif
0 353
deleted file mode 100644
... ...
@@ -1,356 +0,0 @@
1
-/*
2
- * $Id$
3
- *
4
- * version and compile flags macros 
5
- *
6
- *
7
- * Copyright (C) 2004 FhG Fokus
8
- *
9
- * This file is part of SIP-router, a free SIP server.
10
- *
11
- * SIP-router is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; either version 2 of the License, or
14
- * (at your option) any later version
15
- *
16
- * SIP-router is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
- * GNU General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU General Public License 
22
- * along with this program; if not, write to the Free Software 
23
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24
- */
25
-
26
-/*!
27
- * \file
28
- * \brief SIP-router core :: version and compile flag macros
29
- * \ingroup core
30
- *
31
- * Module: \ref core
32
- */
33
-
34
-#ifndef version_h
35
-#define version_h
36
-
37
-#define SER_FULL_VERSION  NAME " " VERSION " (" ARCH "/" OS_QUOTED ")" 
38
-
39
-#ifdef STATS
40
-#define STATS_STR  "STATS: On"
41
-#else
42
-#define STATS_STR  "STATS: Off"
43
-#endif
44
-
45
-#ifdef USE_IPV6
46
-#define USE_IPV6_STR ", USE_IPV6"
47
-#else
48
-#define USE_IPV6_STR ""
49
-#endif
50
-
51
-#ifdef USE_TCP
52
-#define USE_TCP_STR ", USE_TCP"
53
-#else
54
-#define USE_TCP_STR ""
55
-#endif
56
-
57
-#ifdef USE_TLS
58
-#define USE_TLS_STR ", USE_TLS"
59
-#else 
60
-#define USE_TLS_STR ""
61
-#endif
62
-
63
-#ifdef USE_SCTP
64
-#define USE_SCTP_STR ", USE_SCTP"
65
-#else
66
-#define USE_SCTP_STR ""
67
-#endif
68
-
69
-#ifdef CORE_TLS
70
-#define CORE_TLS_STR ", CORE_TLS"
71
-#else 
72
-#define CORE_TLS_STR ""
73
-#endif
74
-
75
-#ifdef TLS_HOOKS
76
-#define TLS_HOOKS_STR ", TLS_HOOKS"
77
-#else 
78
-#define TLS_HOOKS_STR ""
79
-#endif
80
-
81
-
82
-#ifdef DISABLE_NAGLE
83
-#define DISABLE_NAGLE_STR ", DISABLE_NAGLE"
84
-#else
85
-#define DISABLE_NAGLE_STR ""
86
-#endif
87
-
88
-#ifdef USE_MCAST
89
-#define USE_MCAST_STR ", USE_MCAST"
90
-#else
91
-#define USE_MCAST_STR ""
92
-#endif
93
-
94
-
95
-#ifdef NO_DEBUG
96
-#define NO_DEBUG_STR ", NO_DEBUG"
97
-#else
98
-#define NO_DEBUG_STR ""
99
-#endif
100
-
101
-#ifdef NO_LOG
102
-#define NO_LOG_STR ", NO_LOG"
103
-#else
104
-#define NO_LOG_STR ""
105
-#endif
106
-
107
-#ifdef EXTRA_DEBUG
108
-#define EXTRA_DEBUG_STR ", EXTRA_DEBUG"
109
-#else
110
-#define EXTRA_DEBUG_STR ""
111
-#endif
112
-
113
-#ifdef DNS_IP_HACK
114
-#define DNS_IP_HACK_STR ", DNS_IP_HACK"
115
-#else
116
-#define DNS_IP_HACK_STR ""
117
-#endif
118
-
119
-#ifdef SHM_MEM
120
-#define SHM_MEM_STR ", SHM_MEM"
121
-#else
122
-#define SHM_MEM_STR ""
123
-#endif
124
-
125
-#ifdef SHM_MMAP
126
-#define SHM_MMAP_STR ", SHM_MMAP"
127
-#else
128
-#define SHM_MMAP_STR ""
129
-#endif
130
-
131
-#ifdef PKG_MALLOC
132
-#define PKG_MALLOC_STR ", PKG_MALLOC"
133
-#else
134
-#define PKG_MALLOC_STR ""
135
-#endif
136
-
137
-#ifdef F_MALLOC
138
-#define F_MALLOC_STR ", F_MALLOC"
139
-#else
140
-#define F_MALLOC_STR ""
141
-#endif
142
-
143
-#ifdef DL_MALLOC
144
-#define DL_MALLOC_STR ", DL_MALLOC"
145
-#else
146
-#define DL_MALLOC_STR ""
147
-#endif
148
-
149
-#ifdef SF_MALLOC
150
-#define SF_MALLOC_STR ", SF_MALLOC"
151
-#else
152
-#define SF_MALLOC_STR ""
153
-#endif
154
-
155
-#ifdef LL_MALLOC
156
-#define LL_MALLOC_STR ", LL_MALLOC"
157
-#else
158
-#define LL_MALLOC_STR ""
159
-#endif
160
-
161
-#ifdef USE_SHM_MEM
162
-#define USE_SHM_MEM_STR ", USE_SHM_MEM"
163
-#else
164
-#define USE_SHM_MEM_STR ""
165
-#endif
166
-
167
-#ifdef DBG_QM_MALLOC
168
-#define DBG_QM_MALLOC_STR ", DBG_QM_MALLOC"
169
-#else
170
-#define DBG_QM_MALLOC_STR ""
171
-#endif
172
-
173
-#ifdef DBG_F_MALLOC
174
-#define DBG_F_MALLOC_STR ", DBG_F_MALLOC"
175
-#else
176
-#define DBG_F_MALLOC_STR ""
177
-#endif
178
-
179
-#ifdef DEBUG_DMALLOC
180
-#define DEBUG_DMALLOC_STR ", DEBUG_DMALLOC"
181
-#else
182
-#define DEBUG_DMALLOC_STR ""
183
-#endif
184
-
185
-#ifdef DBG_SF_MALLOC
186
-#define DBG_SF_MALLOC_STR ", DBG_SF_MALLOC"
187
-#else
188
-#define DBG_SF_MALLOC_STR ""
189
-#endif
190
-
191
-#ifdef DBG_LL_MALLOC
192
-#define DBG_LL_MALLOC_STR ", DBG_SF_MALLOC"
193
-#else
194
-#define DBG_LL_MALLOC_STR ""
195
-#endif
196
-
197
-#ifdef TIMER_DEBUG
198
-#define TIMER_DEBUG_STR ", TIMER_DEBUG"
199
-#else
200
-#define TIMER_DEBUG_STR ""
201
-#endif
202
-
203
-#ifdef USE_FUTEX
204
-#define USE_FUTEX_STR ", USE_FUTEX"
205
-#else
206
-#define USE_FUTEX_STR ""
207
-#endif
208
-
209
-
210
-#ifdef FAST_LOCK
211
-#ifdef BUSY_WAIT
212
-#define FAST_LOCK_STR ", FAST_LOCK-BUSY_WAIT"
213
-#elif defined (ADAPTIVE_WAIT)
214
-#define FAST_LOCK_STR ", FAST_LOCK-ADAPTIVE_WAIT"
215
-#else
216
-#define FAST_LOCK_STR ", FAST_LOCK"
217
-#endif
218
-#else
219
-#define FAST_LOCK_STR ""
220
-#endif
221
-
222
-#ifdef USE_PTHREAD_MUTEX
223
-#define USE_PTHREAD_MUTEX_STR ", USE_PTHREAD_MUTEX"
224
-#else
225
-#define USE_PTHREAD_MUTEX_STR ""
226
-#endif
227
-
228
-#ifdef USE_POSIX_SEM
229
-#define USE_POSIX_SEM_STR ", USE_POSIX_SEM"
230
-#else
231
-#define USE_POSIX_SEM_STR ""
232
-#endif
233
-
234
-#ifdef USE_SYSV_SEM
235
-#define USE_SYSV_SEM_STR ", USE_SYSV_SEM"
236
-#else
237
-#define USE_SYSV_SEM_STR ""
238
-#endif
239
-
240
-#ifdef NOSMP
241
-#define NOSMP_STR "-NOSMP"
242
-#else
243
-#define NOSMP_STR ""
244
-#endif
245
-
246
-
247
-#ifdef USE_COMP
248
-#define USE_COMP_STR ", USE_COMP"
249
-#else
250
-#define USE_COMP_STR ""
251
-#endif
252
-
253
-
254
-#ifdef USE_DNS_CACHE
255
-#define USE_DNS_CACHE_STR ", USE_DNS_CACHE"
256
-#else
257
-#define USE_DNS_CACHE_STR ""
258
-#endif
259
-
260
-#ifdef USE_DNS_FAILOVER
261
-#define USE_DNS_FAILOVER_STR ", USE_DNS_FAILOVER"
262
-#else
263
-#define USE_DNS_FAILOVER_STR ""
264
-#endif
265
-
266
-#ifdef DNS_WATCHDOG_SUPPORT
267
-#define DNS_WATCHDOG_SUPPORT_STR ", DNS_WATCHDOG_SUPPORT"
268
-#else
269
-#define DNS_WATCHDOG_SUPPORT_STR ""
270
-#endif
271
-
272
-#ifdef USE_NAPTR
273
-#define USE_NAPTR_STR ", USE_NAPTR"
274
-#else
275
-#define USE_NAPTR_STR ""
276
-#endif
277
-
278
-#ifdef USE_DST_BLACKLIST
279
-#define USE_DST_BLACKLIST_STR ", USE_DST_BLACKLIST"
280
-#else
281
-#define USE_DST_BLACKLIST_STR ""
282
-#endif
283
-
284
-#ifdef NO_SIG_DEBUG
285
-#define NO_SIG_DEBUG_STR ", NO_SIG_DEBUG"
286
-#else
287
-#define NO_SIG_DEBUG_STR ""
288
-#endif
289
-
290
-#ifdef USE_STUN
291
-#define USE_STUN_STR ", USE_STUN"
292
-#else
293
-#define USE_STUN_STR ""
294
-#endif
295
-
296
-#ifdef HAVE_RESOLV_RES 
297
-#define HAVE_RESOLV_RES_STR ", HAVE_RESOLV_RES"
298
-#else
299
-#define HAVE_RESOLV_RES_STR ""
300
-#endif
301
-
302
-#ifdef HTTP_REPLY_HACK 
303
-#define HTTP_REPLY_HACK_STR ", HTTP_REPLY_HACK"
304
-#else
305
-#define HTTP_REPLY_HACK_STR ""
306
-#endif
307
-
308
-#ifdef QM_JOIN_FREE 
309
-#define QM_JOIN_FREE_STR ", QM_JOIN_FREE"
310
-#else
311
-#define QM_JOIN_FREE_STR ""
312
-#endif
313
-
314
-#ifdef SYSLOG_CALLBACK_SUPPORT 
315
-#define SYSLOG_CALLBACK_SUPPORT_STR, ", SYSLOG_CALLBACK_SUPPORT"
316
-#else
317
-#define SYSLOG_CALLBACK_SUPPORT_STR ""
318
-#endif
319
-
320
-#ifdef MYSQL_FAKE_NULL
321
-#define MYSQL_FAKE_NULL_STR, ", MYSQL_FAKE_NULL"
322
-#else
323
-#define MYSQL_FAKE_NULL_STR ""
324
-#endif
325
-
326
-#ifdef USE_DNS_CACHE_STATS
327
-#define USE_DNS_CACHE_STATS_STR ", USE_DNS_CACHE_STATS"
328
-#else
329
-#define USE_DNS_CACHE_STATS_STR ""
330
-#endif
331
-
332
-#ifdef USE_DST_BLACKLIST_STATS
333
-#define USE_DST_BLACKLIST_STATS_STR ", USE_DST_BLACKLIST_STATS"
334
-#else
335
-#define USE_DST_BLACKLIST_STATS_STR ""
336
-#endif
337
-
338
-#define SER_COMPILE_FLAGS \
339
-	STATS_STR EXTRA_DEBUG_STR USE_IPV6_STR USE_TCP_STR USE_TLS_STR \
340
-	USE_SCTP_STR CORE_TLS_STR TLS_HOOKS_STR \
341
-	USE_STUN_STR DISABLE_NAGLE_STR USE_MCAST_STR NO_DEBUG_STR NO_LOG_STR \
342
-	NO_SIG_DEBUG_STR DNS_IP_HACK_STR  SHM_MEM_STR SHM_MMAP_STR PKG_MALLOC_STR \
343
-	F_MALLOC_STR DL_MALLOC_STR SF_MALLOC_STR  LL_MALLOC_STR \
344
-	USE_SHM_MEM_STR \
345
-	DBG_QM_MALLOC_STR \
346
-	DBG_F_MALLOC_STR DEBUG_DMALLOC_STR DBG_SF_MALLOC_STR DBG_LL_MALLOC_STR \
347
-	TIMER_DEBUG_STR \
348
-	USE_FUTEX_STR \
349
-	FAST_LOCK_STR NOSMP_STR USE_PTHREAD_MUTEX_STR USE_POSIX_SEM_STR \
350
-	USE_SYSV_SEM_STR USE_COMP_STR USE_DNS_CACHE_STR USE_DNS_FAILOVER_STR \
351
-	DNS_WATCHDOG_SUPPORT_STR USE_NAPTR_STR USE_DST_BLACKLIST_STR \
352
-	HAVE_RESOLV_RES_STR HTTP_REPLY_HACK_STR SYSLOG_CALLBACK_SUPPORT_STR \
353
-	MYSQL_FAKE_NULL_STR USE_DST_BLACKLIST_STATS_STR USE_DNS_CACHE_STATS_STR
354
-
355
-
356
-#endif