Browse code

- SYSV lock fixes: fixed includes, added seteuid before lock init and restore it afterwards (so that SYSV sems get created with the proper uid in case -u uid is used) - moved shm_mem initialization after the config is parsed (so that ser will know if it's supposed to suid and use the seteuid hack above in the SYSV locks case) - fixed ser shutdown procedure on main_loop error (proper cleanup) - the fifo file is now deleted on exit - added version.h and changed module version control to check also the compile flags - usrloc: fixed missing lock_destroy - usrloc: fixed DB capability check even if no db mode

Andrei Pelinescu-Onciul authored on 19/09/2004 20:22:51
Showing 10 changed files
... ...
@@ -48,7 +48,7 @@ skip_modules?=
48 48
 exclude_modules?= 			cpl ext extcmd \
49 49
 							postgres snmp \
50 50
 							im \
51
-							jabber \
51
+							jabber mysql \
52 52
 							cpl-c \
53 53
 							auth_radius group_radius uri_radius \
54 54
 							pa
... ...
@@ -49,7 +49,7 @@ MAIN_NAME=ser
49 49
 VERSION = 0
50 50
 PATCHLEVEL = 8
51 51
 SUBLEVEL =   99
52
-EXTRAVERSION = -dev5
52
+EXTRAVERSION = -dev6
53 53
 
54 54
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
55 55
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -282,7 +282,7 @@ endif
282 282
 
283 283
 
284 284
 DEFS+= $(extra_defs) \
285
-	 -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
285
+	 -DNAME='"$(MAIN_NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
286 286
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"' -D__CPU_$(ARCH) -D__OS_$(OS) \
287 287
 	 -DCFG_DIR='"$(cfg-target)"'\
288 288
 	 -DPKG_MALLOC \
289 289
new file mode 100644
... ...
@@ -0,0 +1,40 @@
0
+# $Id$
1
+# A short history of ser beginnings
2
+#
3
+# by Andrei Pelinescu-Onciul <pelinescu-onciul@fokus.fraunhofer.de>
4
+
5
+This is a short ser history based mainly on my memory and my old mail archive. I've tried to mention only the important events. I'm sure I have missed a lot of things and/or people. If this is your case, please don't feel offended, send me an email and I will straighten things up.
6
+
7
+
8
+
9
+Three years ago on 4 September 2001 I committed the first working ser version on a private cvs. In fact I started writting ser 2 days before, on 2nd September.
10
+ I was supposed to write some kind of sip glue for a Cisco PSTN gateway in 1 week, but of course I did it in the last 2 days :-)
11
+
12
+At that time the config looked like:
13
+
14
+#  method_re   sip_uri_re      dest_host
15
+# (warning: re cannot contain space)
16
+
17
+^R.*        ^sip:.*@dorian.*   ekina.fokus.gmd.de
18
+^INVITE     .*                 ape:5061             # my laptop
19
+.           .                  192.168.46.55
20
+
21
+A short time after this Jiri began testing the code and requesting new features.2 weeks later I completely changed the config format bringing it pretty close to what we have today. At the time Jiri stronlgy disagreed with the ideea arguing that the new config would increase code complexity too much and would severely 
22
+ impact performance. The final argument was: I already wrote the code and it works :-)
23
+In Octomber 2001 I made some changes to ser routing language bringing it to what we still use today.
24
+In the next months I've created the module interface, the first two modules (print and textops) and I've added the shared memory support (this involved the creation of ser's own malloc library which proved to be much faster for ser's memory usage patterns than standards malloc implementations).
25
+During the same period Bogdan and Jan joined me and Jiri also began writing code.
26
+In December 2001 Bogdan announced that tm was up an running (after a sleepless night).
27
+At the beginning of 2002 we were joined by Daniel. Jan introduced the mysql, usrloc and auth modules.
28
+Ser first public appearance was at the April 2002 Sipit. We ran it on a pda an still managed to be faster than the testing tools that were used against us :-)
29
+
30
+In May 2002 ser got ipv6 support.
31
+In August 2002 Nils commited sipsak to berlios (very usefull testing tool).
32
+In September 2002 ser went public: it was GPL'ed and the cvs tree was moved to berlios. During the same month Jiri introduced  the FIFO interface, Karel committed serweb and we had the first GPL'ed release: ser 0.8.8.
33
+In December 2002 ser got its first big external contribution: the enum module, written by  Juha Heinanen.
34
+In January 2003 Raphael commited sems on berlios.
35
+In February 2003 ser got tcp support.
36
+Sometime during the 2003 spring ser got the permissions module from Miklos Tirpak and nathelper from  Maxim Sobolev.
37
+In August 2003, Uli commited isdngw to sems.
38
+
39
+All the rest is too new to be in the history :-)
... ...
@@ -63,6 +63,7 @@
63 63
  *  2004-03-09  open_fifo_server split into init_ and start_ (andrei)
