Summary: | ASTERISK-02693: [patch] Patch to make Asterisk work on Solaris | ||
Reporter: | slimey (slimey) | Labels: | |
Date Opened: | 2004-10-27 17:43:23 | Date Closed: | 2008-01-15 15:16:35.000-0600 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) patch-solaris-20041124 ( 1) patch-solaris-20041209 | |
Description: | The attached patch allows Asterisk 1.0.2 to compile and run on Solaris 8 or 9. I've been running 1.0-RC1 with a similar patch for a couple of months with no problems. This patched version has been running 24 hours already. There is no support for any hardware interfaces. I am using it with SIP and IAX2 hardphones, softphones and PSTN gateways. | ||
Comments: | By: Mark Spencer (markster) 2004-10-27 18:00:26 Can you attach a patch for CVS head? Thanks! By: Mark Spencer (markster) 2004-10-27 18:21:10 Also please read the bug guidelines before placing further bugs and feature requests. There are very clear guidelines for what qualifies as a "MAJOR" bug and this is clearly a new feature since Solaris is not (yet) a supported build. By: slimey (slimey) 2004-10-27 19:06:58 Apologies for the MAJOR bit - I did realise in hindsight that I should have set it to Feature, but there doesn't appear to be a way for me to change that after submitting the bug. The patch did actually apply to HEAD cleanly, although the new module pbx_dundi needed an minor extra tweak (which looks like it results int the EID not being seeded automatically - I can probably fix this if necessary, but as I'm not using Dundi (yet), I would not have a way to easily test it). I've attached a new patch made against CVS head. By: Mark Spencer (markster) 2004-10-28 18:37:30 Also, do you have a disclaimer on file? By: Brian West (bkw918) 2004-10-29 16:04:22 can we get it all in a diff -u format? By: slimey (slimey) 2004-10-29 17:40:27 diff -u patch uploaded. Older patches can be deleted if people like (I don't seem to have the option). Disclaimer will be on its way as soon as I can get to a fax machine. By: Mark Spencer (markster) 2004-10-30 09:13:13 Just a few things: 1) This patch seems to hard code the endian for solaris as big-endian, which would suggest this code would not run on solaris/x86... 2) No need to rename variable "sun" to java-esque "sunAddr" although if you have to rename it, you may just make it "sunaddr". 3) Would it be easier to just say: #ifndef AF_LOCAL #define AF_LOCAL AF_UNIX #endif ?? 4) do "get_uint32" and friends support both endiannesses? If not, maybe the cancatenation can be done numerically (e.g. p[0] | (p[1] << 8) etc) 5) We could just do a macro so that we don't have to add a new function... #ifdef SOLARIS #define get_uint32(foo) __get_uint32(&foo) #else #define get_uint32(foo) (foo) #endif other than that looks good. By: thefloyd (thefloyd) 2004-11-02 09:40:18.000-0600 Seem to be having problems with editline on solaris 9. See attached. More specifically: (Tue 10:40am) seamus@trust pts/3:~/asterisk-1.0.2> uname -a SunOS trust 5.9 Generic_117171-12 sun4u sparc SUNW,Ultra-5_10 (Tue 10:41am) seamus@trust pts/3:~/asterisk-1.0.2> gcc -v Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.2 (Tue 10:41am) seamus@trust pts/3:~/asterisk-1.0.2> make -v GNU Make 3.80 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (Tue 10:41am) seamus@trust pts/3:~/asterisk-1.0.2> Any ideas? [er.. the attachment didn't work.. see below for details] make[1]: Entering directory `/export/home/seamus/asterisk-1.0.2/editline' gcc -c -Wall -pipe -g3 -O -DSOLARIS '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)=' -I. np/vis.c -o np/vis.o_a np/vis.c:37:23: sys/cdefs.h: No such file or directory In file included from np/vis.c:45: ./np/vis.h:80: error: syntax error before "char" ./np/vis.h:80: error: parse error before "__P" ./np/vis.h:81: error: parse error before "__P" ./np/vis.h:82: error: parse error before "__P" ./np/vis.h:83: error: parse error before "__P" ./np/vis.h:84: error: parse error before "__P" ./np/vis.h:85: error: parse error before "__P" ./np/vis.h:86: error: parse error before "__P" ./np/vis.h:87: error: parse error before "__P" ./np/vis.h:92: error: parse error before "__P" In file included from /usr/include/stdlib.h:18, from np/vis.c:46: /usr/include/iso/stdlib_iso.h:37: error: syntax error before "extern" np/vis.c: In function `svis': np/vis.c:204: warning: implicit declaration of function `alloca' np/vis.c: In function `strsvis': np/vis.c:246: warning: subscript has type `char' np/vis.c:246: warning: subscript has type `char' np/vis.c:246: warning: subscript has type `char' np/vis.c:249: warning: subscript has type `char' np/vis.c:249: warning: subscript has type `char' np/vis.c: In function `strsvisx': np/vis.c:276: warning: subscript has type `char' np/vis.c:276: warning: subscript has type `char' np/vis.c:276: warning: subscript has type `char' np/vis.c:281: warning: subscript has type `char' np/vis.c:281: warning: subscript has type `char' make[1]: *** [np/vis.o_a] Error 1 make[1]: Leaving directory `/export/home/seamus/asterisk-1.0.2/editline' make: *** [editline/libedit.a] Error 2 (Tue 10:40am) seamus@trust pts/3:~/asterisk-1.0.2> edited on: 11-02-04 09:41 By: Mark Spencer (markster) 2004-11-06 12:39:55.000-0600 Any update? Did the disclaimer ever make it? By: Mark Spencer (markster) 2004-11-10 20:33:02.000-0600 I will be unable to merge this change without confirmation of the disclaimer and repairs to some of the functions. Please respond as soon as possible. Thanks! By: slimey (slimey) 2004-11-11 16:14:48.000-0600 Apologies - been laid up in bed with a chest infection. Can I email you a scan of the disclaimer? Will look at the other changes now... By: Mark Spencer (markster) 2004-11-11 16:33:11.000-0600 E-mail me the scan, that's fine. I'm sorry you've not been feeling well! Perhaps we can talk on IRC about revising the patch before we merge it, however. Thanks! By: slimey (slimey) 2004-11-11 16:44:34.000-0600 Great - what email address? Where can I find you on IRC? #asterisk on irc.freenode.net? By: Russell Bryant (russell) 2004-11-14 22:44:00.000-0600 markster@digium.com kram on freenode By: Russell Bryant (russell) 2004-11-22 16:13:17.000-0600 I hope you're feeling better! Have you been able to get in touch with Mark to discuss these changes? By: slimey (slimey) 2004-11-22 16:16:24.000-0600 Not had a chance to talk to Mark yet, although he does now have a disclaimer from me. I did have another go at testing things at the weekend, and found that things at CVS HEAD had drifted from when I first did the patch, plus I seemed to have missed a couple of file diffs when I did the patch. I've also found that translations don't work properly with this patch. I should have something more to report in a few days, and a new patch. Simon By: Russell Bryant (russell) 2004-11-24 12:39:28.000-0600 removed old patches at the request of the author By: slimey (slimey) 2004-11-24 15:31:00.000-0600 Herewith the latest patch for solaris. I've tested it against today's CVS. I'm running it in live at the moment with SIP and IAX2 channels without problem. I've taken into account Mark's suggestions in this latest patch. By: Mark Spencer (markster) 2004-11-28 11:08:02.000-0600 1) Compat func for setenv rather than #ifdef's 2) Compat function for flock: #ifdef SOLARIS #define DECLARE_LOCK(lock) struct flock lock #define FILE_LOCK(f,l) do { l...; fcntl(f, F_SETLK, &l); } while(0) #define FILE_UNLOCK(f,l) do { l...; fcntl(f, F_SETLK, &l); } while (0) #else #define DECLARE_LOCK(lock) #define FILE_LOCK(f,l) flock(f,LOCK_EX) #define FILE_UNLOCK(f,l) flock(f, LOCK_UN) #endif . . . DECLARE_LOCK(lock) . . FILE_LOCK(fileno(fp), lock) FILE_UNLOCK(fileno(fp), lock) 3) Compat for "timersub" 4) Make write_int a macro similar to the get32 stuff Other than that, looks pretty good! By: Russell Bryant (russell) 2004-12-08 01:47:01.000-0600 slimey: ping! By: ericm (ericm) 2004-12-08 14:42:00.000-0600 I'm getting the same build error as "theFloyd", any ideas? crabtree:/ # uname -a SunOS crabtree 5.8 Generic_108528-12 sun4u sparc SUNW,UltraAX-i2 crabtree:/ # gcc -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs gcc version 2.95.3 20010315 (release) crabtree:/ # make -v GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. Built for sparc-sun-solaris2.8 Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. gcc -c -Wall -pipe -g3 -O -DSOLARIS -I../include/solaris-compat '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)=' -I. np/fgetln.c -o np/fgetln.o_a gcc -c -Wall -pipe -g3 -O -DSOLARIS -I../include/solaris-compat '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)=' -I. np/vis.c -o np/vis.o_a np/vis.c:37: sys/cdefs.h: No such file or directory In file included from np/vis.c:45: np/vis.h:77: sys/cdefs.h: No such file or directory In file included from np/vis.c:45: np/vis.h:80: syntax error before `char' np/vis.h:80: parse error before `__P' np/vis.h:81: parse error before `__P' np/vis.h:82: parse error before `__P' np/vis.h:83: parse error before `__P' np/vis.h:84: parse error before `__P' np/vis.h:85: parse error before `__P' np/vis.h:86: parse error before `__P' np/vis.h:87: parse error before `__P' np/vis.h:92: parse error before `__P' In file included from /usr/include/stdlib.h:18, from np/vis.c:46: /usr/include/iso/stdlib_iso.h:37: syntax error before `extern' np/vis.c: In function `strsvis': np/vis.c:246: warning: subscript has type `char' np/vis.c:246: warning: subscript has type `char' np/vis.c:246: warning: subscript has type `char' np/vis.c:249: warning: subscript has type `char' np/vis.c:249: warning: subscript has type `char' np/vis.c: In function `strsvisx': np/vis.c:276: warning: subscript has type `char' np/vis.c:276: warning: subscript has type `char' np/vis.c:276: warning: subscript has type `char' np/vis.c:281: warning: subscript has type `char' np/vis.c:281: warning: subscript has type `char' make[1]: *** [np/vis.o_a] Error 1 make[1]: Leaving directory `/usr/share/src/asterisk/editline' make: *** [editline/libedit.a] Error 2 By: ericm (ericm) 2004-12-09 10:51:39.000-0600 got it to compile, had to change some references from ../include/solaris-compat to ../../include/solaris-compat By: slimey (slimey) 2004-12-09 18:00:27.000-0600 Very odd. I've fetched from CVS, applied the patch, and built the code many times now, and it works everytime. I wonder if it's a gcc 2.95 -> 3.4.2 difference? By: slimey (slimey) 2004-12-09 18:01:50.000-0600 Herewith a new patch incorporating kram's suggestions. By: Mark Spencer (markster) 2004-12-14 18:39:58.000-0600 Added in CVS, thank you very much for this major assistance. By: Russell Bryant (russell) 2004-12-14 22:51:17.000-0600 not included in 1.0 By: Digium Subversion (svnbot) 2008-01-15 15:16:35.000-0600 Repository: asterisk Revision: 4446 U trunk/CREDITS U trunk/Makefile U trunk/acl.c U trunk/aesopt.h U trunk/agi/Makefile U trunk/agi/eagi-sphinx-test.c U trunk/agi/eagi-test.c U trunk/apps/Makefile U trunk/apps/app_nbscat.c U trunk/apps/app_qcall.c U trunk/apps/app_sms.c U trunk/ast_expr.y U trunk/asterisk.c U trunk/channels/Makefile U trunk/channels/chan_mgcp.c U trunk/channels/chan_modem.c U trunk/channels/chan_zap.c U trunk/channels/iax2-parser.c U trunk/cli.c U trunk/codecs/Makefile U trunk/codecs/gsm/Makefile U trunk/codecs/lpc10/Makefile U trunk/db1-ast/Makefile U trunk/db1-ast/include/db.h U trunk/editline/Makefile.in U trunk/editline/np/vis.c U trunk/editline/sys.h U trunk/formats/format_g726.c U trunk/formats/format_g729.c U trunk/formats/format_gsm.c U trunk/formats/format_h263.c U trunk/formats/format_ilbc.c U trunk/formats/format_jpeg.c U trunk/formats/format_pcm.c U trunk/formats/format_pcm_alaw.c U trunk/formats/format_sln.c U trunk/formats/format_vox.c U trunk/formats/format_wav.c U trunk/formats/format_wav_gsm.c U trunk/include/asterisk/channel.h U trunk/include/asterisk/frame.h U trunk/include/asterisk/lock.h A trunk/include/solaris-compat/ A trunk/include/solaris-compat/compat.h A trunk/include/solaris-compat/sys/ A trunk/include/solaris-compat/sys/cdefs.h A trunk/include/solaris-compat/sys/queue.h U trunk/logger.c U trunk/md5.c U trunk/mkdep U trunk/mkpkgconfig U trunk/pbx/pbx_dundi.c U trunk/rtp.c U trunk/say.c U trunk/stdtime/localtime.c A trunk/strcompat.c U trunk/utils.c ------------------------------------------------------------------------ r4446 | markster | 2008-01-15 15:16:35 -0600 (Tue, 15 Jan 2008) | 2 lines Merge slimey's Solaris compatibility (with small mods) (bug ASTERISK-2693) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=4446 |