[asterisk-commits] tzafrir: trunk r282397 - in /trunk: ./ channels/ main/ utils/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 15 08:08:59 CDT 2010


Author: tzafrir
Date: Sun Aug 15 08:08:45 2010
New Revision: 282397

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=282397
Log:
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.

Modified:
    trunk/channels/chan_oss.c
    trunk/configure
    trunk/configure.ac
    trunk/main/Makefile
    trunk/main/acl.c
    trunk/main/netsock.c
    trunk/utils/muted.c

Modified: trunk/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_oss.c?view=diff&rev=282397&r1=282396&r2=282397
==============================================================================
--- trunk/channels/chan_oss.c (original)
+++ trunk/channels/chan_oss.c Sun Aug 15 08:08:45 2010
@@ -47,7 +47,7 @@
 
 #ifdef __linux
 #include <linux/soundcard.h>
-#elif defined(__FreeBSD__) || defined(__CYGWIN__)
+#elif defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__GLIBC__)
 #include <sys/soundcard.h>
 #else
 #include <soundcard.h>

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=282397&r1=282396&r2=282397
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sun Aug 15 08:08:45 2010
@@ -125,6 +125,9 @@
      ;;
      linux-gnueabi)
      OSARCH=linux-gnu
+     ;;
+     kfreebsd*-gnu)
+     OSARCH=kfreebsd-gnu
      ;;
      *)
      OSARCH=${host_os}

Modified: trunk/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/main/Makefile?view=diff&rev=282397&r1=282396&r2=282397
==============================================================================
--- trunk/main/Makefile (original)
+++ trunk/main/Makefile Sun Aug 15 08:08:45 2010
@@ -34,7 +34,7 @@
 AST_LIBS += $(BKTR_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)),)
   AST_LIBS+=-ldl
   endif

Modified: trunk/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/acl.c?view=diff&rev=282397&r1=282396&r2=282397
==============================================================================
--- trunk/main/acl.c (original)
+++ trunk/main/acl.c Sun Aug 15 08:08:45 2010
@@ -123,7 +123,7 @@
 	char *buf = NULL;
 	int bufsz, x;
 #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;
 	int rtnerr;
 	const struct sockaddr_in *sin;
@@ -132,7 +132,7 @@
 	int best_score = -100;
 	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);
 	if (rtnerr) {
 		perror(NULL);
@@ -143,7 +143,7 @@
 	s = socket(AF_INET, SOCK_STREAM, 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) {
 
 			if (ifap->ifa_addr && ifap->ifa_addr->sa_family == AF_INET) {

Modified: trunk/main/netsock.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/netsock.c?view=diff&rev=282397&r1=282396&r2=282397
==============================================================================
--- trunk/main/netsock.c (original)
+++ trunk/main/netsock.c Sun Aug 15 08:08:45 2010
@@ -29,8 +29,10 @@
 
 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>
+#endif
 #endif
 
 #if defined (SOLARIS)

Modified: trunk/utils/muted.c
URL: http://svnview.digium.com/svn/asterisk/trunk/utils/muted.c?view=diff&rev=282397&r1=282396&r2=282397
==============================================================================
--- trunk/utils/muted.c (original)
+++ trunk/utils/muted.c Sun Aug 15 08:08:45 2010
@@ -39,7 +39,7 @@
 
 #ifdef __Darwin__
 #include <CoreAudio/AudioHardware.h> 
-#elif defined(__linux__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__GLIBC__)
 #include <sys/soundcard.h>
 #endif
 #include <stdio.h>




More information about the asterisk-commits mailing list