64 64
  *  2004-04-29  added chown(sock_user, sock_group)  (andrei)
65 65
  *  2004-06-06  updated to the new DB interface  & init_db_fifo (andrei)
66
+ *  2004-09-19  fifo is deleted on exit (destroy_fifo)  (andrei)
66 67
  */
67 68
 
68 69
 
... ...
@@ -157,6 +158,17 @@ void destroy_fifo()
157 157
 		pkg_free(c);
158 158
 		c=foo;
159 159
 	}
160
+	if (fifo_stream){
161
+			fclose(fifo_stream);
162
+			fifo_stream=0;
163
+		/* if  FIFO was created, delete it */
164
+		if (fifo && strlen(fifo)){
165
+			if (unlink(fifo)<0){
166
+				LOG(L_ERR, "WARNING: destroy_fifo: cannot delete fifo (%s):"
167
+							" %s\n", fifo, strerror(errno));
168
+			}
169
+		}
170
+	}
160 171
 }
161 172
 
162 173
 
... ...
@@ -123,6 +123,13 @@ inline static gen_lock_t* lock_init(gen_lock_t* lock)
123 123
 #include <sys/ipc.h>
124 124
 #include <sys/sem.h>
125 125
 
126
+#include <errno.h>
127
+#include <string.h>
128
+#include <sys/types.h>
129
+#include <unistd.h>
130
+#include "dprint.h"
131
+#include "globals.h" /* uid */
132
+
126 133
 #if ((defined(HAVE_UNION_SEMUN) || defined(__GNU_LIBRARY__) )&& !defined(_SEM_SEMUN_UNDEFINED)) 
127 134
 	
128 135
 	/* union semun is defined by including sem.h */
... ...
@@ -144,8 +151,14 @@ typedef int gen_lock_t;
144 144
 inline static gen_lock_t* lock_init(gen_lock_t* lock)
