From xemacs-m  Tue Feb 18 15:11:51 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
	by xemacs.org (8.8.5/8.8.5) with SMTP id PAA04720
	for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 15:11:50 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id NAA10476; Tue, 18 Feb 1997 13:11:18 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id NAA05906; Tue, 18 Feb 1997 13:11:15 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id NAA19368; Tue, 18 Feb 1997 13:11:14 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id NAA04397; Tue, 18 Feb 1997 13:11:11 -0800
Date: Tue, 18 Feb 1997 13:11:11 -0800
Message-Id: <199702182111.NAA04397@xemacs.eng.sun.com>
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Steven L Baur <steve@miranova.com>
Cc: georgn@canada.Sun.COM, XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: Re: 19.15 b94 build failure, solution and subsequent success
In-Reply-To: <m2n2t1rj1p.fsf@altair.xemacs.org>
References: <199702181756.MAA02028@verve.canada.sun.com>
	<m2n2t1rj1p.fsf@altair.xemacs.org>
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

>>>>> "sb" == Steven L Baur <steve@miranova.com> writes:

>> This is because <unistd.h> has both the BSD and the XPG4.2 (Spec1170)
>> definitions.

>> The BSD definition is:

>> int gethostname(char *, int);

>> The spec1170 definition is:

>> int gethostname(char *, size_t);

>> The problem arises from the fact that src/s/sol2.h defines
>> gethostname() in the spec1170 way to make up for the fact that
>> versions of Solaris prior to 2.6 did not have any prototype for
>> gethostname().

>> The correct thing to do is to change src/s/sol2.h to have the BSD
>> definition.  However, there is a small chance that someone will be
>> upset by said change and it is easier to add:

>> #define __EXTENSIONS__

>> to src/s/sol2-6.h

sb> O.K.

sb> Martin could you do up a patch for this please?

I added
#define __EXTENSIONS__ to 20. sol2.h (not sol2-6.h),
and changed the gethostname prototype to
int gethostname(char *, size_t);
in sol2.h.  This should work on any Solaris system.  Georg?

In general, there should never be a difference between 19.15 and
20.1's src/s directories.  After all, the purpose is to describe
machines and OSes, not XEmacs.

Steve: I recommend simply copying 20.1's src/s directory and
overwriting 19.15's.  There's a new header file for aix4-2, and
various changes for other OSes.  Patch below, but again, simply copy
over all the header files from 20.1.

(mrb@bitpit) ~/x/15/src/s $ gnudiff -U3 . $cdss/s/.

Only in /home/mrb/x/s/editor/src/s/.: SCCS
Only in /home/mrb/x/s/editor/src/s/.: aix4-2.h
diff -U3 ./freebsd.h /home/mrb/x/s/editor/src/s/./freebsd.h
--- ./freebsd.h	Tue Dec 17 19:39:17 1996
+++ /home/mrb/x/s/editor/src/s/./freebsd.h	Sat Feb 15 14:22:28 1997
@@ -33,7 +33,15 @@
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
 #define LIBS_DEBUG
+/* FreeBSD 2.2 or later */
+#ifndef __FreeBSD_version
+#include <osreldate.h>
+#endif
+#if __FreeBSD_version >= 199701
+#define LIBS_SYSTEM -lutil -lxpg4
+#else
 #define LIBS_SYSTEM -lutil
+#endif
 /* XEmacs change: */
 #ifdef HAVE_NCURSES
 #define LIBS_TERMCAP -lncurses -ltermcap
diff -U3 ./linux.h /home/mrb/x/s/editor/src/s/./linux.h
--- ./linux.h	Tue Dec 17 19:57:28 1996
+++ /home/mrb/x/s/editor/src/s/./linux.h	Wed Dec 18 14:44:13 1996
@@ -60,7 +60,7 @@
    people are using newer mailers that have heard of flock.  Change this
    if you need to. */
 
-/* #define MAIL_USE_FLOCK */
+/*#define MAIL_USE_FLOCK*/
 
 /* Here, on a separate page, add any special hacks needed
    to make Emacs work on this system.  For example,
diff -U3 ./sol2.h /home/mrb/x/s/editor/src/s/./sol2.h
--- ./sol2.h	Mon Feb 10 08:00:36 1997
+++ /home/mrb/x/s/editor/src/s/./sol2.h	Sat Feb 15 14:22:29 1997
@@ -1,5 +1,6 @@
 /* Synched up with: FSF 19.31. */
 
+#define __EXTENSIONS__
 #include "usg5-4-2.h"		/* XEmacs change from 5-4 to 5-4-2 */
 
 #define SOLARIS2
@@ -24,14 +25,11 @@
 
 /* Here is how to find X Windows.  The -R option says where
    to find X windows at run time.  */
+#define LD_SWITCH_SYSTEM_RPATH -R/usr/dt/lib:/opt/SUNWdt/lib:/usr/openwin/lib
 #ifdef __GNUC__
-#define LD_SWITCH_SYSTEM -Xlinker -R/usr/openwin/lib
-#elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x400)
-/* XEmacs: <Georg.Nikodym@canada.sun.com> says you need to turn off
-   the incremental linker with Sunpro C 4, or dynodump won't work. */
-#define LD_SWITCH_SYSTEM -xildoff -R/usr/openwin/lib  
-#else /* not GCC or Sunpro C 4.0 */
-#define LD_SWITCH_SYSTEM -R/usr/openwin/lib
+#define LD_SWITCH_SYSTEM -Xlinker LD_SWITCH_SYSTEM_RPATH
+#else 
+#define LD_SWITCH_SYSTEM  LD_SWITCH_SYSTEM_RPATH
 #endif
 
 /* XEmacs change -- Sun CC needs this to default to ANSI */
@@ -45,6 +43,16 @@
    there isn't a prototype for it other than in /usr/ucbinclude. */
 int gethostname (char *, size_t);
 
+/* Get non-ANSI functions from ANSI header files in cc -Xc mode.
+   Sun has promised to fix setjmp.h */
+#if __STDC__ == 1
+#ifndef __GNUC__
+#define _POSIX_C_SOURCE 1
+#include <setjmp.h>
+#undef _POSIX_C_SOURCE
+#endif /* __GNUC__ */
+#endif /* __STDC__ */
+
 /* XEmacs: Solaris include files miss this. */
 struct timeval;
 int utimes (char *file, struct timeval *tvp);
@@ -52,7 +60,7 @@
 /* XEmacs addition: to this to avoid having problems when we later
    define INT_MAX etc. */
 #include <limits.h>
-#endif
+#endif /* C_CODE */
 
 /* XEmacs change -- removed flags to force K & R compilation */
 
diff -U3 ./sunos4-0-shr.h /home/mrb/x/s/editor/src/s/./sunos4-0-shr.h
--- ./sunos4-0-shr.h	Tue Dec 17 19:57:31 1996
+++ /home/mrb/x/s/editor/src/s/./sunos4-0-shr.h	Sat Dec 21 12:53:17 1996
@@ -1,4 +1,4 @@
-/* Synched up with: FSF 19.31. (Split off from sunos4shr.h.) */
+/* Synched up with: FSF 19.31. (Split off from sunos4-shr.h.) */
 
 /* This file permits building Emacs with a shared libc on Sunos 4.
    To make this work, you must completely replace your C shared library

