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

Re: does ns-allinone-2.1b5 really work on sparc-sun-solaris2.6?



On Wed, 31 Mar 1999 11:30:14 +0200, Simon Schneider wrote: 
>Hi,
>I installed ns-allinone-2.1b5 on a sparc-sun-solaris2.6 without any
>problems. So apparently there's something wrong within your system.
>
>Cheers, Simon
>
>Zhiwei Xiao wrote:
>> 
>>   hi, there:
>> 
>>       maybe it is too latest and could not be bug-free. I got a lot of
>> trouble from installing ns-allinone-2.1b5 on sparc-sun-solaris2.6.
>> below is one( one file under the nam directory could not compile).
>> any advice is highly appreciated!
>> 
>> rm -f xwd.o; gcc -o xwd.o -c -O2 -DTCL_TK  -DNDEBUG -mv8 -msupersparc
>> -D__svr4__ -DUSE_SHM -DHAVE_LIBZ1_1_3 -DHAVE_ZLIB_H -DHAVE_LIBTCLCL1_0B8
>> -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_0A4 -DHAVE_OTCL_H -DHAVE_LIBTK8_0
>> -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H  -I. -I../zlib-1.1.3
>> -I../tclcl-1.0b8 -I../otcl-1.0a4
>> -I/export/home/xiao/NS2/ns-allinone-2.1b5/nam-1.0a7/../tk8.0.4/generic
>> -I../tcl8.0.4/generic  xwd.c
>> xwd.c: In function `xwd_Window_Dump':
>> xwd.c:279: `sz_' undeclared (first use in this function)
>> xwd.c:279: (Each undeclared identifier is reported only once
>> xwd.c:279: for each function it appears in.)
>> xwd.c:279: parse error before `XWDheader'
>> xwd.c:328: parse error before `XWDheader'
>...

There was some discussion on (and off) ns-users recently about this
problem, and with Stefan Dresler arrived at the attached patch as a
work-around.  The causes are not entirely clear, posibly some kind of
compiler misconfiguration.

   -John Heidemann

===================================================================
RCS file: /usr/src/mash/repository/vint/nam-1/xwd.c,v
retrieving revision 1.3
diff -u -r1.3 xwd.c
--- xwd.c       1998/01/22 01:02:51     1.3
+++ xwd.c       1999/03/31 16:20:50
@@ -88,6 +88,21 @@
 
 /* Use our own... */
 #include "XWDFile.h"
+/*
+ * work-around solaris 2.6 problem:
+ * SIZEOF is defined in Xmd.h, which is included by XWDFile.h
+ * make sure we get the right (ansi) definition).
+ */
+#if defined(sun) && defined(__svr4__)
+#undef SIZEOF
+#define SIZEOF(x) sz_##x
+#endif
+
+
+/* work-around solaris 2.6 problem */
+#ifndef SIZEOF
+#define SIZEOF(x) sz_##x
+#endif