Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 2002 11:11:38 +0400 (MSD)
From:      "Sergey E. Levov" <serg@informika.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/41773: new port: x11-servers/Mozdev-PrintServer
Message-ID:  <200208190711.g7J7BcaN000853@serg.informika.ru>

next in thread | raw e-mail | index | archive | help

>Number:         41773
>Category:       ports
>Synopsis:       new port: x11-servers/Mozdev-PrintServer
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 19 00:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sergey E. Levov
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Informika
>Environment:
System: FreeBSD serg.informika.ru 4.6-STABLE FreeBSD 4.6-STABLE #10: Fri Jun 28 13:25:18 MSD 2002 serg@serg.informika.ru:/usr/obj/usr/src/sys/MAIN i386

>Description:

Mozdev-PrintServer is a replacement for broken X print server comes
with XFree86 4.2.0.


>How-To-Repeat:
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Mozdev-PrintServer
#	Mozdev-PrintServer/Makefile
#	Mozdev-PrintServer/pkg-comment
#	Mozdev-PrintServer/pkg-descr
#	Mozdev-PrintServer/pkg-plist
#	Mozdev-PrintServer/files
#	Mozdev-PrintServer/files/patch-ad
#	Mozdev-PrintServer/files/patch-ab
#	Mozdev-PrintServer/files/patch-ac
#	Mozdev-PrintServer/files/patch-aa
#	Mozdev-PrintServer/files/patch-ae
#	Mozdev-PrintServer/distinfo
#
echo c - Mozdev-PrintServer
mkdir -p Mozdev-PrintServer > /dev/null 2>&1
echo x - Mozdev-PrintServer/Makefile
sed 's/^X//' >Mozdev-PrintServer/Makefile << 'END-of-Mozdev-PrintServer/Makefile'
X# New ports collection makefile for:	Mozdev-PrintServer
X# Date created:		16 Aug 2002
X# Whom:			serg@informika.ru
X#
X# $FreeBSD$  
X#
X
XPORTNAME=	PrintServer
XPORTVERSION=	0.006
XCATEGORIES=	x11-servers
XMASTER_SITES=	http://puck.informatik.med.uni-giessen.de/download/
XDISTFILES=	xprint_mozdev_org_source-2002-07-10-trunk.tar.gz
XEXTRACT_ONLY=	xprint_mozdev_org_source-2002-07-10-trunk.tar.gz
XPKGNAMEPREFIX=	Mozdev-
X
XMAINTAINER=	serg@informika.ru
X
XXFREE86_VERSION=	4
X#USE_IMAKE=		YES
XUSE_X_PREFIX=		YES
XDIST_SUBDIR=		xprint-mozdev
XWRKSRC=			${WRKDIR}/xprint/src/xprint_main/xc
XSCRIPTS_ENV=		HasXdmAuth=${HasXdmAuth} 
XMAKE_ENV=		MAN_INSTALL_TARGET=NOOP
XALL_TARGET=		World
XINSTALL_TARGET=		installXprt
X
XHasXdmAuth?=		YES
X
X.include <bsd.port.mk>
END-of-Mozdev-PrintServer/Makefile
echo x - Mozdev-PrintServer/pkg-comment
sed 's/^X//' >Mozdev-PrintServer/pkg-comment << 'END-of-Mozdev-PrintServer/pkg-comment'
XXPRINT.MOZDEV.ORG X print server
X
END-of-Mozdev-PrintServer/pkg-comment
echo x - Mozdev-PrintServer/pkg-descr
sed 's/^X//' >Mozdev-PrintServer/pkg-descr << 'END-of-Mozdev-PrintServer/pkg-descr'
XThis package contains Xprt, X print server, from MOZDEV.ORG
X
XWWW: http://xprint.mozdev.org/
END-of-Mozdev-PrintServer/pkg-descr
echo x - Mozdev-PrintServer/pkg-plist
sed 's/^X//' >Mozdev-PrintServer/pkg-plist << 'END-of-Mozdev-PrintServer/pkg-plist'
Xbin/Xprt
END-of-Mozdev-PrintServer/pkg-plist
echo c - Mozdev-PrintServer/files
mkdir -p Mozdev-PrintServer/files > /dev/null 2>&1
echo x - Mozdev-PrintServer/files/patch-ad
sed 's/^X//' >Mozdev-PrintServer/files/patch-ad << 'END-of-Mozdev-PrintServer/files/patch-ad'
X--- programs/Imakefile.orig	Fri Aug 16 19:06:45 2002
X+++ programs/Imakefile	Fri Aug 16 19:07:49 2002
X@@ -44,16 +44,8 @@
X       SCRIPTSDIR = scripts
X #endif
X 
X-SUBDIRS = \
X-	appres bdftopcf bitmap editres fsinfo fslsfonts fstobdf iceauth \
X-	mkfontdir oclock $(PROXYMGRSRCDIR) $(RGBSRCDIR) $(RSTARTSRCDIR) \
X-	$(SMPROXYSRCDIR) $(TWMSRCDIR) x11perf xauth xclipboard xclock \
X-	xcmsdb $(XCONSOLESRCDIR) $(XDMSRCDIR) xdpyinfo xfd $(XFSSRCDIR) \
X-	$(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XHOSTSRCDIR) xieperf \
X-	$(XINITSRCDIR) $(XKBSRCDIRS) xkill xlogo xlsatoms xlsclients \
X-	xlsfonts xmag xmodmap xprop xrdb xrefresh $(XRXSRCDIR) xset \
X-	xsetroot $(XSMSRCDIR) xstdcmap $(XTERMSRCDIR) xwd xwininfo xwud \
X-	$(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(XPSRCDIRS) $(SCRIPTSDIR)
X+SUBDIRS =	$(XSSRCDIR) $(XPSRCDIRS)
X+
X 
X MakeSubdirs($(SUBDIRS))
X DependSubdirs($(SUBDIRS))
END-of-Mozdev-PrintServer/files/patch-ad
echo x - Mozdev-PrintServer/files/patch-ab
sed 's/^X//' >Mozdev-PrintServer/files/patch-ab << 'END-of-Mozdev-PrintServer/files/patch-ab'
X--- config/imake/Makefile.ini.orig	Tue May 28 05:27:37 2002
X+++ config/imake/Makefile.ini	Fri Aug 16 13:11:40 2002
X@@ -7,6 +7,7 @@
X # may be given at the top of the build tree for systems that do not define
X # any machine-specific preprocessor symbols.
X #
X+# $XFree86: xc/config/imake/Makefile.ini,v 3.10 2001/01/17 16:38:55 dawes Exp $
X 
X BOOTSTRAPCFLAGS = 
X CC = cc
X@@ -25,7 +26,7 @@
X 	@echo "making imake with BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS) in config/imake"
X 
X imake:: imake.o
X-	$(CC) -o imake imake.o
X+	$(CC) -o imake $(CFLAGS) imake.o
X 
X imake.o: ccimake imake.c
X 	$(CC) -c $(CFLAGS) `./ccimake` imake.c
X@@ -37,8 +38,10 @@
X .NO_CONFIG_REC: ccimake
X 
X bootstrap:
X-	@if [ -d bootstrap ]; then exit 0; else set -x; mkdir bootstrap; fi
X-	$(MV) *.o imake bootstrap
X+	-@if [ -d bootstrap ]; then exit 0; else set -x; mkdir bootstrap; fi
X+	$(MV) *.o bootstrap
X+	@if [ -f imake.exe ]; then set -x; $(MV) imake.exe bootstrap; \
X+	 elif [ -f imake ]; then set -x; $(MV) imake bootstrap; else exit 0; fi
X 
X relink:
X 	$(RM) imake
X@@ -63,3 +66,10 @@
X clean.Win32:
X 	if exist imake.exe del imake.exe
X 	if exist imake.obj del imake.obj
X+
X+clean.os2:
X+	imakesvc 4 imake imake.exe imake.o /imake.exe
X+
X+imake.os2: imake.c
X+	$(CC) -DBSD43 $(CFLAGS) -o imake.exe imake.c
X+	copy imake.exe \\ 
X
X--- config/imake/ccimake.c.orig	Tue May 28 05:27:37 2002
X+++ config/imake/ccimake.c	Fri Aug 16 13:11:40 2002
X@@ -24,6 +24,7 @@
X in this Software without prior written authorization from The Open Group .
X 
X */
X+/* $XFree86: xc/config/imake/ccimake.c,v 1.3 2001/12/14 19:53:18 dawes Exp $ */
X 
X /* 
X  * Warning:  This file must be kept as simple as posible so that it can 
X@@ -38,9 +39,10 @@
X #define imake_ccflags "-O"
X #endif
X 
X+int
X main()
X {
X 	write(1, imake_ccflags, sizeof(imake_ccflags) - 1);
X-	exit(0);
X+	return 0;
X }
X 
X--- config/imake/imake.c.orig	Tue May 28 05:27:37 2002
X+++ config/imake/imake.c	Fri Aug 16 13:11:40 2002
X@@ -1,4 +1,3 @@
X-/* $Id */
X 
X /***************************************************************************
X  *                                                                         *
X@@ -8,6 +7,7 @@
X  * be passed to the template file.                                         *
X  *                                                                         *
X  ***************************************************************************/
X+/* $XFree86: xc/config/imake/imake.c,v 3.48 2001/12/14 19:53:18 dawes Exp $ */
X 
X /*
X  * 
X@@ -47,6 +47,8 @@
X  * on the Makefile.
X  * Options:
X  *		-D	define.  Same as cpp -D argument.
X+ *		-U	undefine.  Same as cpp -U argument.
X+ *		-W	warning.  Same as cpp -W argument.
X  *		-I	Include directory.  Same as cpp -I argument.
X  *		-T	template.  Designate a template other
X  *			than Imake.tmpl
X@@ -102,6 +104,9 @@
X  *	- If DEFAULT_OS_TEENY_REV is defined, format the utsname struct
X  *	  and call the result <defaultOsTeenyVersion>.  Add:
X  *		#define DefaultOSTeenyVersion <defaultOsTeenyVersion>
X+ *      - If DEFAULT_MACHINE_ARCITECTURE is defined, format the utsname struct
X+ *        and define the corresponding macro. (For example on the amiga,
X+ *        this will define amiga in addition to m68k).    
X  *	- If the file "localdefines" is readable in the current
X  *	  directory, print a warning message to stderr and add: 
X  *		#define IMAKE_LOCAL_DEFINES	"localdefines"
X@@ -140,17 +145,27 @@
X  *	#include INCLUDE_IMAKEFILE
X  *	<add any global targets like 'clean' and long dependencies>
X  */
X+#if defined(__FreeBSD__) || defined(__NetBSD__)
X+/* This needs to be before _POSIX_SOURCE gets defined */
X+# include <sys/param.h>
X+# include <sys/types.h>
X+# include <sys/sysctl.h>
X+#endif
X+#include <stdlib.h>
X #include <stdio.h>
X-#include <ctype.h>
X #include "Xosdefs.h"
X+#include <string.h>
X+#include <ctype.h>
X #ifdef WIN32
X # include "Xw32defs.h"
X #endif
X+#if 0
X #ifndef X_NOT_POSIX
X # ifndef _POSIX_SOURCE
X #  define _POSIX_SOURCE
X # endif
X #endif
X+#endif
X #include <sys/types.h>
X #include <fcntl.h>
X #ifdef X_NOT_POSIX
X@@ -160,6 +175,9 @@
X #else
X # include <unistd.h>
X #endif
X+#ifdef ISC
X+# include <unistd.h>
X+#endif
X #if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
X # include <signal.h>
X #else
X@@ -167,9 +185,16 @@
X # include <signal.h>
X # undef _POSIX_SOURCE
X #endif
X+#if !defined(SIGCHLD) && defined(SIGCLD)
X+# define SIGCHLD		SIGCLD
X+#endif
X #include <sys/stat.h>
X #ifndef X_NOT_POSIX
X # ifdef _POSIX_SOURCE
X+#  ifdef SCO325
X+#   include <sys/procset.h>
X+#   include <sys/siginfo.h>
X+#  endif
X #  include <sys/wait.h>
X # else
X #  define _POSIX_SOURCE
X@@ -202,21 +227,20 @@
X #  define WIFEXITED(w) waitCode(w)
X # endif
X #endif /* X_NOT_POSIX */
X-#ifndef X_NOT_STDC_ENV
X-# include <stdlib.h>
X-#else
X-char *malloc(), *realloc();
X-void exit();
X-#endif
X+#include <stdlib.h>
X #if defined(macII) && !defined(__STDC__)  /* stdlib.h fails to define these */
X char *malloc(), *realloc();
X #endif /* macII */
X-#ifdef X_NOT_STDC_ENV
X-extern char	*getenv();
X-#endif
X #include <errno.h>
X-#ifdef X_NOT_STDC_ENV
X-extern int	errno;
X+#ifdef __minix_vmd
X+#define USE_FREOPEN		1
X+#endif
X+
X+#if !((defined(sun) && !defined(SVR4)) || defined(macII))
X+#define USE_STRERROR		1
X+#endif
X+#ifdef __EMX__
X+#define USE_STRERROR		1
X #endif
X #ifndef WIN32
X #include <sys/utsname.h>
X@@ -230,21 +254,21 @@
X #  define SYS_NMLN 257
X # endif
X #endif
X-#ifdef linux
X+#if defined(linux) || defined(__GNU__)
X #include <limits.h>
X+#include <stdio.h>
X #endif
X-/* 
X- * is strstr() in <strings.h> on X_NOT_STDC_ENV? 
X- * are there any X_NOT_STDC_ENV machines left in the world?
X- */
X-#include <string.h>
X+#ifdef __QNX__
X+#include <unix.h>
X+#endif
X+
X #include "imakemdep.h"
X 
X /*
X  * This define of strerror is copied from (and should be identical to)
X  * Xos.h, which we don't want to include here for bootstrapping reasons.
X  */
X-#if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) || defined(macII)
X+#ifndef USE_STRERROR
X # ifndef strerror
X extern char *sys_errlist[];
X extern int sys_nerr;
X@@ -253,6 +277,14 @@
X # endif
X #endif
X 
X+#if defined(__NetBSD__)		/* see code clock in init() below */
X+#include <sys/utsname.h>
X+#endif
X+
X+#if !(defined(Lynx) || defined(__Lynx__) || (defined(SVR4) && !defined(sun))) && !defined(__CYGWIN__)
X+#define HAS_MKSTEMP
X+#endif
X+
X #define	TRUE		1
X #define	FALSE		0
X 
X@@ -273,7 +305,7 @@
X  * space instead of being deleted.  Blech.
X  */
X #ifdef FIXUP_CPP_WHITESPACE
X-void KludgeOutputLine(), KludgeResetRule();
X+void KludgeOutputLine(char **), KludgeResetRule(void);
X #else
X # define KludgeOutputLine(arg)
X # define KludgeResetRule()
X@@ -316,35 +348,45 @@
X boolean haveImakefileC = FALSE;
X char	*cleanedImakefile = NULL;
X char	*program;
X-char	*FindImakefile();
X-char	*ReadLine();
X-char	*CleanCppInput();
X-char	*Strdup();
X-char	*Emalloc();
X-void	LogFatalI(), LogFatal(), LogMsg();
X-
X-void	showit();
X-void	wrapup();
X-void	init();
X-void	AddMakeArg();
X-void	AddCppArg();
X-void	SetOpts();
X-void	CheckImakefileC();
X-void	cppit();
X-void	makeit();
X-void	CleanCppOutput();
X-boolean	isempty();
X-void	writetmpfile();
X+char	*FindImakefile(char *Imakefile);
X+char	*ReadLine(FILE *tmpfd, char *tmpfname);
X+char	*CleanCppInput(char *imakefile);
X+char	*Strdup(char *cp);
X+char	*Emalloc(int size);
X+void	LogFatalI(char *s, int i), LogFatal(char *x0, char *x1), 
X+        LogMsg(char *x0, char *x1);
X+
X+void	showit(FILE *fd);
X+void	wrapup(void);
X+void	init(void);
X+void	AddMakeArg(char *arg);
X+void	AddCppArg(char *arg);
X+void	SetOpts(int argc, char **argv);
X+void	CheckImakefileC(char *masterc);
X+void	cppit(char *imakefile, char *template, char *masterc, 
X+	      FILE *outfd, char *outfname);
X+void	makeit(void);
X+void	CleanCppOutput(FILE *tmpfd, char *tmpfname);
X+boolean	isempty(char *line);
X+void	writetmpfile(FILE *fd, char *buf, int cnt, char *fname);
X+#ifdef SIGNALRETURNSINT
X+int     catch(int sig);
X+#else
X+void    catch(int sig);
X+#endif
X+void    showargs(char **argv);
X+boolean optional_include(FILE *inFile, char *defsym, char *fname);
X+void    doit(FILE *outfd, char *cmd, char **argv);
X+boolean define_os_defaults(FILE *inFile);
X+
X 
X boolean	verbose = FALSE;
X boolean	show = TRUE;
X 
X int
X-main(argc, argv)
X-	int	argc;
X-	char	**argv;
X+main(int argc, char *argv[])
X {
X-	FILE	*tmpfd;
X+	FILE	*tmpfd = NULL;
X 	char	makeMacro[ BUFSIZ ];
X 	char	makefileMacro[ BUFSIZ ];
X 
X@@ -354,11 +396,29 @@
X 
X 	Imakefile = FindImakefile(Imakefile);
X 	CheckImakefileC(ImakefileC);
X-	if (Makefile)
X-		tmpMakefile = Makefile;
X-	else {
X+	if (Makefile) {
X+                tmpMakefile = Makefile;
X+                if ((tmpfd = fopen(tmpMakefile, "w+")) == NULL)
X+                   LogFatal("Cannot create temporary file %s.", tmpMakefile);
X+	} else {
X+#ifdef HAS_MKSTEMP
X+	        int fd;
X+#endif
X 		tmpMakefile = Strdup(tmpMakefile);
X-		(void) mktemp(tmpMakefile);
X+#ifndef HAS_MKSTEMP
X+		if (mktemp(tmpMakefile) == NULL ||
X+		    (tmpfd = fopen(tmpMakefile, "w+")) == NULL) {
X+		   LogFatal("Cannot create temporary file %s.", tmpMakefile);
X+		}
X+#else
X+	        fd = mkstemp(tmpMakefile);
X+	        if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) {
X+		   if (fd != -1) {
X+		      unlink(tmpMakefile); close(fd);
X+		   }
X+		   LogFatal("Cannot create temporary file %s.", tmpMakefile);
X+		}
X+#endif
X 	}
X 	AddMakeArg("-f");
X 	AddMakeArg( tmpMakefile );
X@@ -367,9 +427,6 @@
X 	sprintf(makefileMacro, "MAKEFILE=%s", Imakefile);
X 	AddMakeArg( makefileMacro );
X 
X-	if ((tmpfd = fopen(tmpMakefile, "w+")) == NULL)
X-		LogFatal("Cannot create temporary file %s.", tmpMakefile);
X-
X 	cleanedImakefile = CleanCppInput(Imakefile);
X 	cppit(cleanedImakefile, Template, ImakefileC, tmpfd, tmpMakefile);
X 
X@@ -383,8 +440,7 @@
X }
X 
X void
X-showit(fd)
X-	FILE	*fd;
X+showit(FILE *fd)
X {
X 	char	buf[ BUFSIZ ];
X 	int	red;
X@@ -397,7 +453,7 @@
X }
X 
X void
X-wrapup()
X+wrapup(void)
X {
X 	if (tmpMakefile != Makefile)
X 		unlink(tmpMakefile);
X@@ -412,8 +468,7 @@
X #else
X void
X #endif
X-catch(sig)
X-	int	sig;
X+catch(int sig)
X {
X 	errno = 0;
X 	LogFatalI("Signal %d.", sig);
X@@ -423,7 +478,7 @@
X  * Initialize some variables.
X  */
X void
X-init()
X+init(void)
X {
X 	register char	*p;
X 
X@@ -434,6 +489,27 @@
X 	while (cpp_argv[ cpp_argindex ] != NULL)
X 		cpp_argindex++;
X 
X+#if defined(__NetBSD__)
X+	{
X+		struct utsname uts;
X+		static char argument[512];
X+
X+		/*
X+		 * Sharable imake configurations require a
X+		 * machine identifier.
X+		 */
X+		if (uname(&uts) != 0)
X+			LogFatal("uname(3) failed; can't tell what %s",
X+			    "kind of machine you have.");
X+
X+		memset(argument, 0, sizeof(argument));
X+		(void)snprintf(argument, sizeof(argument) - 1,
X+		    "-D__%s__", uts.machine);
X+
X+		AddCppArg(argument);
X+	}
X+#endif /* __NetBSD__ */
X+
X 	/*
X 	 * See if the standard include directory is different than
X 	 * the default.  Or if cpp is not the default.  Or if the make
X@@ -457,11 +533,13 @@
X 
X 	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
X 		signal(SIGINT, catch);
X+#ifdef SIGCHLD
X+	signal(SIGCHLD, SIG_DFL);
X+#endif
X }
X 
X void
X-AddMakeArg(arg)
X-	char	*arg;
X+AddMakeArg(char *arg)
X {
X 	errno = 0;
X 	if (make_argindex >= ARGUMENTS-1)
X@@ -471,8 +549,7 @@
X }
X 
X void
X-AddCppArg(arg)
X-	char	*arg;
X+AddCppArg(char *arg)
X {
X 	errno = 0;
X 	if (cpp_argindex >= ARGUMENTS-1)
X@@ -482,9 +559,7 @@
X }
X 
X void
X-SetOpts(argc, argv)
X-	int	argc;
X-	char	**argv;
X+SetOpts(int argc, char **argv)
X {
X 	errno = 0;
X 	/*
X@@ -499,6 +574,10 @@
X 		    AddCppArg(argv[0]);
X 		} else if (argv[0][1] == 'I') {
X 		    AddCppArg(argv[0]);
X+		} else if (argv[0][1] == 'U') {
X+		    AddCppArg(argv[0]);
X+		} else if (argv[0][1] == 'W') {
X+		    AddCppArg(argv[0]);
X 		} else if (argv[0][1] == 'f') {
X 		    if (argv[0][2])
X 			Imakefile = argv[0]+2;
X@@ -563,36 +642,32 @@
X }
X 
X char *
X-FindImakefile(Imakefile)
X-	char	*Imakefile;
X+FindImakefile(char *Imakefile)
X {
X 	if (Imakefile) {
X 		if (access(Imakefile, R_OK) < 0)
X 			LogFatal("Cannot find %s.", Imakefile);
X 	} else {
X-		if (access("Imakefile", R_OK) < 0)
X+		if (access("Imakefile", R_OK) < 0) {
X 			if (access("imakefile", R_OK) < 0)
X 				LogFatal("No description file.", "");
X 			else
X 				Imakefile = "imakefile";
X-		else
X+		} else
X 			Imakefile = "Imakefile";
X 	}
X 	return(Imakefile);
X }
X 
X void
X-LogFatalI(s, i)
X-	char *s;
X-	int i;
X+LogFatalI(char *s, int i)
X {
X 	/*NOSTRICT*/
X-	LogFatal(s, (char *)i);
X+	LogFatal(s, (char *)(long)i);
X }
X 
X void
X-LogFatal(x0,x1)
X-	char *x0, *x1;
X+LogFatal(char *x0, char *x1)
X {
X 	static boolean	entered = FALSE;
X 
X@@ -607,8 +682,7 @@
X }
X 
X void
X-LogMsg(x0,x1)
X-	char *x0, *x1;
X+LogMsg(char *x0, char *x1)
X {
X 	int error_number = errno;
X 
X@@ -622,8 +696,7 @@
X }
X 
X void
X-showargs(argv)
X-	char	**argv;
X+showargs(char **argv)
X {
X 	for (; *argv; argv++)
X 		fprintf(stderr, "%s ", *argv);
X@@ -633,8 +706,7 @@
X #define ImakefileCHeader "/* imake - temporary file */"
X 
X void
X-CheckImakefileC(masterc)
X-	char *masterc;
X+CheckImakefileC(char *masterc)
X {
X 	char mkcbuf[1024];
X 	FILE *inFile;
X@@ -661,10 +733,7 @@
X #define OverrideWarning	"Warning: local file \"%s\" overrides global macros."
X 
X boolean
X-optional_include(inFile, defsym, fname)
X-        FILE	*inFile;
X-        char    *defsym;
X-        char    *fname;
X+optional_include(FILE *inFile, char *defsym, char *fname)
X {
X 	errno = 0;
X 	if (access(fname, R_OK) == 0) {
X@@ -676,10 +745,7 @@
X }
X 
X void
X-doit(outfd, cmd, argv)
X-	FILE	*outfd;
X-	char    *cmd;
X-	char	**argv;
X+doit(FILE *outfd, char *cmd, char **argv)
X {
X 	int	pid;
X 	waitType	status;
X@@ -721,11 +787,7 @@
X 
X #ifndef WIN32
X static void
X-parse_utsname(name, fmt, result, msg)
X-     struct utsname *name;
X-     char *fmt;
X-     char *result;
X-     char *msg;
X+parse_utsname(struct utsname *name, char *fmt, char *result, char *msg)
X {
X   char buf[SYS_NMLN * 5 + 1];
X   char *ptr = buf;
X@@ -795,8 +857,7 @@
X  */
X 	
X static char *
X-trim_version(p)
X-	char *p;
X+trim_version(char *p)
X {
X 
X 	if (p != 0 && *p != '\0')
X@@ -809,43 +870,7 @@
X #endif
X 
X #ifdef linux
X-static void get_distrib(inFile)
X-  FILE* inFile;
X-{
X-  struct stat sb;
X-
X-  static char* yast = "/sbin/YaST";
X-  static char* redhat = "/etc/redhat-release";
X-
X-  fprintf (inFile, "%s\n", "#define LinuxUnknown    0");
X-  fprintf (inFile, "%s\n", "#define LinuxSuSE       1");
X-  fprintf (inFile, "%s\n", "#define LinuxCaldera    2");
X-  fprintf (inFile, "%s\n", "#define LinuxCraftworks 3");
X-  fprintf (inFile, "%s\n", "#define LinuxDebian     4");
X-  fprintf (inFile, "%s\n", "#define LinuxInfoMagic  5");
X-  fprintf (inFile, "%s\n", "#define LinuxKheops     6");
X-  fprintf (inFile, "%s\n", "#define LinuxPro        7");
X-  fprintf (inFile, "%s\n", "#define LinuxRedHat     8");
X-  fprintf (inFile, "%s\n", "#define LinuxSlackware  9");
X-  fprintf (inFile, "%s\n", "#define LinuxTurbo      10");
X-  fprintf (inFile, "%s\n", "#define LinuxWare       11");
X-  fprintf (inFile, "%s\n", "#define LinuxYggdrasil  12");
X-
X-  if (lstat (yast, &sb) == 0) {
X-    fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxSuSE");
X-    return;
X-  }
X-  if (lstat (redhat, &sb) == 0) {
X-    fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxRedHat");
X-    return;
X-  }
X-  /* what's the definitive way to tell what any particular distribution is? */
X-
X-  fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxUnknown");
X-  /* would like to know what version of the distribution it is */
X-}
X-
X-static const char *libc_c=
X+const char *libc_c=
X "#include <stdio.h>\n"
X "#include <ctype.h>\n"
X "\n"
X@@ -910,74 +935,106 @@
X "}\n"
X ;
X 
X-static void get_libc_version(inFile)
X-  FILE* inFile;
X+static void
X+get_distrib(FILE *inFile)
X {
X-  static char* libcso = "/usr/lib/libc.so";
X   struct stat sb;
X-  char buf[PATH_MAX];
X-  char* ptr;
X-  int libcmajor, libcminor, libcteeny;
X 
X-  if (lstat (libcso, &sb) == 0) {
X-    if (S_ISLNK (sb.st_mode)) {
X-      /* 
X-       * /usr/lib/libc.so is a symlink -- this is libc 5.x
X-       * we can do this the quick way
X-        */
X-      if (readlink (libcso, buf, PATH_MAX) >= 0) {
X-	for (ptr = buf; *ptr && !isdigit (*ptr); ptr++);
X-	  (void) sscanf (ptr, "%d.%d.%d", &libcmajor, &libcminor, &libcteeny);
X-	  fprintf(inFile, "#define DefaultLinuxCLibMajorVersion %d\n", libcmajor);    
X-	  fprintf(inFile, "#define DefaultLinuxCLibMinorVersion %d\n", libcminor);    
X-	  fprintf(inFile, "#define DefaultLinuxCLibTeenyVersion %d\n", libcteeny);    
X-      }
X-    } else {
X-      /* 
X-       * /usr/lib/libc.so is NOT a symlink -- this is libc 6.x / glibc 2.x
X-       * now we have to figure this out the hard way.
X-       */
X-      char *aout = tmpnam (NULL);
X-      FILE *fp;
X-      const char *format = "%s -o %s -x c -";
X-      char *cc;
X-      int len;
X-      char *command;
X-
X-      cc = getenv ("CC");
X-      if (cc == NULL)
X-	cc = "gcc";
X-      len = strlen (aout) + strlen (format) + strlen (cc);
X-      if (len < 128) len = 128;
X-      command = alloca (len);
X-
X-      if (snprintf (command , len, format, cc, aout) == len)
X-	abort ();
X-
X-      fp = popen (command, "w");
X-      if (fp == NULL || fprintf (fp, "%s\n", libc_c) < 0 || pclose (fp) != 0)
X-	abort ();
X-
X-      fp = popen (aout, "r");
X-      if (fp == NULL)
X-	abort ();
X+  static char* yast = "/sbin/YaST";
X+  static char* redhat = "/etc/redhat-release";
X+  static char* debian = "/etc/debian_version";
X 
X-      while (fgets (command, len, fp))
X-	fprintf (inFile, command);
X-  
X-      len = pclose (fp);
X-      remove (aout);
X-      if (len)
X-	abort ();
X+  fprintf (inFile, "%s\n", "#define LinuxUnknown    0");
X+  fprintf (inFile, "%s\n", "#define LinuxSuSE       1");
X+  fprintf (inFile, "%s\n", "#define LinuxCaldera    2");
X+  fprintf (inFile, "%s\n", "#define LinuxCraftworks 3");
X+  fprintf (inFile, "%s\n", "#define LinuxDebian     4");
X+  fprintf (inFile, "%s\n", "#define LinuxInfoMagic  5");
X+  fprintf (inFile, "%s\n", "#define LinuxKheops     6");
X+  fprintf (inFile, "%s\n", "#define LinuxPro        7");
X+  fprintf (inFile, "%s\n", "#define LinuxRedHat     8");
X+  fprintf (inFile, "%s\n", "#define LinuxSlackware  9");
X+  fprintf (inFile, "%s\n", "#define LinuxTurbo      10");
X+  fprintf (inFile, "%s\n", "#define LinuxWare       11");
X+  fprintf (inFile, "%s\n", "#define LinuxYggdrasil  12");
X+
X+  if (lstat (yast, &sb) == 0) {
X+    fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxSuSE");
X+    fprintf (inFile, "%s\n", "#define DefaultLinuxDistName SuSE");
X+    return;
X+  }
X+  if (lstat (redhat, &sb) == 0) {
X+    fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxRedHat");
X+    fprintf (inFile, "%s\n", "#define DefaultLinuxDistName RedHat");
X+    return;
X+  }
X+  if (lstat (debian, &sb) == 0) {
X+    fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxDebian");
X+    fprintf (inFile, "%s\n", "#define DefaultLinuxDistName Debian");
X+    /* You could also try to get the version of the Debian distrib by looking
X+     * at the content of /etc/debian_version */
X+    return;
X+  }
X+  /* what's the definitive way to tell what any particular distribution is? */
X+
X+  fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxUnknown");
X+  fprintf (inFile, "%s\n", "#define DefaultLinuxDistName Unknown");
X+  /* would like to know what version of the distribution it is */
X+}
X+
X+static void
X+get_libc_version(FILE *inFile)
X+{
X+  char aout[] = "/tmp/imakeXXXXXX";
X+  FILE *fp;
X+  const char *format = "%s -o %s -x c -";
X+  char *cc;
X+  int len;
X+  char *command;
X+
X+  /* Pre-create temp file safely */
X+  {
X+    /* Linux + ELF has mkstemp() */
X+    int tmpfd;
X+    if ((tmpfd = mkstemp(aout)) == -1) {
X+      perror("mkstemp");
X+      abort();
X     }
X+    close(tmpfd);
X   }
X+  cc = getenv ("CC");
X+  if (cc == NULL)
X+    cc = "gcc";
X+  len = strlen (aout) + strlen (format) + strlen (cc);
X+  if (len < 128) len = 128;
X+  command = alloca (len);
X+
X+  if (snprintf (command , len, format, cc, aout) == len)
X+    abort ();
X+
X+  fp = popen (command, "w");
X+  if (fp == NULL || fprintf (fp, "%s\n", libc_c) < 0
X+      || pclose (fp) != 0)
X+    abort ();
X+
X+  fp = popen (aout, "r");
X+  if (fp == NULL)
X+    abort ();
X+
X+  while (fgets (command, len, fp))
X+    fprintf (inFile, command);
X+  
X+  len = pclose (fp);
X+  remove (aout);
X+  if (len)
X+    abort ();
X }
X 
X-static void get_ld_version(inFile)
X-  FILE* inFile;
X+static void
X+get_ld_version(FILE *inFile)
X {
X   FILE* ldprog = popen ("ld -v", "r");
X-  char c;
X+  signed char c;
X   int ldmajor, ldminor;
X 
X   if (ldprog) {
X@@ -986,20 +1043,52 @@
X     } while (c != EOF && !isdigit (c));
X     ungetc (c, ldprog);
X     (void) fscanf (ldprog, "%d.%d", &ldmajor, &ldminor);
X+    /* Start conversion to a more rational number */
X+    if ((ldmajor > 2) || ((ldmajor == 2) && (ldminor > 9)))
X+	ldmajor *= 100;
X+    else
X+	ldmajor *= 10;
X     fprintf(inFile, "#define DefaultLinuxBinUtilsMajorVersion %d\n", 
X-	    ldmajor * 10 + ldminor);    
X+	    ldmajor + ldminor);    
X     pclose (ldprog);
X   }
X }
X #endif
X 
X+#ifdef __FreeBSD__
X+static void
X+get_binary_format(FILE *inFile)
X+{
X+  int mib[2];
X+  size_t len;
X+  int osrel = 0;
X+  FILE *objprog = NULL;
X+  int iself = 0;
X+  char buf[10];
X+
X+  mib[0] = CTL_KERN;
X+  mib[1] = KERN_OSRELDATE;
X+  len = sizeof(osrel);
X+  sysctl(mib, 2, &osrel, &len, NULL, 0);
X+  if (osrel >= 300004 &&
X+      (objprog = popen("objformat", "r")) != NULL &&
X+      fgets(buf, sizeof(buf), objprog) != NULL &&
X+      strncmp(buf, "elf", 3) == 0)
X+    iself = 1;
X+  if (objprog)
X+    pclose(objprog);
X+
X+  fprintf(inFile, "#define DefaultToElfFormat %s\n", iself ? "YES" : "NO");
X+}
X+#endif
X+
X #ifndef PATH_MAX
X #define PATH_MAX 1024
X #endif
X 
X #if defined(sun) && defined(__SVR4)
X-static void get_sun_compiler_versions (inFile)
X-  FILE* inFile;
X+static void
X+get_sun_compiler_versions (FILE *inFile)
X {
X   char buf[PATH_MAX];
X   char cmd[PATH_MAX];
X@@ -1051,11 +1140,28 @@
X }
X #endif
X 
X-static void get_gcc_incdir(inFile)
X-  FILE* inFile;
X+#ifdef __GNUC__
X+static void
X+get_gcc_version(FILE *inFile)
X+{
X+   fprintf (inFile, "#define HasGcc 1\n");
X+#if __GNUC__ > 1
X+   fprintf (inFile, "#define HasGcc2 1\n");
X+#endif
X+   fprintf (inFile, "#define GccMajorVersion %d\n", __GNUC__);
X+   fprintf (inFile, "#define GccMinorVersion %d\n", __GNUC_MINOR__);
X+#if defined(HAS_MERGE_CONSTANTS)
X+   fprintf (inFile, "#define HasGccMergeConstants %d\n", HAS_MERGE_CONSTANTS);
X+#endif
X+}
X+#endif
X+
X+#ifndef __EMX__
X+static void
X+get_gcc_incdir(FILE *inFile)
X {
X   static char* gcc_path[] = {
X-#ifdef linux
X+#if defined(linux) || defined(__OpenBSD__) || defined (__GNU__)
X     "/usr/bin/cc",	/* for Linux PostIncDir */
X #endif
X     "/usr/local/bin/gcc",
X@@ -1084,16 +1190,16 @@
X     }
X   }
X   if (buf[0])
X-    fprintf (inFile, "#define DefaultGccIncludeDir %s\n", buf);
X+    fprintf (inFile, "#define DefaultGccIncludeDir \"%s\"\n", buf);
X }
X+#endif
X 
X boolean
X-define_os_defaults(inFile)
X-	FILE	*inFile;
X+define_os_defaults(FILE *inFile)
X {
X-#ifndef WIN32
X+#if !defined(WIN32) && !defined(__EMX__)
X #if (defined(DEFAULT_OS_NAME) || defined(DEFAULT_OS_MAJOR_REV) || \
X-     defined(DEFAULT_OS_MINOR_REV) || defined(DEFAUL_OS_TEENY_REV))
X+     defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV))
X 	struct utsname name;
X 	char buf[SYS_NMLN * 5 + 1];
X 
X@@ -1101,9 +1207,25 @@
X 	if (uname(&name) < 0)
X 		LogFatal("Cannot invoke uname", "");
X 
X+# ifdef __FreeBSD__
X+	/* Hack for FreeBSD ports "Cross Version" compiling system. */
X+	{
X+	  char *e;
X+	  if ((e = getenv("OSREL")) != NULL && 
X+	      strlen(name.sysname) + strlen(e) + 1 < SYS_NMLN) {
X+	    strcpy(name.release, e);
X+	    strcpy(name.version, name.sysname);
X+	    strcat(name.version, " ");
X+	    strcat(name.version, e);
X+	  }
X+	}
X+# endif	    
X # ifdef DEFAULT_OS_NAME
X 	parse_utsname(&name, DEFAULT_OS_NAME, buf, 
X 		      "Bad DEFAULT_OS_NAME syntax %s");
X+#  ifdef DEFAULT_OS_NAME_FROB
X+	DEFAULT_OS_NAME_FROB(buf, sizeof buf);
X+#  endif
X 	if (buf[0] != '\0')
X 		fprintf(inFile, "#define DefaultOSName %s\n", buf);
X # endif
X@@ -1111,23 +1233,37 @@
X # ifdef DEFAULT_OS_MAJOR_REV
X 	parse_utsname(&name, DEFAULT_OS_MAJOR_REV, buf,
X 		      "Bad DEFAULT_OS_MAJOR_REV syntax %s");
X-	fprintf(inFile, "#define DefaultOSMajorVersion %s\n", 
X+#  ifdef DEFAULT_OS_MAJOR_REV_FROB
X+	DEFAULT_OS_MAJOR_REV_FROB(buf, sizeof buf);
X+#  endif
X+	fprintf(inFile, "#define DefaultOSMajorVersion %s\n",
X 		*buf ? trim_version(buf) : "0");
X # endif
X 
X # ifdef DEFAULT_OS_MINOR_REV
X 	parse_utsname(&name, DEFAULT_OS_MINOR_REV, buf,
X 		      "Bad DEFAULT_OS_MINOR_REV syntax %s");
X-	fprintf(inFile, "#define DefaultOSMinorVersion %s\n", 
X+#  ifdef DEFAULT_OS_MINOR_REV_FROB
X+	DEFAULT_OS_MINOR_REV_FROB(buf, sizeof buf);
X+#  endif
X+	fprintf(inFile, "#define DefaultOSMinorVersion %s\n",
X 		*buf ? trim_version(buf) : "0");
X # endif
X 
X # ifdef DEFAULT_OS_TEENY_REV
X 	parse_utsname(&name, DEFAULT_OS_TEENY_REV, buf,
X 		      "Bad DEFAULT_OS_TEENY_REV syntax %s");
X-	fprintf(inFile, "#define DefaultOSTeenyVersion %s\n", 
X+#  ifdef DEFAULT_OS_TEENY_REV_FROB
X+	DEFAULT_OS_TEENY_REV_FROB(buf, sizeof buf);
X+#  endif
X+	fprintf(inFile, "#define DefaultOSTeenyVersion %s\n",
X 		*buf ? trim_version(buf) : "0");
X # endif
X+# ifdef DEFAULT_MACHINE_ARCHITECTURE
X+	parse_utsname(&name, DEFAULT_MACHINE_ARCHITECTURE, buf, 
X+		      "Bad DEFAULT_MACHINE_ARCHITECTURE %s");
X+	fprintf(inFile, "#ifndef %s\n# define %s\n#endif\n", buf, buf);
X+# endif
X #endif
X #ifdef linux
X     get_distrib (inFile);
X@@ -1138,7 +1274,14 @@
X #if defined (sun) && defined(SVR4)
X     get_sun_compiler_versions (inFile);
X #endif
X+#ifdef __GNUC__
X+    get_gcc_version (inFile);
X+#endif
X+#ifdef __FreeBSD__
X+    get_binary_format(inFile);
X+#endif
X #else /* WIN32 */
X+#ifndef __EMX__
X    OSVERSIONINFO osvi;
X    static char* os_names[] = { "Win32s", "Windows 95", "Windows NT" };
X 
X@@ -1153,17 +1296,18 @@
X    fprintf(inFile, "#define DefaultOSMinorVersion %d\n", osvi.dwMinorVersion);
X    fprintf(inFile, "#define DefaultOSTeenyVersion %d\n", 
X 	   osvi.dwBuildNumber & 0xFFFF);
X+#else /* EMX */
X+   fprintf(inFile, "#define DefaultOSMajorVersion 4\n");
X+   fprintf(inFile, "#define DefaultOSMinorVersion 0\n");
X+   fprintf(inFile, "#define DefaultOSTeenyVersion 0\n");
X+#endif /* EMX */
X #endif /* WIN32 */
X    return FALSE;
X }
X 
X void
X-cppit(imakefile, template, masterc, outfd, outfname)
X-	char	*imakefile;
X-	char	*template;
X-	char	*masterc;
X-	FILE	*outfd;
X-	char	*outfname;
X+cppit(char *imakefile, char *template, char *masterc, 
X+      FILE *outfd, char *outfname)
X {
X 	FILE	*inFile;
X 
X@@ -1191,14 +1335,13 @@
X }
X 
X void
X-makeit()
X+makeit(void)
X {
X 	doit(NULL, make_argv[0], make_argv);
X }
X 
X char *
X-CleanCppInput(imakefile)
X-	char	*imakefile;
X+CleanCppInput(char *imakefile)
X {
X 	FILE	*outFile = NULL;
X 	FILE	*inFile;
X@@ -1252,12 +1395,28 @@
X 		    strcmp(ptoken, "pragma") &&
X 		    strcmp(ptoken, "undef")) {
X 		    if (outFile == NULL) {
X+#ifdef HAS_MKSTEMP
X+		        int fd;
X+#endif
X 			tmpImakefile = Strdup(tmpImakefile);
X-			(void) mktemp(tmpImakefile);
X-			outFile = fopen(tmpImakefile, "w");
X-			if (outFile == NULL)
X+#ifndef HAS_MKSTEMP
X+			if (mktemp(tmpImakefile) == NULL ||
X+			    (outFile = fopen(tmpImakefile, "w+")) == NULL) {
X+			    LogFatal("Cannot open %s for write.",
X+				tmpImakefile);
X+			}
X+#else
X+			fd=mkstemp(tmpImakefile);
X+			if (fd != -1)
X+			    outFile = fdopen(fd, "w");
X+			if (outFile == NULL) {
X+			    if (fd != -1) {
X+			       unlink(tmpImakefile); close(fd);
X+			    }
X 			    LogFatal("Cannot open %s for write.",
X 				tmpImakefile);
X+			}
X+#endif
X 		    }
X 		    writetmpfile(outFile, punwritten, pbuf-punwritten,
X 				 tmpImakefile);
X@@ -1281,9 +1440,7 @@
X }
X 
X void
X-CleanCppOutput(tmpfd, tmpfname)
X-	FILE	*tmpfd;
X-	char	*tmpfname;
X+CleanCppOutput(FILE *tmpfd, char *tmpfname)
X {
X 	char	*input;
X 	int	blankline = 0;
X@@ -1317,10 +1474,9 @@
X  * "XCOMM" token is transformed to "#".
X  */
X boolean
X-isempty(line)
X-	register char	*line;
X+isempty(char *line)
X {
X-	register char	*pend;
X+	char	*pend;
X 
X 	/*
X 	 * Check for lines of the form
X@@ -1391,9 +1547,7 @@
X 
X /*ARGSUSED*/
X char *
X-ReadLine(tmpfd, tmpfname)
X-	FILE	*tmpfd;
X-	char	*tmpfname;
X+ReadLine(FILE *tmpfd, char *tmpfname)
X {
X 	static boolean	initialized = FALSE;
X 	static char	*buf, *pline, *end;
X@@ -1419,7 +1573,7 @@
X 		end = buf + total_red;
X 		*end = '\0';
X 		fseek(tmpfd, 0, 0);
X-#if defined(SYSV) || defined(WIN32)
X+#if defined(SYSV) || defined(WIN32) || defined(USE_FREOPEN)
X 		tmpfd = freopen(tmpfname, "w+", tmpfd);
X #ifdef WIN32
X 		if (! tmpfd) /* if failed try again */
X@@ -1464,19 +1618,14 @@
X }
X 
X void
X-writetmpfile(fd, buf, cnt, fname)
X-	FILE	*fd;
X-	int	cnt;
X-	char	*buf;
X-	char	*fname;
X+writetmpfile(FILE *fd, char *buf, int cnt, char *fname)
X {
X 	if (fwrite(buf, sizeof(char), cnt, fd) == -1)
X 		LogFatal("Cannot write to %s.", fname);
X }
X 
X char *
X-Emalloc(size)
X-	int	size;
X+Emalloc(int size)
X {
X 	char	*p;
X 
X@@ -1487,8 +1636,7 @@
X 
X #ifdef FIXUP_CPP_WHITESPACE
X void
X-KludgeOutputLine(pline)
X-	char	**pline;
X+KludgeOutputLine(char **pline)
X {
X 	char	*p = *pline;
X 	char	quotechar = '\0';
X@@ -1571,17 +1719,16 @@
X }
X 
X void
X-KludgeResetRule()
X+KludgeResetRule(void)
X {
X 	InRule = FALSE;
X }
X #endif /* FIXUP_CPP_WHITESPACE */
X 
X char *
X-Strdup(cp)
X-	register char *cp;
X+Strdup(char *cp)
X {
X-	register char *new = Emalloc(strlen(cp) + 1);
X+	char *new = Emalloc(strlen(cp) + 1);
X 
X 	strcpy(new, cp);
X 	return new;
X
X--- config/imake/imake.man.orig	Tue May 28 05:27:37 2002
X+++ config/imake/imake.man	Fri Aug 16 13:11:40 2002
X@@ -22,11 +22,15 @@
X .\" not be used in advertising or otherwise to promote the sale, use or
X .\" other dealings in this Software without prior written authorization
X .\" from The Open Group.
X-.TH IMAKE 1 "Release 6.1" "X Version 11"
X+.\"
X+.\" $XFree86: xc/config/imake/imake.man,v 1.8 2001/12/14 19:53:19 dawes Exp $
X+.\"
X+.TH IMAKE 1 __xorgversion__
X .SH NAME
X imake \- C preprocessor interface to the make utility
X .SH SYNOPSIS
X \fBimake\fP [ \fB\-D\fP\fIdefine\fP ] [ \fB\-I\fP\fIdir\fP ]
X+[ \fB\-U\fP\fIdefine\fP ] 
X [ \fB\-T\fP\fItemplate\fP ]
X [ \fB\-f\fP \fIfilename\fP ] [ \fB\-C\fP \fIfilename\fP ]
X [ \fB\-s\fP \fIfilename\fP ] [ \fB\-e\fP ]
X@@ -54,6 +58,10 @@
X indicate the directory in which the \fIimake\fP template and configuration
X files may be found.
X .TP 8
X+.B \-U\fIdefine\fP
X+This option is passed directly to \fIcpp\fP.  It is typically used to
X+unset variables when debugging \fIimake\fP configuration files.
X+.TP 8
X .B \-T\fItemplate\fP
X This option specifies the name of the master template file (which is usually
X located in the directory specified with \fI\-I\fP) used by \fIcpp\fP.
X@@ -87,9 +95,9 @@
X following 3 lines:
X .sp
X .nf
X-		#define IMAKE_TEMPLATE "Imake.tmpl"
X-		#define INCLUDE_IMAKEFILE <Imakefile>
X-		#include IMAKE_TEMPLATE
X+\&		#define IMAKE_TEMPLATE "Imake.tmpl"
X+\&		#define INCLUDE_IMAKEFILE <Imakefile>
X+\&		#include IMAKE_TEMPLATE
X .fi
X .sp
X where \fIImake.tmpl\fP and \fIImakefile\fP may be overridden by the 
X@@ -126,8 +134,8 @@
X .ta 1i 1.6i 5i
X .nf
X 
X-#define	program_target(program, objlist)	@@\e
X-program:	objlist		@@\e
X+\& #define	program_target(program, objlist)	@@\e
X+ program:	objlist		@@\e
X 	$(CC)  \-o  $@  objlist  $(LDFLAGS)
X 
X .fi
X@@ -136,7 +144,7 @@
X will expand to
X .nf
X 
X-foo:	foo1.o  foo2.o
X+ foo:	foo1.o  foo2.o
X 	$(CC)  \-o  $@  foo1.o  foo2.o  $(LDFLAGS)
X 
X .fi
X--- config/imake/imakemdep.h.orig	Tue May 28 05:27:37 2002
X+++ config/imake/imakemdep.h	Fri Aug 16 13:11:40 2002
X@@ -24,6 +24,7 @@
X in this Software without prior written authorization from The Open Group.
X 
X */
X+/* $XFree86: xc/config/imake/imakemdep.h,v 3.56 2001/12/14 19:53:19 dawes Exp $ */
X 
X 
X /* 
X@@ -39,6 +40,10 @@
X  *     These will be passed to the compile along with the contents of the
X  *     make variable BOOTSTRAPCFLAGS.
X  */
X+#if defined(clipper) || defined(__clipper__)
X+#define imake_ccflags "-O -DSYSV -DBOOTSTRAPCFLAGS=-DSYSV"
X+#endif
X+
X #ifdef hpux
X #ifdef hp9000s800
X #define imake_ccflags "-DSYSV"
X@@ -64,7 +69,7 @@
X #ifdef imake_ccflags
X #undef imake_ccflags
X #endif
X-#define imake_ccflags "-Dsco"
X+#define imake_ccflags "-Dsco -DSYSV -DSCO -DSCO325"
X #endif
X 
X #ifdef sony
X@@ -122,6 +127,10 @@
X # endif
X #endif
X 
X+#if defined(Lynx) || defined(__Lynx__)
X+#define imake_ccflags "-DLynx"
X+#endif /* Lynx */
X+
X #ifdef __convex__
X #define imake_ccflags "-fn -tm c1"
X #endif
X@@ -162,7 +171,7 @@
X #define imake_ccflags "-DSVR4"
X #endif
X 
X-#ifdef  MACH
X+#if defined(MACH) && !defined(__GNU__)
X #define imake_ccflags "-DNOSTDHDRS"
X #endif
X 
X@@ -171,6 +180,14 @@
X #define imake_ccflags "-DBSD43"
X #endif
X 
X+#if defined(__QNX__) && !defined(__QNXNTO__)
X+#define imake_ccflags "-D__QNX__ -D_i386"
X+#endif
X+
X+#if defined(__QNXNTO__)
X+#define imake_ccflags "-D__QNXNTO__"
X+#endif
X+
X #else /* not CCIMAKE */
X #ifndef MAKEDEPEND
X /*
X@@ -194,7 +211,7 @@
X  *     all colons).  One way to tell if you need this is to see whether or not
X  *     your Makefiles have no tabs in them and lots of @@ strings.
X  */
X-#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || (defined(AMOEBA) && defined(CROSS_COMPILE))
X+#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || (defined(AMOEBA) && defined(CROSS_COMPILE)) || defined(__QNX__) || defined(__sgi)
X #define FIXUP_CPP_WHITESPACE
X #endif
X #ifdef WIN32
X@@ -202,6 +219,18 @@
X #define INLINE_SYNTAX
X #define MAGIC_MAKE_VARS
X #endif
X+#ifdef __minix_vmd
X+#define FIXUP_CPP_WHITESPACE
X+#endif
X+
X+#if defined(Lynx)
X+/* On LynxOS 2.4.0 imake gets built with the old "legacy"
X+ * /bin/cc which has a rather pedantic builtin preprocessor.
X+ * Using a macro which is not #defined (as in Step 5
X+ * below) flags an *error*
X+ */
X+#define __NetBSD_Version__ 0
X+#endif
X 
X /*
X  * Step 4:  USE_CC_E, DEFAULT_CC, DEFAULT_CPP
X@@ -209,6 +238,13 @@
X  *     If use cc -E but want a different compiler, define DEFAULT_CC.
X  *     If the cpp you need is not in /lib/cpp, define DEFAULT_CPP.
X  */
X+#if defined(__APPLE__)
X+#define DEFAULT_CPP "/usr/bin/cpp"
X+#endif
X+#if defined(Lynx) || defined(__Lynx__)
X+#define DEFAULT_CC "gcc"
X+#define USE_CC_E
X+#endif
X #ifdef hpux
X #define USE_CC_E
X #endif
X@@ -219,6 +255,9 @@
X #ifdef apollo
X #define DEFAULT_CPP "/usr/lib/cpp"
X #endif
X+#if defined(clipper) || defined(__clipper__)
X+#define DEFAULT_CPP "/usr/lib/cpp"
X+#endif
X #if defined(_IBMR2) && !defined(DEFAULT_CPP)
X #define DEFAULT_CPP "/usr/ccs/lib/cpp"
X #endif
X@@ -237,13 +276,16 @@
X #ifdef _CRAY
X #define DEFAULT_CPP "/lib/pcpp"
X #endif
X-#if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X+#if defined(__386BSD__)
X #define DEFAULT_CPP "/usr/libexec/cpp"
X #endif
X+#if defined(__FreeBSD__)  || defined(__NetBSD__) || defined(__OpenBSD__)
X+#define USE_CC_E
X+#endif
X #if defined(__sgi) && defined(__ANSI_CPP__)
X #define USE_CC_E
X #endif
X-#ifdef  MACH
X+#if defined(MACH) && !defined(__GNU__)
X #define USE_CC_E
X #endif
X #ifdef __minix_vmd
X@@ -253,7 +295,17 @@
X /* expects cpp in PATH */
X #define DEFAULT_CPP "cpp"
X #endif
X-
X+#ifdef __CYGWIN__
X+#define DEFAULT_CC "gcc"
X+#define DEFAULT_CPP "/usr/bin/cpp"
X+#endif
X+#if defined (__QNX__)
X+#ifdef __QNXNTO__
X+#define DEFAULT_CPP "/usr/bin/cpp"
X+#else
X+#define DEFAULT_CPP "/usr/X11R6/bin/cpp"
X+#endif
X+#endif
X /*
X  * Step 5:  cpp_argv
X  *     The following table contains the flags that should be passed
X@@ -275,13 +327,63 @@
X char *cpp_argv[ARGUMENTS] = {
X 	"cc",		/* replaced by the actual program to exec */
X 	"-I.",		/* add current directory to include path */
X+#if !defined(__NetBSD_Version__) || __NetBSD_Version__ < 103080000
X #ifdef unix
X 	"-Uunix",	/* remove unix symbol so that filename unix.c okay */
X #endif
X-#if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(MACH)
X+#endif
X+#if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(MACH) || defined(linux) || defined(__GNU__) || defined(__bsdi__)
X # ifdef __i386__
X 	"-D__i386__",
X # endif
X+# ifdef __i486__
X+	"-D__i486__",
X+# endif
X+# ifdef __i586__
X+	"-D__i586__",
X+# endif
X+# ifdef __i686__
X+	"-D__i686__",
X+# endif
X+# ifdef __k6__
X+	"-D__k6__",
X+# endif
X+# ifdef __ia64__
X+	"-D__ia64__",
X+# endif
X+# ifdef __s390__
X+	"-D__s390__",
X+# endif
X+# ifdef __alpha__
X+	"-D__alpha__",
X+# endif
X+# ifdef __arm__
X+	"-D__arm__",
X+# endif
X+# ifdef __s390x__
X+       "-D__s390x__",
X+# endif
X+# ifdef __sparc__
X+	"-D__sparc__",
X+# endif
X+# ifdef __m68k__
X+	"-D__m68k__",
X+# endif
X+# ifdef __sh__
X+	"-D__sh__",
X+# endif
X+# ifdef __sh3__
X+	"-D__sh3__",
X+# endif
X+# ifdef __SH3__
X+	"-D__SH3__",
X+# endif
X+# ifdef __SH4__
X+	"-D__SH4__",
X+# endif
X+# ifdef __SH4NOFPU__
X+	"-D__SH4_NOFPU__",
X+# endif
X # ifdef __GNUC__
X 	"-traditional",
X # endif
X@@ -356,9 +458,7 @@
X #endif /* MOTOROLA */
X #if defined(M_UNIX) || defined(sco)
X 	"-Dsco",
X-# if defined(sco324)
X-	"-Dsco324",
X-# endif
X+	"-DSYSV",
X #endif
X #ifdef i386
X 	"-Di386",
X@@ -385,59 +485,56 @@
X #  endif
X #  ifdef SCO
X 	"-DSCO",
X-#   ifdef SCO324
X-	"-DSCO324",
X+#   ifdef _SCO_DS
X+    "-DSCO325",
X #   endif
X #  endif
X-#  ifdef ESIX
X+# endif
X+# ifdef ESIX
X 	"-DESIX",
X-#  endif
X-#  ifdef ATT
X+# endif
X+# ifdef ATT
X 	"-DATT",
X-#  endif
X-#  ifdef DELL
X+# endif
X+# ifdef DELL
X 	"-DDELL",
X-#  endif
X # endif
X #endif
X-#ifdef SYSV386		/* System V/386 folks, obsolete */
X+#ifdef SYSV386           /* System V/386 folks, obsolete */
X 	"-Di386",
X # ifdef SVR4
X 	"-DSVR4",
X # endif
X-# ifdef SYSV
X-	"-DSYSV",
X-#  ifdef ISC
X+# ifdef ISC
X 	"-DISC",
X-#   ifdef ISC40
X+#  ifdef ISC40
X 	"-DISC40",       /* ISC 4.0 */
X-#   else
X-#    ifdef ISC202
X+#  else
X+#   ifdef ISC202
X 	"-DISC202",      /* ISC 2.0.2 */
X-#    else
X-#     ifdef ISC30
X+#   else
X+#    ifdef ISC30
X 	"-DISC30",       /* ISC 3.0 */
X-#     else
X+#    else
X 	"-DISC22",       /* ISC 2.2.1 */
X-#     endif
X #    endif
X #   endif
X #  endif
X-#  ifdef SCO
X+# endif
X+# ifdef SCO
X 	"-DSCO",
X-#   ifdef SCO324
X-	"-DSCO324",
X-#   endif
X+#  ifdef _SCO_DS
X+	"-DSCO325",
X #  endif
X-#  ifdef ESIX
X+# endif
X+# ifdef ESIX
X 	"-DESIX",
X-#  endif
X-#  ifdef ATT
X+# endif
X+# ifdef ATT
X 	"-DATT",
X-#  endif
X-#  ifdef DELL
X+# endif
X+# ifdef DELL
X 	"-DDELL",
X-#  endif
X # endif
X #endif
X #ifdef __osf__
X@@ -448,6 +545,12 @@
X # ifdef __alpha
X 	"-D__alpha",
X # endif
X+# ifdef __amiga__
X+	"-D__amiga__",
X+# endif
X+# ifdef __alpha__
X+	"-D__alpha__",
X+# endif
X # ifdef __i386__
X 	"-D__i386__",
X # endif
X@@ -475,9 +578,28 @@
X 	"-DNCR",	/* NCR */
X #endif
X #ifdef linux
X-        "-traditional",
X         "-Dlinux",
X #endif
X+#if defined(__CYGWIN__)
X+        "-traditional",
X+#endif
X+#if defined(Lynx) || defined(__Lynx__)
X+        "-traditional",
X+#if 0
X+        "-DLYNX",		/* do we really need this?? */
X+#endif
X+	"-DLynx",
X+# ifdef ppc
X+	"-Dppc",
X+# endif
X+# if defined(m68k)  || defined(M68k) || defined(m68040)
X+	"-Dm68k",
X+	"-DM68k",
X+# endif
X+# ifdef uSPARC1
X+	"-Dsparc",
X+# endif
X+#endif
X #ifdef __uxp__
X 	"-D__uxp__",
X #endif
X@@ -492,13 +614,13 @@
X # ifdef CROSS_COMPILE
X 	"-DCROSS_COMPILE",
X #  ifdef CROSS_i80386
X-	"-DCROSS_i80386",
X+	"-Di80386",
X #  endif
X #  ifdef CROSS_sparc
X-	"-DCROSS_sparc",
X+	"-Dsparc",
X #  endif
X #  ifdef CROSS_mc68000
X-	"-DCROSS_mc68000",
X+	"-Dmc68000",
X #  endif
X # else
X #  ifdef i80386
X@@ -523,6 +645,50 @@
X 	"-traditional",
X 	"-Demxos2",
X #endif
X+#ifdef MetroLink
X+	"-DMetroLink",
X+# ifdef SVR4
X+	"-DSVR4",
X+# endif
X+# ifdef __powerpc__
X+	"-D__powerpc__",
X+# endif
X+# ifdef PowerMAX_OS
X+	"-DPowerMAX_OS",
X+# endif
X+#endif
X+#if defined (__QNX__) && !defined(__QNXNTO__)
X+        "-traditional",
X+        "-D__QNX__",
X+#endif
X+
X+#if defined(__QNXNTO__)
X+        "-traditional",
X+        "-D__QNXNTO__",
X+#if defined(i386)
X+        "-Di386",
X+#endif
X+#if defined(__i386__)
X+        "-D__i386__",
X+#endif
X+#if defined(PPC)
X+        "-DPPC",
X+#endif
X+#if defined(MIPS)
X+        "-DMIPS",
X+#endif
X+#endif
X+
X+#if defined(__APPLE__)
X+        "-D__APPLE__",
X+        "-D__DARWIN__",
X+# ifdef __ppc__
X+        "-D__ppc__",
X+# endif
X+# ifdef __i386__
X+        "-D__i386__",
X+# endif
X+#endif
X 
X };
X 
X@@ -537,6 +703,10 @@
X  *	Supported uname arguments are "snrvm", and if you specify multiple
X  *	arguments they will be separated by spaces.  No more than 5 arguments
X  *	may be given.  Unlike uname() order of arguments matters.
X+ *
X+ *	DEFAULT_OS_MAJOR_REV_FROB, DEFAULT_OS_MINOR_REV_FROB,
X+ *	DEFAULT_OS_TEENY_REV_FROB, and DEFAULT_OS_NAME_FROB can be used to
X+ *	modify the results of the use of the various strings.
X  */
X #if defined(aix)
X /* uname -v returns "x" (e.g. "4"), and uname -r returns "y" (e.g. "1") */
X@@ -544,7 +714,7 @@
X # define DEFAULT_OS_MINOR_REV	"r %[0-9]"
X /* No information available to generate default OSTeenyVersion value. */
X # define DEFAULT_OS_NAME	"srvm %[^\n]"
X-#elif defined(sun) || defined(sgi) || defined(ultrix) || defined(__uxp__) || defined(linux) || defined(sony)
X+#elif defined(sun) || defined(sgi) || defined(ultrix) || defined(__uxp__) || defined(sony)
X /* uname -r returns "x.y[.z]", e.g. "5.4" or "4.1.3" */
X # define DEFAULT_OS_MAJOR_REV	"r %[0-9]"
X # define DEFAULT_OS_MINOR_REV	"r %*d.%[0-9]"
X@@ -562,6 +732,12 @@
X # define DEFAULT_OS_MINOR_REV	"v %*d.%1s"
X # define DEFAULT_OS_TEENY_REV	"v %*d.%*c%[.0-9]"
X # define DEFAULT_OS_NAME	"srvm %[^\n]"
X+#elif defined(__APPLE__)
X+/* uname -v returns "x.yz" or "x.y.z", e.g. "2.02" or "2.1.2". */
X+# define DEFAULT_OS_MAJOR_REV	"r %[0-9]"
X+# define DEFAULT_OS_MINOR_REV	"r %*d.%[0-9]"
X+# define DEFAULT_OS_TEENY_REV	"r %*d.%*d.%[0-9]" /* this will just get 0 */
X+# define DEFAULT_OS_NAME	"s %[^\n]"
X #elif defined(__osf__)
X /* uname -r returns "Wx.y", e.g. "V3.2" or "T4.0" */
X # define DEFAULT_OS_MAJOR_REV	"r %*[^0-9]%[0-9]"
X@@ -573,13 +749,97 @@
X # define DEFAULT_OS_MAJOR_REV	"v V%[0-9]"
X # define DEFAULT_OS_MINOR_REV	"v V%*dL%[0-9]"
X # define DEFAULT_OS_NAME	"srvm %[^\n]"
X-#elif defined(__FreeBSD__)
X-/* NetBSD, OpenBSD, 386BSD, and BSD/OS too? */
X+#elif defined(linux) || defined(__bsdi__)
X+# define DEFAULT_OS_MAJOR_REV	"r %[0-9]"
X+# define DEFAULT_OS_MINOR_REV	"r %*d.%[0-9]"
X+# define DEFAULT_OS_TEENY_REV	"r %*d.%*d.%[0-9]"
X+# define DEFAULT_OS_NAME	"srm %[^\n]"
X+#elif defined(__GNU__)
X+# define DEFAULT_OS_MAJOR_REV	"r %[0-9]"
X+# define DEFAULT_OS_MINOR_REV	"r %*d.%[0-9]"
X+# define DEFAULT_OS_NAME	"srm %[^\n]"
X+#elif defined(ISC)
X+/* ISC all Versions ? */
X+/* uname -r returns "x.y", e.g. "3.2" ,uname -v returns "x" e.g. "2" */
X+# define DEFAULT_OS_MAJOR_REV   "r %[0-9]"
X+# define DEFAULT_OS_MINOR_REV   "r %*d.%[0-9]"
X+# define DEFAULT_OS_TEENY_REV   "v %[0-9]" 
X+/* # define DEFAULT_OS_NAME        "srm %[^\n]" */ /* Not useful on ISC */
X+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
X+/* BSD/OS too? */
X /* uname -r returns "x.y[.z]-mumble", e.g. "2.1.5-RELEASE" or "2.2-0801SNAP" */
X # define DEFAULT_OS_MAJOR_REV   "r %[0-9]"
X # define DEFAULT_OS_MINOR_REV   "r %*d.%[0-9]"
X # define DEFAULT_OS_TEENY_REV   "r %*d.%*d.%[0-9]" 
X # define DEFAULT_OS_NAME        "srm %[^\n]"
X+# if defined(__FreeBSD__)
X+/* Use an alternate way to find the teeny version for -STABLE, -SNAP versions */
X+#  define DEFAULT_OS_TEENY_REV_FROB(buf, size)				\
X+    do {								\
X+	if (*buf == 0) {						\
X+		int __mib[2];						\
X+		size_t __len;						\
X+		int __osrel;						\
X+									\
X+		__mib[0] = CTL_KERN;					\
X+		__mib[1] = KERN_OSRELDATE;				\
X+		__len = sizeof(__osrel);				\
X+		sysctl(__mib, 2, &__osrel, &__len, NULL, 0);		\
X+		if (__osrel < 210000) {					\
X+			if (__osrel < 199607)				\
X+				buf[0] = '0';				\
X+			else if (__osrel < 199612)			\
X+				buf[0] = '5';				\
X+			else if (__osrel == 199612)			\
X+				buf[0] = '6';				\
X+			else						\
X+				buf[0] = '8'; /* guess */		\
X+		} else {						\
X+			buf[0] = ((__osrel / 1000) % 10) + '0';		\
X+		}							\
X+		buf[1] = 0;						\
X+	}								\
X+    } while (0)
X+# else
X+   /* OpenBSD - Add DEFAULT_MACHINE_ARCHITECTURE */
X+#  define DEFAULT_MACHINE_ARCHITECTURE "m %[^\n]"
X+# endif
X+#elif defined(__NetBSD__)
X+/*
X+ * uname -r returns "x.y([ABCD...]|_mumble)", e.g.:
X+ *	1.2	1.2_BETA	1.2A	1.2B
X+ *
X+ * That means that we have to do something special to turn the
X+ * TEENY revision into a form that we can use (i.e., a string of
X+ * decimal digits).
X+ *
X+ * We also frob the name DEFAULT_OS_NAME so that it looks like the
X+ * 'standard' NetBSD name for the version, e.g. "NetBSD/i386 1.2B" for
X+ * NetBSD 1.2B on an i386.
X+ */
X+# define DEFAULT_OS_MAJOR_REV   "r %[0-9]"
X+# define DEFAULT_OS_MINOR_REV   "r %*d.%[0-9]"
X+# define DEFAULT_OS_TEENY_REV   "r %*d.%*d%[A-Z]" 
X+# define DEFAULT_OS_TEENY_REV_FROB(buf, size)				\
X+    do {								\
X+	if (*(buf) >= 'A' && *(buf) <= 'Z') /* sanity check */		\
X+		snprintf((buf), (size), "%d", *(buf) - 'A' + 1);	\
X+	else								\
X+	    *(buf) = '\0';						\
X+    } while (0)
X+# define DEFAULT_OS_NAME        "smr %[^\n]"
X+# define DEFAULT_OS_NAME_FROB(buf, size)				\
X+    do {								\
X+	char *__sp;							\
X+	if ((__sp = strchr((buf), ' ')) != NULL)			\
X+		*__sp = '/';						\
X+    } while (0)
X+#elif defined(__Lynx__) || defined(Lynx)
X+/* Lynx 2.4.0 /bin/cc doesn't like #elif */
X+# define DEFAULT_OS_MAJOR_REV   "r %[0-9]"
X+# define DEFAULT_OS_MINOR_REV   "r %*d.%[0-9]"
X+# define DEFAULT_OS_TEENY_REV   "r %*d.%*d.%[0-9]" 
X+# define DEFAULT_OS_NAME        "srm %[^\n]"
X #elif defined(_SEQUENT_)
X /* uname -v returns 'Vx.y.z', e.g. 'V4.4.2' */
X # define DEFAULT_OS_MAJOR_REV	"v V%[0-9]"
X@@ -599,6 +859,12 @@
X #ifdef apollo
X 	{"apollo", "1"},
X #endif
X+#if defined(clipper) || defined(__clipper__)
X+	{"clipper", "1"},
X+	{"__clipper__", "1"},
X+	{"clix", "1"},
X+	{"__clix__", "1"},
X+#endif
X #ifdef ibm032
X 	{"ibm032", "1"},
X #endif
X@@ -675,7 +941,14 @@
X 	{"mc68020", "1"},
X #endif
X #ifdef __GNUC__
X+# if __GNUC__ == 1
X 	{"__GNUC__", "1"},
X+# else
X+	{"__GNUC__", "2"},
X+# endif
X+#endif
X+#ifdef __STRICT_ANSI__
X+	{"__STRICT_ANSI__", "1"},
X #endif
X #if __STDC__
X 	{"__STDC__", "1"},
X@@ -713,6 +986,12 @@
X #ifdef m68k
X         {"m68k", "1"},
X #endif
X+#ifdef M68k
X+        {"M68k", "1"},
X+#endif
X+#ifdef __m68k__
X+	{"__m68k__", "1"},
X+#endif
X #ifdef m88k
X         {"m88k", "1"},
X #endif
X@@ -740,9 +1019,15 @@
X #ifdef __osf__
X 	{"__osf__", "1"},
X #endif
X+#ifdef __amiga__
X+	{"__amiga__", "1"},
X+#endif
X #ifdef __alpha
X 	{"__alpha", "1"},
X #endif
X+#ifdef __alpha__
X+	{"__alpha__", "1"},
X+#endif
X #ifdef __DECC
X 	{"__DECC",  "1"},
X #endif
X@@ -804,9 +1089,92 @@
X #ifdef __NetBSD__
X 	{"__NetBSD__", "1"},
X #endif
X+#ifdef __GNU__
X+	{"__GNU__", "1"},
X+#endif
X+#ifdef __ELF__
X+	{"__ELF__", "1"},
X+#endif
X #ifdef __EMX__
X 	{"__EMX__", "1"},
X #endif
X+#if defined(__QNX__)
X+        {"__QNX__", "1"},
X+#endif
X+#ifdef __QNXNTO__
X+        {"__QNXNTO__", "1"},
X+#endif
X+# ifdef __powerpc__
X+	{"__powerpc__", "1"},
X+# endif
X+# ifdef PowerMAX_OS
X+	{"PowerMAX_OS", "1"},
X+# endif
X+# ifdef ia64
X+	{"ia64", "1"},
X+# endif
X+# ifdef __ia64__
X+	{"__ia64__", "1"},
X+# endif
X+# ifdef __i386__
X+	{"__i386__", "1"},
X+# endif
X+# ifdef __i486__
X+	{"__i486__", "1"},
X+# endif
X+# ifdef __i586__
X+	{"__i586__", "1"},
X+# endif
X+# ifdef __i686__
X+	{"__i686__", "1"},
X+# endif
X+# ifdef __k6__
X+	{"__k6__", "1"},
X+# endif
X+# ifdef i386
X+	{"i386", "1"},
X+# endif
X+# ifdef i486
X+	{"i486", "1"},
X+# endif
X+# ifdef i586
X+	{"i586", "1"},
X+# endif
X+# ifdef i686
X+	{ "i686", "1"},
X+# endif
X+# ifdef k6
X+	{"k6", "1"},
X+# endif
X+# ifdef __s390__
X+	{"__s390__", "1"},
X+# endif
X+# ifdef __sh__
X+	{"__sh__", "1"},
X+# endif
X+# ifdef __sh3_
X+	{"__sh3__", "1"},
X+# endif
X+# ifdef __SH3__
X+	{"__SH3__", "1"},
X+# endif
X+# ifdef __SH4__
X+	{"__SH4__", "1"},
X+# endif
X+# ifdef __SH4NOFPU__
X+	{"__SH4NOFPU__", "1"},
X+# endif
X+#if defined(__ppc__)
X+        {"__ppc__", "1"},
X+#endif
X+#if defined(__BIG_ENDIAN__)
X+      {"__BIG_ENDIAN__", "1"},
X+#endif
X+#if defined(__LITTLE_ENDIAN__)
X+      {"__LITTLE_ENDIAN__", "1"},
X+#endif
X+
X+
X 	/* add any additional symbols before this line */
X 	{NULL, NULL}
X };
END-of-Mozdev-PrintServer/files/patch-ab
echo x - Mozdev-PrintServer/files/patch-ac
sed 's/^X//' >Mozdev-PrintServer/files/patch-ac << 'END-of-Mozdev-PrintServer/files/patch-ac'
X--- Imakefile.orig	Fri Aug 16 18:11:37 2002
X+++ Imakefile	Fri Aug 16 18:09:29 2002
X@@ -37,6 +37,13 @@
X 	MakeDir($(BUILDINCDIR))
X 	MakeDir($(BUILDBINDIR))
X 
X+installXprt::
X+	(cd programs/Xserver && \
X+	  $(INSTALL) -c $(INSTALLFLAGS) $(INSTPGMFLAGS) Xprt $(DESTDIR)$(BINDIR)/Xprt)
X+
X+NOOP:
X+	@echo :
X+
X XCOMM
X XCOMM Watch out!!!  Make sure you do make includes after removing X11....
X XCOMM
END-of-Mozdev-PrintServer/files/patch-ac
echo x - Mozdev-PrintServer/files/patch-aa
sed 's/^X//' >Mozdev-PrintServer/files/patch-aa << 'END-of-Mozdev-PrintServer/files/patch-aa'
X--- config/cf/site.def.orig	Wed Jul 10 19:40:05 2002
X+++ config/cf/site.def	Fri Aug 16 14:03:50 2002
X@@ -1,15 +1,20 @@
X /* Some flags to build the Xprint server (Xprt), the tools and the fonts */
X #define BuildServer  YES
X #define XprtServer   YES
X+#define PrintOnlyServer YES
X+#define XpColorPclDDX	YES
X+#define XpMonoPclDDX	YES
X+#define	XpPostScriptDDX	YES
X #define XpRasterDDX  YES
X #define XpPdfDDX     NO
X #define XpSvgDDX     NO
X-#define BuildFonts   YES
X-#define BuildType1   YES
X+#define BuildFonts   NO
X+#define BuildType1   NO
X /* Build PS CID font support */
X-#define BuildCID     YES
X+#define BuildCID     NO
X #define GzipFontCompression YES
X-#define BuildFreeType YES
X+/* Xprt does not support TTF fonts yet */
X+#define BuildFreeType NO
X /* Xprt does not have special support for XIE (yet) */
X #define BuildXIE NO
X /* Xprt does not support MIT-SHM */
END-of-Mozdev-PrintServer/files/patch-aa
echo x - Mozdev-PrintServer/files/patch-ae
sed 's/^X//' >Mozdev-PrintServer/files/patch-ae << 'END-of-Mozdev-PrintServer/files/patch-ae'
X--- Makefile.orig	Tue May 28 05:27:34 2002
X+++ Makefile	Fri Aug 16 19:17:41 2002
X@@ -155,3 +155,5 @@
X 	    $(MAKE_CMD) $@
X VerifyOS:
X 	    $(MAKE_CMD) $@
X+installXprt:
X+	    $(MAKE_CMD) $@
END-of-Mozdev-PrintServer/files/patch-ae
echo x - Mozdev-PrintServer/distinfo
sed 's/^X//' >Mozdev-PrintServer/distinfo << 'END-of-Mozdev-PrintServer/distinfo'
XMD5 (xprint-mozdev/xprint_mozdev_org_source-2002-07-10-trunk.tar.gz) = 7096e01f13b37f9669d8b0a2357d04c0
END-of-Mozdev-PrintServer/distinfo
exit



>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208190711.g7J7BcaN000853>