Summary:ASTERISK-03033: [bug + patch] Compile fails with cvs head on mac osx jaguar 10.3
Reporter:abombss (abombss)Labels:
Date Opened:2004-12-18 23:09:16.000-0600Date Closed:2008-01-15 15:17:07.000-0600
Versions:Frequency of
Environment:Attachments:( 0) osxcompat.txt
Description:First, configure.c fails on missing symbol with GLOB_ACCEPTED.  Commented out #define AST_INCLUDE_GLOB 1 to get past that.

Then pbx/pbx_dundi.c fails with the following compiler error.

gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g -Iinclude -I../include -D_REENTRANT -D_GNU_SOURCE -O6 -DASTERISK_VERSION=\"CVS-HEAD-12/18/04-22:12:24\" -DASTERISK_VERSION_NUM=999999 -DINSTALL_PREFIX=\"\" -DASTETCDIR=\"/etc/asterisk\" -DASTLIBDIR=\"/usr/lib/asterisk\" -DASTVARLIBDIR=\"/var/lib/asterisk\" -DASTVARRUNDIR=\"/var/run\" -DASTSPOOLDIR=\"/var/spool/asterisk\" -DASTLOGDIR=\"/var/log/asterisk\" -DASTCONFPATH=\"/etc/asterisk/asterisk.conf\" -DASTMODDIR=\"/usr/lib/asterisk/modules\" -DASTAGIDIR=\"/var/lib/asterisk/agi-bin\" -DBUSYDETECT_MARTIN -fPIC -c -o pbx_dundi.o pbx_dundi.c
002 In file included from pbx_dundi.c:47:
003 /usr/include/netinet/ip.h:178: error: parse error before "n_long"
004 /usr/include/netinet/ip.h:181: error: parse error before "n_long"
005 /usr/include/netinet/ip.h:183: error: parse error before '}' token
006 /usr/include/netinet/ip.h:184: error: parse error before '}' token
007 pbx_dundi.c: In function `reset_global_eid':
008 pbx_dundi.c:415: warning: implicit declaration of function `getifaddrs'
009 pbx_dundi.c:417: error: dereferencing pointer to incomplete type
010 pbx_dundi.c:418: error: dereferencing pointer to incomplete type
011 pbx_dundi.c:419: error: dereferencing pointer to incomplete type
012 pbx_dundi.c:422: error: dereferencing pointer to incomplete type
013 pbx_dundi.c:422: error: dereferencing pointer to incomplete type
014 pbx_dundi.c:423: error: dereferencing pointer to incomplete type
015 pbx_dundi.c:424: warning: implicit declaration of function `freeifaddrs'
016 make[1]: *** [pbx_dundi.o] Error 1
017 make: *** [subdirs] Error 1
Comments:By: twisted (twisted) 2004-12-19 00:01:46.000-0600

is there any way one of us can possibly get into this machine to see if we can come up with a fix for this?

By: twisted (twisted) 2004-12-19 03:40:45.000-0600

Thanks for letting me in, here's the resulting patch :)

By: twisted (twisted) 2004-12-19 03:41:58.000-0600

This patch may be the wrong way to go about doing things, but if we need to branch for specific OSX compatibility options in the future, i think making an __OSX__ definition is a good way to start.


By: Olle Johansson (oej) 2004-12-19 03:47:04.000-0600

This might be needed for FreeBSD as well, I'll give it a try.

By: Olle Johansson (oej) 2004-12-19 03:47:26.000-0600

Btw, is this patch disclaimed?

By: twisted (twisted) 2004-12-19 03:57:05.000-0600

of course it is.  shame on me for forgetting that.   I have a permanent loss of memory for posting that i have a disclaimer on bugs I didn't post.

oej - get on irc

edited on: 12-19-04 03:58

By: Olle Johansson (oej) 2004-12-19 04:24:44.000-0600

FreeBSD now works. It supports GLOB_ABORTED and do not need any ifdef's.

By: twisted (twisted) 2004-12-19 04:26:37.000-0600

While FreeBSD works, OSX (Jaguar) still requires us to mask with ABEND.

By: abombss (abombss) 2004-12-19 10:56:58.000-0600

Just checked out a new version of head and applied twisted's patch.  All builds well on OSX!! Thanks twisted :)

My apologies for marking this bug Major... its a portability issue that only seems to effect OSX and BSD.

By: Brian West (bkw918) 2004-12-19 11:31:38.000-0600

Its not major if you have a workaround.

By: d1ng0 (d1ng0) 2004-12-19 11:38:50.000-0600

Okay guys, decent try it works on OS X apparently, yet same issue still exists with OpenBSD.... though I applied and modified the patch to also include

diff -ruN pbx/pbx_dundi.c.orig pbx/pbx_dundi.c
--- pbx/pbx_dundi.c.orig        Tue Dec 14 18:36:30 2004
+++ pbx/pbx_dundi.c     Sun Dec 19 17:22:45 2004
@@ -39,7 +39,7 @@
#include <sys/socket.h>
#include <string.h>
#include <errno.h>
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(SOLARIS)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(SOLARIS) || defined(__OSX__)
#include <sys/types.h>
#include <netinet/in_systm.h>
@@ -47,7 +47,7 @@
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__OSX__)
#include <net/if_dl.h>
#include <ifaddrs.h>

and now get this on OpenBSD 3.6
gcc -pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g  -Iinclude -I../include -D_REENTRANT -D_GNU_SOURCE  -O6 -march=i386   -pthread  -DASTERISK_VERSION=\"CVS-HEAD-12/19/04-04:15:19\" -DASTERISK_VERSION_NUM=999999 -DINSTALL_PREFIX=\"\" -DASTETCDIR=\"/etc/asterisk\" -DASTLIBDIR=\"/usr/lib/asterisk\" -DASTVARLIBDIR=\"/var/lib/asterisk\" -DASTVARRUNDIR=\"/var/run\" -DASTSPOOLDIR=\"/var/spool/asterisk\" -DASTLOGDIR=\"/var/log/asterisk\" -DASTCONFPATH=\"/etc/asterisk/asterisk.conf\" -DASTMODDIR=\"/usr/lib/asterisk/modules\" -DASTAGIDIR=\"/var/lib/asterisk/agi-bin\"     -DBUSYDETECT_MARTIN      -fPIC   -c -o pbx_dundi.o pbx_dundi.c
pbx_dundi.c: In function `cache_lookup_internal':
pbx_dundi.c:1140: warning: long int format, time_t arg (arg 3)
pbx_dundi.c: In function `save_secret':
pbx_dundi.c:2023: warning: long int format, time_t arg (arg 4)
pbx_dundi.c: In function `load_password':
pbx_dundi.c:2035: warning: long int format, time_t arg (arg 3)
pbx_dundi.c: In function `set_config':
pbx_dundi.c:4523: `IPTOS_MINCOST' undeclared (first use in this function)
pbx_dundi.c:4523: (Each undeclared identifier is reported only once
pbx_dundi.c:4523: for each function it appears in.)
gmake[1]: *** [pbx_dundi.o] Error 1
gmake[1]: Leaving directory `/usr/work/asterisk/pbx'
gmake: *** [subdirs] Error 1

can we debug this further, does someone need access to my box ?

By: Mark Spencer (markster) 2004-12-19 12:34:20.000-0600

Added OSX compatibility patch piece, feel free to open a new ticket if/when you have an OpenBSD patch, too.

By: Digium Subversion (svnbot) 2008-01-15 15:17:07.000-0600

Repository: asterisk
Revision: 4483

U   trunk/Makefile
U   trunk/config.c
U   trunk/pbx/pbx_dundi.c

r4483 | markster | 2008-01-15 15:17:07 -0600 (Tue, 15 Jan 2008) | 2 lines

Merge twisted's OSX compat fix (bug ASTERISK-3033)