pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/44257: comms/asterisk18 fails to build on DragonFly



>Number:         44257
>Category:       pkg
>Synopsis:       comms/asterisk18 fails to build on DragonFly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 20 21:40:00 +0000 2010
>Originator:     Francois Tigeot
>Release:        DragonFly 2.9-DEVELOPMENT
>Organization:
>Environment:
DragonFly dfly.zefyris.com 2.9-DEVELOPMENT DragonFly 
v2.9.1.234.ga081e-DEVELOPMENT #0: Fri Dec 17 04:19:10 CET 2010     
ftigeot%dfly.zefyris.com@localhost:/usr/obj/usr/src/sys/GENERIC_SMP  i386
>Description:
comms/asterisk18 does not build out of the box on DragonFly systems
>How-To-Repeat:
Try to build comms/asterisk18 on a DragonFly system
>Fix:
Modify or add the following patches to the patches/ directory


diff -u -r1.1.1.1 patch-as
--- patch-as    15 Dec 2010 03:22:45 -0000      1.1.1.1
+++ patch-as    20 Dec 2010 21:24:39 -0000
@@ -2,7 +2,16 @@
 
 --- include/asterisk/lock.h.orig       2010-07-03 02:36:31.000000000 +0000
 +++ include/asterisk/lock.h
-@@ -580,6 +580,10 @@ int ast_atomic_fetchadd_int_slow(volatil
+@@ -558,7 +558,7 @@
+ 
+ #define gethostbyname 
__gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__
+ 
+-#ifndef __linux__
++#if !defined(__linux__) && !defined(__DragonFly__)
+ #define pthread_create __use_ast_pthread_create_instead__
+ #endif
+ 
+@@ -580,6 +580,10 @@
  #include "libkern/OSAtomic.h"
  #endif
  
@@ -13,7 +22,7 @@
  /*! \brief Atomically add v to *p and return * the previous value of *p.
   * This can be used to handle reference counts, and the return value
   * can be used to generate unique identifiers.
-@@ -599,6 +603,12 @@ AST_INLINE_API(int ast_atomic_fetchadd_i
+@@ -599,6 +603,12 @@
  AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
  {
        return OSAtomicAdd64(v, (int64_t *) p) - v;
@@ -26,7 +35,7 @@
  #elif defined (__i386__) || defined(__x86_64__)
  #ifdef sun
  AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
-@@ -645,6 +655,12 @@ AST_INLINE_API(int ast_atomic_dec_and_te
+@@ -645,6 +655,12 @@
  AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
  {
        return OSAtomicAdd64( -1, (int64_t *) p) == 0;


--- patch-bb    15 Dec 2010 03:22:45 -0000      1.1.1.1
+++ patch-bb    20 Dec 2010 21:37:45 -0000
@@ -2,7 +2,16 @@

 --- main/utils.c.orig  2010-08-06 18:57:10.000000000 +0000
 +++ main/utils.c
-@@ -1353,13 +1353,13 @@ int ast_false(const char *s)
+@@ -445,7 +445,7 @@
+ static int dev_urandom_fd;
+ #endif
+
+-#ifndef __linux__
++#if !defined(__linux__) && !defined(__DragonFly__)
+ #undef pthread_create /* For ast_pthread_create function only */
+ #endif /* !__linux__ */
+
+@@ -1353,13 +1353,13 @@
  static struct timeval tvfix(struct timeval a)
  {
        if (a.tv_usec >= ONE_MILLION) {


--- main/Makefile.orig  2010-08-02 16:41:46 +0200
+++ main/Makefile       2010-12-20 21:55:22 +0100
@@ -83,6 +83,10 @@
   AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB)
 endif
 
+ifeq ($(OSARCH),dragonfly)
+  AST_LIBS+=-pthread
+endif
+
 ifeq ($(OSARCH),SunOS)
   AST_LIBS+=-lpthread -ldl -lrt -lnsl -lsocket -lresolv -L/opt/ssl/lib 
-L/usr/local/ssl/lib
   ASTLINK=


--- main/asterisk.c.orig        2010-11-11 20:42:06 +0100
+++ main/asterisk.c     2010-12-20 08:22:02 +0100
@@ -85,7 +85,7 @@
 #include <sys/sysctl.h>
 #if !defined(__OpenBSD__)
 #include <sys/vmmeter.h>
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include <vm/vm_param.h>
 #endif
 #endif


--- main/netsock.c.orig 2010-12-20 08:24:08 +0100
+++ main/netsock.c      2010-12-20 08:26:46 +0100
@@ -29,7 +29,8 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 222873 $")
 
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || 
defined(__Darwin__)
+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || \
+    defined(__Darwin__) || defined(__DragonFly__)
 #include <net/if_dl.h>
 #endif



Home | Main Index | Thread Index | Old Index