-
Notifications
You must be signed in to change notification settings - Fork 11
/
oss_core.m4
497 lines (441 loc) · 15.6 KB
/
oss_core.m4
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
#
# Export version variables
#
OSS_CORE_VERSION_INFO="$OSS_CORE_VERSION_CURRENT:$OSS_CORE_VERSION_REVISION:$OSS_CORE_VERSION_AGE"
AC_SUBST(OSS_CORE_VERSION_CURRENT)
AC_SUBST(OSS_CORE_VERSION_REVISION)
AC_SUBST(OSS_CORE_VERSION_AGE)
AC_SUBST(OSS_CORE_VERSION_INFO)
#
# Check if C++0x/11/14 is supported by the compiler
#
m4_include([config/ax_cxx_compile_stdcxx.m4])
#
# --disable-dep-check will simply display missing
# dependencies as warnings. This is useful when you
# simply need to generate the makefile for tasks that
# do not require building. Example is "make dist"
#
AC_ARG_ENABLE(dep-check,
AS_HELP_STRING([--disable-dep-check],
[Do not check for dependencies other then those required for dist target]))
AC_DEFUN([ERROR_MISSING_DEP],[
if test "x$enable_dep_check" != "xno"; then
AC_MSG_ERROR([$2])
fi
AC_SUBST([$1], 0)
])
AC_DEFUN([ENABLE_FEATURE],[
AM_CONDITIONAL([ENABLE_FEATURE_$1], true)
AC_SUBST([ENABLE_FEATURE_$1], 1)
AC_MSG_NOTICE([$1 feature ENABLED])
FEATURE_$1="enabled"
])
AC_DEFUN([DISABLE_FEATURE],[
AM_CONDITIONAL([ENABLE_FEATURE_$1], false)
AC_SUBST([ENABLE_FEATURE_$1], 0)
AC_MSG_NOTICE([$1 feature DISABLED])
])
#
# Flag dependecy whether they are missing or not
#
AC_DEFUN([FLAG_MISSING_DEP],[
AC_SUBST([$1], 0)
AM_CONDITIONAL([$1], false)
])
#
# Flag existing CXX dependencies
#
AC_DEFUN([FLAG_EXISTING_CXX_DEP],[
AC_SUBST([$1], 1)
AM_CONDITIONAL([$1], true)
OSS_CORE_DEP_LIBS="$2 $OSS_CORE_DEP_LIBS"
])
#
# Custom flags for Mac builds
# This will probably differ depending on versions of boost and v8 installed
#
case $host_os in
darwin* )
OSS_CORE_DEP_LIBS="-L/usr/local/opt/openssl/lib -L/usr/local/opt/v8@3.15/lib -L/usr/local/opt/boost@1.55/lib $OSS_CORE_DEP_LIBS"
LDFLAGS="${LDFLAGS} -L/usr/local/opt/openssl/lib -L/usr/local/opt/v8@3.15/lib -L/usr/local/opt/boost@1.55/lib"
CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/openssl/include -I/usr/local/opt/v8@3.15/include -I/usr/local/opt/boost@1.55/include"
CXXFLAGS="${CXXFLAGS} -Wno-deprecated -I/usr/local/opt/openssl/include -isystem /usr/local/opt/v8@3.15/include -isystem /usr/local/opt/boost@1.55/include"
CFLAGS="${CFLAGS} -I/usr/local/opt/openssl/include"
;;
esac
#
# Enable ALL features
#
AC_ARG_ENABLE([all-features],
AC_HELP_STRING([--enable-all-features], [Enable ALL features]),
[
ENABLE_FEATURE(CARP)
ENABLE_FEATURE(V8)
ENABLE_FEATURE(B2BUA)
ENABLE_FEATURE(SBC)
ENABLE_FEATURE(WEBSOCKETS)
ENABLE_FEATURE(XOR)
ENABLE_FEATURE(RTP)
ENABLE_FEATURE(STUN)
ENABLE_FEATURE(ZMQ)
ENABLE_FEATURE(REDIS)
ENABLE_FEATURE(MCRYPT)
ENABLE_FEATURE(CONFIG)
ENABLE_FEATURE(INOTIFY)
ENABLE_FEATURE(RESIP_UA)
],
[
#
# Disable B2BUA compilation
#
AC_ARG_ENABLE([b2bua],
AC_HELP_STRING([--disable-b2bua], [Disable B2BUA Feature]),
[DISABLE_FEATURE(B2BUA)],
[ENABLE_FEATURE(B2BUA)])
#
# Disable SBC compilation
#
AC_ARG_ENABLE([sbc],
AC_HELP_STRING([--disable-sbc], [Disable SBC Feature]),
[DISABLE_FEATURE(SBC)],
[ENABLE_FEATURE(SBC)])
#
# Disable RTP Proxy compilation
#
AC_ARG_ENABLE([rtp],
AC_HELP_STRING([--disable-rtp], [Disable RTP Proxy Feature]),
[DISABLE_FEATURE(RTP)],
[ENABLE_FEATURE(RTP)])
#
# Enable RESIP_UA compilation
#
AC_ARG_ENABLE([resip-ua],
AC_HELP_STRING([--enable-resip-ua], [Enable ReSIProcate Feature]),
[ENABLE_FEATURE(RESIP_UA)],
[DISABLE_FEATURE(RESIP_UA)])
#
# Enable UCARP compilation
#
AC_ARG_ENABLE([carp],
AC_HELP_STRING([--disable-carp], [Disable CARP-HA Feature]),
[DISABLE_FEATURE(CARP)],
[ENABLE_FEATURE(CARP)])
#
# Enable V8 compilation
#
AC_ARG_ENABLE([v8],
AC_HELP_STRING([--disable-v8], [Disable V8 JavaScript Feature]),
[DISABLE_FEATURE(V8)],
[ENABLE_FEATURE(V8)])
#
# Enable ZeroMQ compilation
#
AC_ARG_ENABLE([zmq],
AC_HELP_STRING([--disable-zmq], [Disable ZeroMQ Feature]),
[DISABLE_FEATURE(ZMQ)],
[ENABLE_FEATURE(ZMQ)])
#
# Enable Redis compilation
#
AC_ARG_ENABLE([redis],
AC_HELP_STRING([--enable-redis], [Disable Redis Feature]),
[ENABLE_FEATURE(REDIS)],
[DISABLE_FEATURE(REDIS)])
#
# Enable Websocket compilation
#
AC_ARG_ENABLE([websockets],
AC_HELP_STRING([--enable-websockets], [Disable Websockets Feature]),
[ENABLE_FEATURE(WEBSOCKETS)],
[DISABLE_FEATURE(WEBSOCKETS)])
#
# Enable XOR compilation
#
AC_ARG_ENABLE([xor],
AC_HELP_STRING([--enable-xor], [Enable XOR Encryption Feature]),
[ENABLE_FEATURE(XOR)],
[DISABLE_FEATURE(XOR)])
#
# Enable File Encryption compilation
#
AC_ARG_ENABLE([mcrypt],
AC_HELP_STRING([--enable-mcrypt], [Enable File Encryption Feature]),
[ENABLE_FEATURE(MCRYPT)],
[DISABLE_FEATURE(MCRYPT)])
#
# Enable Configpp Wrapper compilation
#
AC_ARG_ENABLE([config],
AC_HELP_STRING([--disable-config], [Disable Configuration File Feature]),
[DISABLE_FEATURE(CONFIG)],
[ENABLE_FEATURE(CONFIG)])
#
# Enable STUN compilation
#
AC_ARG_ENABLE([stun],
AC_HELP_STRING([--enable-stun], [Disable STUN Feature]),
[ENABLE_FEATURE(STUN)],
[DISABLE_FEATURE(STUN)])
#
# Enable iNotify compilation
#
AC_ARG_ENABLE([inotify],
AC_HELP_STRING([--enable-inotify], [Disable inotify]),
[ENABLE_FEATURE(INOTIFY)],
[DISABLE_FEATURE(INOTIFY)])
])
#
# Enable SIP Test compilation
#
AC_ARG_ENABLE([sip-test],
AC_HELP_STRING([--enable-sip-test], [Enable Compilation of SIP Tests]),
[ENABLE_FEATURE(COMPILE_SIPTEST)],
[DISABLE_FEATURE(COMPILE_SIPTEST)])
#
# Search for mandatory packages
#
#
# OpenSSL
#
AC_CHECK_HEADER(openssl/conf.h, [],
[ERROR_MISSING_DEP(OSS_HAVE_SSL,"OpenSSL Library Headers are not installed")])
AC_CHECK_LIB(ssl, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_DL, -lssl)],
[ERROR_MISSING_DEP(OSS_HAVE_SSL,"OpenSSL Library not installed")])
AC_CHECK_LIB(crypto, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_CRYPTO, -lcrypto)],
[ERROR_MISSING_DEP(OSS_HAVE_CRYPTO)])
#
# Boost
#
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(boost/thread.hpp, [], [ERROR_MISSING_DEP(OSS_HAVE_BOOST_THREAD,
"Boost Thread Library Headers are not installed")])
AC_CHECK_LIB(boost_thread-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_THREAD, -lboost_thread-mt)],
[AC_CHECK_LIB(boost_thread, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_THREAD, -lboost_thread)],
[ERROR_MISSING_DEP(OSS_HAVE_BOOST_THREAD, "Boost Thread Library is not installed")])])
AC_CHECK_HEADER(boost/date_time.hpp, [], [ERROR_MISSING_DEP(OSS_HAVE_BOOST_DATE_TIME,
"Boost Date Library Headers are not installed")])
AC_CHECK_LIB(boost_date_time-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_DATE_TIME, -lboost_date_time-mt)],
[AC_CHECK_LIB(boost_date_time, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_DATE_TIME, -lboost_date_time)],
[ERROR_MISSING_DEP(OSS_HAVE_BOOST_DATE_TIME, "Boost Date Library is not installed")])])
AC_CHECK_HEADER(boost/filesystem.hpp, [], [ERROR_MISSING_DEP(OSS_HAVE_BOOST_FILESYSTEM,
"Boost Filesystem Library Headers are not installed")])
AC_CHECK_LIB(boost_filesystem-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_FILESYSTEM, -lboost_filesystem-mt)],
[AC_CHECK_LIB(boost_filesystem, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_FILESYSTEM, -lboost_filesystem)],
[ERROR_MISSING_DEP(OSS_HAVE_BOOST_FILESYSTEM, "Boost Filesystem Library is not installed")])])
AC_CHECK_LIB(boost_system-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_SYSTEM, -lboost_system-mt)],
[AC_CHECK_LIB(boost_system, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_SYSTEM, -lboost_system)],
[ERROR_MISSING_DEP(OSS_HAVE_BOOST_SYSTEM, "Boost System Library is not installed")])])
AC_CHECK_HEADER(boost/program_options.hpp, [], [ERROR_MISSING_DEP(OSS_HAVE_BOOST_PROGRAM_OPTIONS,
"Boost Program Options Library Headers are not installed")])
AC_CHECK_LIB(boost_program_options-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_PROGRAM_OPTIONS, -lboost_program_options-mt)],
[AC_CHECK_LIB(boost_program_options, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_PROGRAM_OPTIONS, -lboost_program_options)],
[ERROR_MISSING_DEP(OSS_HAVE_BOOST_PROGRAM_OPTIONS, "Boost System Library is not installed")])])
AC_CHECK_LIB(boost_iostreams-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_IOSTREAMS, -lboost_iostreams-mt)],
[AC_CHECK_LIB(boost_iostreams, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_IOSTREAMS, -lboost_iostreams)],
[ERROR_MISSING_DEP(OSS_HAVE_BOOST_IOSTREAMS, "Boost Iostreams Library is not installed")])])
AC_CHECK_HEADER(boost/regex.hpp, [], [ERROR_MISSING_DEP(OSS_HAVE_BOOST_REGEX,
"Boost Regex Library Headers are not installed")])
AC_CHECK_LIB(boost_regex-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_REGEX, -lboost_regex-mt)],
[AC_CHECK_LIB(boost_regex, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_REGEX, -lboost_regex)],
[ERROR_MISSING_DEP(OSS_HAVE_BOOST_REGEX, "Boost Regex Library is not installed")])])
AC_LANG_POP([C++])
#
# POCO
#
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(Poco/Foundation.h, [], [ERROR_MISSING_DEP(OSS_HAVE_POCO_FOUNDATION,
"Poco C++ Foundation Library Headers not found")])
AC_CHECK_LIB(PocoFoundation, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_POCO_FOUNDATION, -lPocoFoundation)],
[ERROR_MISSING_DEP(OSS_HAVE_POCO_FOUNDATION,"Poco C++ Foundation Library not found")])
AC_CHECK_HEADER(Poco/Util/Util.h, [], [ERROR_MISSING_DEP(OSS_HAVE_POCO_UTIL,
"Poco C++ Util Library Headers not found")])
AC_CHECK_LIB(PocoUtil, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_POCO_UTIL, -lPocoUtil)],
[ERROR_MISSING_DEP(OSS_HAVE_POCO_UTIL,"Poco C++ Util Library not found")])
AC_CHECK_HEADER(Poco/Net/Net.h, [], [ERROR_MISSING_DEP(OSS_HAVE_POCO_NET,
"Poco C++ Util Library Headers not found")])
AC_CHECK_LIB(PocoNet, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_POCO_NET, -lPocoNet -lPocoNetSSL)],
[ERROR_MISSING_DEP(OSS_HAVE_POCO_NET,"Poco C++ Net Library not found")])
AC_LANG_POP([C++])
#
# UCARP
#
if test "x$FEATURE_CARP" == "xenabled"; then
m4_include([config/carp.m4])
fi
#
# Google V8
#
if test "x$FEATURE_V8" == "xenabled"; then
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(v8.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_V8, -lv8)],
[ERROR_MISSING_DEP(OSS_HAVE_V8, "V8 Library is not installed")])
AC_LANG_POP([C++])
else
AM_CONDITIONAL(OSS_HAVE_V8, false)
AC_SUBST(OSS_HAVE_V8, 0)
fi
#
# ZeroMQ
#
if test "x$FEATURE_ZMQ" == "xenabled"; then
AC_CHECK_HEADER(zmq.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_ZMQ, -lzmq)],
[ERROR_MISSING_DEP(OSS_HAVE_ZMQ, "ZeroMQ Library is not installed")])
else
AM_CONDITIONAL(OSS_HAVE_ZMQ, false)
AC_SUBST(OSS_HAVE_ZMQ, 0)
fi
#
# Redis
#
if test "x$FEATURE_REDIS" == "xenabled"; then
AC_CHECK_HEADER(hiredis/hiredis.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_HIREDIS, -lhiredis)],
[ERROR_MISSING_DEP(OSS_HAVE_HIREDIS, "Hiredis Library is not installed")])
else
AM_CONDITIONAL(OSS_HAVE_HIREDIS, false)
AC_SUBST(OSS_HAVE_HIREDIS, 0)
fi
#
# MCRYPT
#
if test "x$FEATURE_MCRYPT" == "xenabled"; then
AC_CHECK_HEADER(mcrypt.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_MCRYPT, -lmcrypt)],
[FLAG_MISSING_DEP(OSS_HAVE_MCRYPT, "Mcrypt Library is not installed")])
else
AM_CONDITIONAL(OSS_HAVE_MCRYPT, false)
AC_SUBST(OSS_HAVE_MCRYPT, 0)
fi
#
# INOTIFY
#
if test "x$FEATURE_INOTIFY" == "xenabled"; then
AC_CHECK_HEADER(sys/inotify.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_INOTIFY, )],
[FLAG_MISSING_DEP(OSS_HAVE_INOTIFY, "inotify feature is not available")])
else
AM_CONDITIONAL(OSS_HAVE_INOTIFY, false)
AC_SUBST(OSS_HAVE_INOTIFY, 0)
fi
#
# RESIPROCATE
#
AC_LANG_PUSH([C++])
if test "x$FEATURE_RESIP_UA" == "xenabled"; then
AC_CHECK_HEADER(resip/stack/SipStack.hxx,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_RESIP, -lrutil -lresipares -ldum -lresip)],
[FLAG_MISSING_DEP(OSS_HAVE_RESIP, "reSIProcate Library is not installed")])
else
AM_CONDITIONAL(OSS_HAVE_RESIP, false)
AC_SUBST(OSS_HAVE_RESIP, 0)
fi
AC_LANG_POP([C++])
#
# Config file support
#
if test "x$FEATURE_CONFIG" == "xenabled"; then
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(libconfig.h++,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_CONFIGPP, -lconfig++)],
[FLAG_MISSING_DEP(OSS_HAVE_CONFIGPP, "libconfig Library not installed")])
AC_LANG_POP([C++])
else
AM_CONDITIONAL(OSS_HAVE_CONFIGPP, false)
AC_SUBST(OSS_HAVE_CONFIGPP, 0)
fi
#
# Search for optional packages
#
AC_LANG_PUSH([C++])
AC_CHECK_LIB(gtest, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_GTEST, -lgtest)],
[FLAG_MISSING_DEP(OSS_HAVE_GTEST)])
AC_LANG_POP([C++])
AC_CHECK_HEADER(pcap/pcap.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_PCAP, -lpcap)],
[FLAG_MISSING_DEP(OSS_HAVE_PCAP)])
AC_CHECK_HEADER(pthread.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_THREAD, -lpthread)],
[FLAG_MISSING_DEP(OSS_HAVE_THREAD)])
AC_CHECK_HEADER(resolv.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_RESOLV, -lresolv)],
[FLAG_MISSING_DEP(OSS_HAVE_RESOLV)])
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(db_cxx.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BDB, -ldb_cxx)],
[FLAG_MISSING_DEP(OSS_HAVE_BDB)])
AC_LANG_POP([C++])
AC_CHECK_HEADER(zlib.h,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_ZLIB, -lz)],
[FLAG_MISSING_DEP(OSS_HAVE_ZLIB)])
AC_CHECK_LIB(ltdl, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_LTDL, -lltdl)],
[FLAG_MISSING_DEP(OSS_HAVE_LTDL)])
AC_CHECK_LIB(dl, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_DL, -ldl)],
[FLAG_MISSING_DEP(OSS_HAVE_DL)])
AC_CHECK_LIB(rt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_RT, -lrt)],
[FLAG_MISSING_DEP(OSS_HAVE_RT)])
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(boost/random.hpp, [], [ERROR_MISSING_DEP(OSS_HAVE_BOOST_RANDOM,
"Boost Random Library Headers are not installed")])
AC_CHECK_LIB(boost_random-mt, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_RANDOM, -lboost_random-mt)],
[AC_CHECK_LIB(boost_random, main,
[FLAG_EXISTING_CXX_DEP(OSS_HAVE_BOOST_RANDOM, -lboost_random)],
[FLAG_MISSING_DEP(OSS_HAVE_BOOST_RANDOM, "Boost Random Library is not installed")])])
AC_LANG_POP([C++])
CURRENT_DIR=`pwd`
cd ${srcdir}
OSS_CORE_SRCDIR=`pwd`
AC_SUBST(OSS_CORE_SRCDIR)
cd ${CURRENT_DIR}
#
# Common CXX and C Flags
#
OSS_CXX_C_FLAGS="-fmessage-length=0"
#
# Compiler warnings
#
OSS_CXX_WARNINGS="-Wall -Wformat -Wwrite-strings -Wpointer-arith -Wno-unused-result -Wno-strict-aliasing"
OSS_C_WARNINGS="-Wall -Wnested-externs -Werror=return-type -Werror=uninitialized -Wno-pointer-sign -Wno-unused-function -Wno-shift-negative-value -Wno-format-extra-args"
#
# Additional CXX and C Flags
#
CXXFLAGS="$CXXFLAGS $OSS_CXX_C_FLAGS $OSS_CXX_WARNINGS"
CFLAGS="$CFLAGS $OSS_CXX_C_FLAGS $OSS_C_WARNINGS -fno-omit-frame-pointer -fno-common -fsigned-char -fPIC"
#
# Set C++ 11 flag if supported by compiler
#
AX_CXX_COMPILE_STDCXX([11], [], [optional])
#
# Used by applications building oss_core inline. In our case, we set it to nothing
#
AC_SUBST([OSS_CORE_ADDITIONAL_INCLUDES], [''])
AC_SUBST(CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(OSS_CORE_DEP_LIBS)