145 145
 {
146 146
 	union semun su;
147
+	int euid;
147 148
 	
149
+	euid=geteuid();
150
+	if (uid && uid!=euid)
151
+		seteuid(uid); /* set euid to the cfg. requested one */
148 152
 	*lock=semget(IPC_PRIVATE, 1, 0700);
153
+	if (uid && uid!=euid)
154
+		seteuid(euid); /* restore it */
149 155
 	if (*lock==-1) return 0;
150 156
 	su.val=1;
151 157
 	if (semctl(*lock, 0, SETVAL, su)==-1){
... ...
@@ -245,11 +258,18 @@ inline static gen_lock_set_t* lock_set_init(gen_lock_set_t* s)
245 245
 {
246 246
 	union semun su;
247 247
 	int r;
248
-	
248
+	int euid;
249
+
250
+	euid=geteuid();
251
+	if (uid && uid!=euid)
252
+		seteuid(uid); /* set euid to the cfg. requested one */
249 253
 	s->semid=semget(IPC_PRIVATE, s->size, 0700);
254
+	if (uid && uid!=euid)
255
+		seteuid(euid); /* restore euid */
250 256
 	if (s->semid==-1){
251
-		LOG(L_CRIT, "ERROR: lock_set_init (SYSV): semget failed: %s\n",
252
-				strerror(errno));
257
+		LOG(L_CRIT, "ERROR: lock_set_init (SYSV): semget (..., %d, 0700)"
258
+				" failed: %s\n",
259
+				s->size, strerror(errno));
253 260
 		return 0;
254 261
 	}
255 262
 	su.val=1;
... ...
@@ -122,90 +122,13 @@
122 122
 #ifdef DEBUG_DMALLOC
123 123
 #include <dmalloc.h>
124 124
 #endif
125
+#include "version.h"
125 126
 
126 127
 static char id[]="@(#) $Id$";
127
-static char version[]=  NAME " " VERSION " (" ARCH "/" OS ")" ;
128
-static char compiled[]= __TIME__ " " __DATE__ ;
129
-static char flags[]=
130
-"STATS:"
131
-#ifdef STATS
132
-"On"
133
-#else
134
-"Off"
135
-#endif
136
-#ifdef USE_IPV6
137
-", USE_IPV6"
138
-#endif
139
-#ifdef USE_TCP
140
-", USE_TCP"
141
-#endif
142
-#ifdef USE_TLS
143
-", USE_TLS"
144
-#endif
145
-#ifdef DISABLE_NAGLE
146
-", DISABLE_NAGLE"
147
-#endif
148
-#ifdef USE_MCAST
149
-", USE_MCAST"
150
-#endif
151
-#ifdef NO_DEBUG
152
-", NO_DEBUG"
153
-#endif
154
-#ifdef NO_LOG
155
-", NO_LOG"
156
-#endif
157
-#ifdef EXTRA_DEBUG
158
-", EXTRA_DEBUG"
159
-#endif
160
-#ifdef DNS_IP_HACK
161
-", DNS_IP_HACK"
162
-#endif
163
-#ifdef SHM_MEM
164
-", SHM_MEM"
165
-#endif
166
-#ifdef SHM_MMAP
167
-", SHM_MMAP"
168
-#endif
169
-#ifdef PKG_MALLOC
170
-", PKG_MALLOC"
171
-#endif
172
-#ifdef VQ_MALLOC
173
-", VQ_MALLOC"
174
-#endif
175
-#ifdef F_MALLOC
176
-", F_MALLOC"
177
-#endif
178
-#ifdef USE_SHM_MEM
179
-", USE_SHM_MEM"
180
-#endif
181
-#ifdef DBG_QM_MALLOC
182
-", DBG_QM_MALLOC"
183
-#endif
184
-#ifdef DEBUG_DMALLOC
185
-", DEBUG_DMALLOC"
186
-#endif
187
-#ifdef FAST_LOCK
188
-", FAST_LOCK"
189
-#ifdef BUSY_WAIT
190
-"-BUSY_WAIT"
191
-#endif
192
-#ifdef USE_PTHREAD_MUTEX
193
-", USE_PTHREAD_MUTEX"
194
-#endif
195
-#ifdef USE_POSIX_SEM
196
-", USE_POSIX_SEM"
197
-#endif
198
-#ifdef USE_SYSV_SEM
199
-", USE_SYSV_SEM"
200
-#endif
201
-#ifdef ADAPTIVE_WAIT
202
-"-ADAPTIVE_WAIT"
203
-#endif
204
-#ifdef NOSMP
205
-"-NOSMP"
206
-#endif
207
-#endif /*FAST_LOCK*/
208
-;
128
+static char* version=SER_FULL_VERSION;
129
+static char* flags=SER_COMPILE_FLAGS;
130
+char compiled[]= __TIME__ " " __DATE__ ;
131
+
209 132
 
210 133
 static char help_msg[]= "\
211 134
 Usage: " NAME " -l address [-p port] [-l address [-p port]...] [options]\n\
... ...
@@ -423,7 +346,8 @@ char* pgid_file = 0;
423 423
 void cleanup(show_status)
424 424
 {
425 425
 	/*clean-up*/
426
-	shm_unlock(); /* hack: force-unlock the shared memory lock in case
426
+	if (mem_lock) 
427
+		shm_unlock(); /* hack: force-unlock the shared memory lock in case
427 428
 					 some process crashed and let it locked; this will 
428 429
 					 allow an almost gracious shutdown */
429 430
 	destroy_modules();
... ...
@@ -1124,6 +1048,9 @@ int main_loop()
1124 1124
 	
1125 1125
 	/*return 0; */
1126 1126
  error:
1127
+	is_main=1;  /* if we are here, we are the "main process",
1128
+				  any forked children should exit with exit(-1) and not
1129
+				  ever use return */
1127 1130
 	return -1;
1128 1131
 
1129 1132
 }
... ...
@@ -1345,20 +1272,6 @@ try_again:
1345 1345
 	DBG("test random number %u\n", rand());
1346 1346
 	
1347 1347
 	
1348
-
1349
-
1350
-	/*init shm mallocs (before parsing cfg !)
1351
-	 *  this must be here to allow setting shm mem size from the command line
1352
-	 *  and it must also be before init_timer and init_tcp
1353
-	 *  => if shm_mem should be settable from the cfg file move everything
1354
-	 *  after --andrei */
1355
-	if (init_shm_mallocs()==-1)
1356
-		goto error;
1357
-	/*init timer, before parsing the cfg!*/
1358
-	if (init_timer()<0){
1359
-		LOG(L_CRIT, "could not initialize timer, exiting...\n");
1360
-		goto error;
1361
-	}
1362 1348
 	
1363 1349
 	/* register a diagnostic FIFO command  - moved to fifo server - bogdan
1364 1350
 	if (register_core_fifo()<0) {
... ...
@@ -1444,6 +1357,24 @@ try_again:
1444 1444
 		fprintf(stderr, "config file ok, exiting...\n");
1445 1445
 		goto error;
1446 1446
 	}
1447
+
1448
+
1449
+	/*init shm mallocs
1450
+	 *  this must be here 
1451
+	 *     -to allow setting shm mem size from the command line
1452
+	 *       => if shm_mem should be settable from the cfg file move
1453
+	 *       everything after
1454
+	 *     -it must be also before init_timer and init_tcp
1455
+	 *     -it must be after we know uid (so that in the SYSV sems case,
1456
+	 *        the sems will have the correct euid)
1457
+	 * --andrei */
1458
+	if (init_shm_mallocs()==-1)
1459
+		goto error;
1460
+	/*init timer, before parsing the cfg!*/
1461
+	if (init_timer()<0){
1462
+		LOG(L_CRIT, "could not initialize timer, exiting...\n");
1463
+		goto error;
1464
+	}
1447 1465
 	
1448 1466
 #ifdef USE_TCP
1449 1467
 	if (!tcp_disable){
... ...
@@ -31,6 +31,7 @@
31 31
  *  2003-03-12  split shm_mem_init in shm_getmem & shm_mem_init_mallocs
32 32
  *               (andrei)
33 33
  *  2004-07-27  ANON mmap support, needed on darwin (andrei)
34
+ *  2004-09-19  shm_mem_destroy: destroy first the lock & then unmap (andrei)
34 35
  */
35 36
 
36 37
 
... ...
@@ -223,6 +224,10 @@ void shm_mem_destroy()
223 223
 #endif
224 224
 	
225 225
 	DBG("shm_mem_destroy\n");
226
+	if (mem_lock){
227
+		DBG("destroying the shared memory lock\n");
228
+		lock_destroy(mem_lock); /* we don't need to dealloc it*/
229
+	}
226 230
 	if (shm_mempool && (shm_mempool!=(void*)-1)) {
227 231
 #ifdef SHM_MMAP
228 232
 		munmap(shm_mempool, /* SHM_MEM_SIZE */ shm_mem_size );
... ...
@@ -237,10 +242,6 @@ void shm_mem_destroy()
237 237
 		shm_shmid=-1;
238 238
 	}
239 239
 #endif
240
-	if (mem_lock){
241
-		DBG("destroying the shared memory lock\n");
242
-		lock_destroy(mem_lock); /* we don't need to dealloc it*/
243
-	}
244 240
 }
245 241
 
246 242
 
... ...
@@ -32,6 +32,7 @@
32 32
  *  2003-03-19  Support for flags in find_export (janakj)
33 33
  *  2003-03-29  cleaning pkg_mallocs introduced (jiri)
34 34
  *  2003-04-24  module version checking introduced (jiri)
35
+ *  2004-09-19  compile flags are checked too (andrei)
35 36
  */
36 37
 
37 38
 
... ...
@@ -156,6 +157,7 @@ error:
156 156
 static inline int version_control(void *handle, char *path)
157 157
 {
158 158
 	char **m_ver;
159
+	char **m_flags;
159 160
 	char* error;
160 161
 
161 162
 	m_ver=(char **)dlsym(handle, DLSYM_PREFIX "module_version");
... ...
@@ -164,14 +166,33 @@ static inline int version_control(void *handle, char *path)
164 164
 			path, error );
165 165
 		return 0;
166 166
 	}
167
+	m_flags=(char **)dlsym(handle, DLSYM_PREFIX "module_flags");
168
+	if ((error=(char *)dlerror())!=0) {
169
+		LOG(L_ERR, "ERROR: no compile flags info in module <%s>: %s\n",
170
+			path, error );
171
+		return 0;
172
+	}
167 173
 	if (!m_ver || !(*m_ver)) {
168 174
 		LOG(L_ERR, "ERROR: no version in module <%s>\n", path );
169 175
 		return 0;
170 176
 	}
171
-	if (strcmp(VERSION,*m_ver)==0)
172
-		return 1;
177
+	if (!m_flags || !(*m_flags)) {
178
+		LOG(L_ERR, "ERROR: no compile flags in module <%s>\n", path );
179
+		return 0;
180
+	}
181
+	
182
+	if (strcmp(SER_FULL_VERSION, *m_ver)==0){
183
+		if (strcmp(SER_COMPILE_FLAGS, *m_flags)==0)
184
+			return 1;
185
+		else {
186
+			LOG(L_ERR, "ERROR: module compile flags mismatch for %s "
187
+						" \ncore: %s \nmodule: %s\n",
188
+						path, SER_COMPILE_FLAGS, *m_flags);
189
+			return 0;
190
+		}
191
+	}
173 192
 	LOG(L_ERR, "ERROR: module version mismatch for %s; "
174
-		"core: %s; module: %s\n", path, VERSION, *m_ver );
193
+		"core: %s; module: %s\n", path, SER_FULL_VERSION, *m_ver );
175 194
 	return 0;
176 195
 }
