mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Support for GNU/kFreeBSD
kFreeBSD is GNU (with glibc) on to of a FreeBSD kernel. See http://glibc-bsd.alioth.debian.org/porting/PORTING This patch gets Asterisk close to building on Debian kFreeBSD i386, mainly by adding an extra test for __GLIBC__ in one or two (or more) places. OSARCH is set to 'kfreebsd-gnu' DAHDI support (and support for chan_vpb) was not tested. Review: https://reviewboard.asterisk.org/r/858/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@282397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -47,7 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
|
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
#include <linux/soundcard.h>
|
#include <linux/soundcard.h>
|
||||||
#elif defined(__FreeBSD__) || defined(__CYGWIN__)
|
#elif defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__GLIBC__)
|
||||||
#include <sys/soundcard.h>
|
#include <sys/soundcard.h>
|
||||||
#else
|
#else
|
||||||
#include <soundcard.h>
|
#include <soundcard.h>
|
||||||
|
@@ -126,6 +126,9 @@ case "${host_os}" in
|
|||||||
linux-gnueabi)
|
linux-gnueabi)
|
||||||
OSARCH=linux-gnu
|
OSARCH=linux-gnu
|
||||||
;;
|
;;
|
||||||
|
kfreebsd*-gnu)
|
||||||
|
OSARCH=kfreebsd-gnu
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
OSARCH=${host_os}
|
OSARCH=${host_os}
|
||||||
;;
|
;;
|
||||||
|
@@ -34,7 +34,7 @@ AST_LIBS += $(OPENSSL_LIB)
|
|||||||
AST_LIBS += $(BKTR_LIB)
|
AST_LIBS += $(BKTR_LIB)
|
||||||
AST_LIBS += $(LIBXML2_LIB)
|
AST_LIBS += $(LIBXML2_LIB)
|
||||||
|
|
||||||
ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-gnueabi ),)
|
ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-gnueabi kfreebsd-gnu),)
|
||||||
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
||||||
AST_LIBS+=-ldl
|
AST_LIBS+=-ldl
|
||||||
endif
|
endif
|
||||||
|
@@ -123,7 +123,7 @@ static int get_local_address(struct ast_sockaddr *ourip)
|
|||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
int bufsz, x;
|
int bufsz, x;
|
||||||
#endif /* SOLARIS */
|
#endif /* SOLARIS */
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
|
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__GLIBC__)
|
||||||
struct ifaddrs *ifap, *ifaphead;
|
struct ifaddrs *ifap, *ifaphead;
|
||||||
int rtnerr;
|
int rtnerr;
|
||||||
const struct sockaddr_in *sin;
|
const struct sockaddr_in *sin;
|
||||||
@@ -132,7 +132,7 @@ static int get_local_address(struct ast_sockaddr *ourip)
|
|||||||
int best_score = -100;
|
int best_score = -100;
|
||||||
memset(&best_addr, 0, sizeof(best_addr));
|
memset(&best_addr, 0, sizeof(best_addr));
|
||||||
|
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
|
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__GLIBC__)
|
||||||
rtnerr = getifaddrs(&ifaphead);
|
rtnerr = getifaddrs(&ifaphead);
|
||||||
if (rtnerr) {
|
if (rtnerr) {
|
||||||
perror(NULL);
|
perror(NULL);
|
||||||
@@ -143,7 +143,7 @@ static int get_local_address(struct ast_sockaddr *ourip)
|
|||||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
|
||||||
if (s > 0) {
|
if (s > 0) {
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
|
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__) || defined(__GLIBC__)
|
||||||
for (ifap = ifaphead; ifap; ifap = ifap->ifa_next) {
|
for (ifap = ifaphead; ifap; ifap = ifap->ifa_next) {
|
||||||
|
|
||||||
if (ifap->ifa_addr && ifap->ifa_addr->sa_family == AF_INET) {
|
if (ifap->ifa_addr && ifap->ifa_addr->sa_family == AF_INET) {
|
||||||
|
@@ -29,9 +29,11 @@
|
|||||||
|
|
||||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||||
|
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__)
|
#ifndef __linux__
|
||||||
|
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__GLIBC__)
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (SOLARIS)
|
#if defined (SOLARIS)
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#ifdef __Darwin__
|
#ifdef __Darwin__
|
||||||
#include <CoreAudio/AudioHardware.h>
|
#include <CoreAudio/AudioHardware.h>
|
||||||
#elif defined(__linux__) || defined(__FreeBSD__)
|
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__GLIBC__)
|
||||||
#include <sys/soundcard.h>
|
#include <sys/soundcard.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
Reference in New Issue
Block a user