提交 2b0bba8e authored 作者: Moises Silva's avatar Moises Silva

freetdm: add __USE_BSD to ftdm_os, needed by unistd.h for usleep() and string.h…

freetdm: add __USE_BSD to ftdm_os, needed by unistd.h for usleep() and string.h to define strcasecmp()
	 add -Werror even when the compiler is unknown. This is just a work-around to gcc not being detected
	 as GNU by our current standalone build (not bootstrapped through FreeSWITCH)
上级 aa69927b
...@@ -49,6 +49,7 @@ if HAVE_SNG_ISDN ...@@ -49,6 +49,7 @@ if HAVE_SNG_ISDN
INCS += -I/usr/include/sng_isdn INCS += -I/usr/include/sng_isdn
endif endif
# we needed to separate CFLAGS in FTDM_COMPAT_CFLAGS and FTDM_CFLAGS due to -c99 which causes problems with wanpipe headers
FTDM_COMPAT_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_COMPAT_CFLAGS@ @DEFS@ FTDM_COMPAT_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_COMPAT_CFLAGS@ @DEFS@
FTDM_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_CFLAGS@ @DEFS@ FTDM_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_CFLAGS@ @DEFS@
COMPILE = $(CC) $(FTDM_CFLAGS) COMPILE = $(CC) $(FTDM_CFLAGS)
...@@ -183,8 +184,8 @@ ftmod_analog_em_la_LIBADD = libfreetdm.la ...@@ -183,8 +184,8 @@ ftmod_analog_em_la_LIBADD = libfreetdm.la
if HAVE_LIBSANGOMA if HAVE_LIBSANGOMA
mod_LTLIBRARIES += ftmod_wanpipe.la mod_LTLIBRARIES += ftmod_wanpipe.la
ftmod_wanpipe_la_SOURCES = $(SRC)/ftmod/ftmod_wanpipe/ftmod_wanpipe.c ftmod_wanpipe_la_SOURCES = $(SRC)/ftmod/ftmod_wanpipe/ftmod_wanpipe.c
#some structures within Wanpipe drivers are not c99 compatible, so we need to compile ftmod_wanpipe # some structures within Wanpipe drivers are not c99 compatible, so we need to compile ftmod_wanpipe
#without c99 flags # without c99 flags, use FTDM_COMPAT_CFLAGS instead
ftmod_wanpipe_la_CFLAGS = $(AM_CFLAGS) $(FTDM_COMPAT_CFLAGS) -D__LINUX__ -I/usr/include/wanpipe ftmod_wanpipe_la_CFLAGS = $(AM_CFLAGS) $(FTDM_COMPAT_CFLAGS) -D__LINUX__ -I/usr/include/wanpipe
ftmod_wanpipe_la_LDFLAGS = -shared -module -avoid-version -lsangoma ftmod_wanpipe_la_LDFLAGS = -shared -module -avoid-version -lsangoma
ftmod_wanpipe_la_LIBADD = libfreetdm.la ftmod_wanpipe_la_LIBADD = libfreetdm.la
......
...@@ -82,7 +82,7 @@ sun) ...@@ -82,7 +82,7 @@ sun)
fi fi
;; ;;
*) *)
COMP_VENDOR_COMPAT_CFLAGS="-Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" COMP_VENDOR_COMPAT_CFLAGS="-Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
COMP_VENDOR_CFLAGS="-std=c99 $COMP_VENDOR_COMPAT_CFLAGS" COMP_VENDOR_CFLAGS="-std=c99 $COMP_VENDOR_COMPAT_CFLAGS"
;; ;;
esac esac
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "private/ftdm_core.h" #include "private/ftdm_core.h"
#include "ftmod_zt.h" #include "ftmod_zt.h"
......
...@@ -39,9 +39,12 @@ ...@@ -39,9 +39,12 @@
extern "C" { extern "C" {
#endif #endif
#if defined(__linux__) && !defined(__USE_BSD)
#define __USE_BSD
#endif
#include "ftdm_declare.h" #include "ftdm_declare.h"
#include "ftdm_threadmutex.h" #include "ftdm_threadmutex.h"
#include <string.h> #include <string.h>
#ifndef __WINDOWS__ #ifndef __WINDOWS__
......
...@@ -48,12 +48,7 @@ ...@@ -48,12 +48,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#if defined(__linux__) && !defined(__USE_BSD)
#define __USE_BSD
#endif
#ifndef WIN32
#include <unistd.h>
#endif
#include "freetdm.h" #include "freetdm.h"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论