177 196
 
... ...
@@ -35,6 +35,7 @@
35 35
  *  2003-04-05  s/reply_route/failure_route, onreply_route introduced (jiri)
36 36
  *  2004-03-12  extra flag USE_FUNC_PARAM added to modparam type -
37 37
  *              instead of copying the param value, a func is called (bogdan)
38
+ *  2004-09-19  switched to version.h for the module versions checks (andrei)
38 39
  */
39 40
 
40 41
 
... ...
@@ -42,6 +43,7 @@
42 42
 #define sr_module_h
43 43
 
44 44
 #include "parser/msg_parser.h" /* for sip_msg */
45
+#include "version.h"
45 46
 
46 47
 typedef  struct module_exports* (*module_register)();
47 48
 typedef  int (*cmd_function)(struct sip_msg*, char*, char*);
... ...
@@ -78,7 +80,9 @@ typedef int (*param_func_t)( modparam_t type, param_func_param_t param_val);
78 78
 #define PROC_TCP_MAIN -4  /* TCP main process */
79 79
 #define PROC_UNIXSOCK -5  /* Unix domain socket server processes */
80 80
 
81
-#define MODULE_VERSION char *module_version=VERSION;
81
+#define MODULE_VERSION \
82
+	char *module_version=SER_FULL_VERSION; \
83
+	char *module_flags=SER_COMPILE_FLAGS;
82 84
 
83 85
 struct cmd_export_ {
84 86
 	char* name;             /* null terminated command name */
85 87
new file mode 100644
... ...
@@ -0,0 +1,200 @@
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 ser, a free SIP server.
9
+ *
10
+ * ser 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
+ * For a license to use the ser software under conditions
16
+ * other than those described here, or to purchase support for this
17
+ * software, please contact iptel.org by e-mail at the following addresses:
18
+ *    info@iptel.org
19
+ *
20
+ * ser is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
+ * GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU General Public License 
26
+ * along with this program; if not, write to the Free Software 
27
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
+ */
29
+
30
+#ifndef version_h
31
+#define version_h
32
+
33
+#define SER_FULL_VERSION  NAME " " VERSION " (" ARCH "/" OS ")" 
34
+
35
+
36
+#ifdef STATS
37
+#define STATS_STR  "STATS: On"
38
+#else
39
+#define STATS_STR  "STATS: Off"
40
+#endif
41
+
42
+#ifdef USE_IPV6
43
+#define USE_IPV6_STR ", USE_IPV6"
44
+#else
45
+#define USE_IPV6_STR ""
46
+#endif
47
+
48
+#ifdef USE_TCP
49
+#define USE_TCP_STR ", USE_TCP"
50
+#else
51
+#define USE_TCP_STR ""
52
+#endif
53
+
54
+#ifdef USE_TLS
55
+#define USE_TLS_STR ", USE_TLS"
56
+#else 
57
+#define USE_TLS_STR ""
58
+#endif
59
+
60
+
61
+#ifdef DISABLE_NAGLE
62
+#define DISABLE_NAGLE_STR ", DISABLE_NAGLE"
63
+#else
64
+#define DISABLE_NAGLE_STR ""
65
+#endif
66
+
67
+#ifdef USE_MCAST
68
+#define USE_MCAST_STR ", USE_MCAST"
69
+#else
70
+#define USE_MCAST_STR ""
71
+#endif
72
+
73
+
74
+#ifdef NO_DEBUG
75
+#define NO_DEBUG_STR ", NO_DEBUG"
76
+#else
77
+#define NO_DEBUG_STR ""
78
+#endif
79
+
80
+#ifdef NO_LOG
81
+#define NO_LOG_STR ", NO_LOG"
82
+#else
83
+#define NO_LOG_STR ""
84
+#endif
85
+
86
+#ifdef EXTRA_DEBUG
87
+#define EXTRA_DEBUG_STR ", EXTRA_DEBUG"
88
+#else
89
+#define EXTRA_DEBUG_STR ""
90
+#endif
91
+
92
+#ifdef DNS_IP_HACK
93
+#define DNS_IP_HACK_STR ", DNS_IP_HACK"
94
+#else
95
+#define DNS_IP_HACK_STR ""
96
+#endif
97
+
98
+#ifdef SHM_MEM
99
+#define SHM_MEM_STR ", SHM_MEM"
100
+#else
101
+#define SHM_MEM_STR ""
102
+#endif
103
+
104
+#ifdef SHM_MMAP
105
+#define SHM_MMAP_STR ", SHM_MMAP"
106
+#else
107
+#define SHM_MMAP_STR ""
108
+#endif
109
+
110
+#ifdef PKG_MALLOC
111
+#define PKG_MALLOC_STR ", PKG_MALLOC"
112
+#else
113
+#define PKG_MALLOC_STR ""
114
+#endif
115
+
116
+#ifdef VQ_MALLOC
117
+#define VQ_MALLOC_STR ", VQ_MALLOC"
118
+#else
119
+#define VQ_MALLOC_STR ""
120
+#endif
121
+
122
+#ifdef F_MALLOC
123
+#define F_MALLOC_STR ", F_MALLOC"
124
+#else
125
+#define F_MALLOC_STR ""
126
+#endif
127
+
128
+#ifdef USE_SHM_MEM
129
+#define USE_SHM_MEM_STR ", USE_SHM_MEM"
130
+#else
131
+#define USE_SHM_MEM_STR ""
132
+#endif
133
+
134
+#ifdef DBG_QM_MALLOC
135
+#define DBG_QM_MALLOC_STR ", DBG_QM_MALLOC"
136
+#else
137
+#define DBG_QM_MALLOC_STR ""
138
+#endif
139
+
140
+#ifdef DBG_F_MALLOC
141
+#define DBG_F_MALLOC_STR ", DBG_F_MALLOC"
142
+#else
143
+#define DBG_F_MALLOC_STR ""
144
+#endif
145
+
146
+#ifdef DEBUG_DMALLOC
147
+#define DEBUG_DMALLOC_STR ", DEBUG_DMALLOC"
148
+#else
149
+#define DEBUG_DMALLOC_STR ""
150
+#endif
151
+
152
+#ifdef FAST_LOCK
153
+#ifdef BUSY_WAIT
154
+#define FAST_LOCK_STR ", FAST_LOCK-BUSY_WAIT"
155
+#elif defined (ADAPTIVE_WAIT)
156
+#define FAST_LOCK_STR ", FAST_LOCK-ADAPTIVE_WAIT"
157
+#else
158
+#define FAST_LOCK_STR ", FAST_LOCK"
159
+#endif
160
+#else
161
+#define FAST_LOCK_STR ""
162
+#endif
163
+
164
+#ifdef USE_PTHREAD_MUTEX
165
+#define USE_PTHREAD_MUTEX_STR ", USE_PTHREAD_MUTEX"
166
+#else
167
+#define USE_PTHREAD_MUTEX_STR ""
168
+#endif
169
+
170
+#ifdef USE_POSIX_SEM
171
+#define USE_POSIX_SEM_STR ", USE_POSIX_SEM"
172
+#else
173
+#define USE_POSIX_SEM_STR ""
174
+#endif
175
+
176
+#ifdef USE_SYSV_SEM
177
+#define USE_SYSV_SEM_STR ", USE_SYSV_SEM"
178
+#else
179
+#define USE_SYSV_SEM_STR ""
180
+#endif
181
+
182
+
183
+#ifdef NOSMP
184
+#define NOSMP_STR "-NOSMP"
185
+#else
186
+#define NOSMP_STR ""
187
+#endif
188
+
189
+
190
+#define SER_COMPILE_FLAGS \
191
+	EXTRA_DEBUG_STR STATS_STR USE_IPV6_STR USE_TCP_STR USE_TLS_STR \
192
+	DISABLE_NAGLE_STR USE_MCAST_STR NO_DEBUG_STR NO_LOG_STR DNS_IP_HACK_STR \
193
+	SHM_MEM_STR SHM_MMAP_STR PKG_MALLOC_STR VQ_MALLOC_STR F_MALLOC_STR \
194
+	USE_SHM_MEM_STR DBG_QM_MALLOC_STR DBG_F_MALLOC_STR DEBUG_DMALLOC_STR \
195
+	FAST_LOCK_STR NOSMP_STR USE_PTHREAD_MUTEX_STR USE_POSIX_SEM_STR \
196
+	USE_SYSV_SEM_STR
197
+
198
+
199
+#endif