diff -Naur xemacs-21.2.44-old/configure xemacs-21.2.44/configure --- xemacs-21.2.44-old/configure Thu Feb 8 06:24:24 2001 +++ xemacs-21.2.44/configure Sat Mar 24 22:51:54 2001 @@ -1290,6 +1290,15 @@ case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac ;; + *-*-darwin* ) + opsys=darwin + RANLIB='ranlib -c' + case "$canonical" in + powerpc-*-darwin*) machine=powermacintosh ;; + i?86-*-darwin*) machine=intel386 ;; + esac + ;; + orion-orion-bsd* ) machine=orion opsys=bsd4-2 ;; clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;; diff -Naur xemacs-21.2.44-old/configure.in xemacs-21.2.44/configure.in --- xemacs-21.2.44-old/configure.in Thu Feb 8 06:24:28 2001 +++ xemacs-21.2.44/configure.in Sat Mar 24 22:51:54 2001 @@ -1272,6 +1272,16 @@ case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac ;; + dnl Darwin / Mac OS X + *-*-darwin*) + opsys=darwin + RANLIB='ranlib -c' + case "$canonical" in + powerpc-*-darwin*) machine=powermacintosh ;; + i?86-*-darwin*) machine=intel386 ;; + esac + ;; + dnl Orion machines orion-orion-bsd* ) machine=orion opsys=bsd4-2 ;; clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;; diff -Naur xemacs-21.2.44-old/src/emacs.c xemacs-21.2.44/src/emacs.c --- xemacs-21.2.44-old/src/emacs.c Sun Jan 28 08:43:45 2001 +++ xemacs-21.2.44/src/emacs.c Sat Mar 24 22:51:40 2001 @@ -849,9 +849,6 @@ int skip_args = 0; Lisp_Object load_me; int inhibit_window_system; -#ifdef NeXT - extern int malloc_cookie; -#endif #if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK) \ && !defined (DOUG_LEA_MALLOC)) @@ -866,19 +863,6 @@ noninteractive = 0; -#ifdef NeXT - /* 19-Jun-1995 -baw - * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman - * . Note that even Carl doesn't know what this - * does; it was provided by NeXT, and it presumable makes NS's mallocator - * work with dumping. But malloc_jumpstart() and malloc_freezedry() in - * unexnext.c are both completely undocumented, even in NS header files! - * But hey, it solves all NS related memory problems, so who's - * complaining? */ - if (initialized && malloc_jumpstart (malloc_cookie) != 0) - stderr_out ("malloc jumpstart failed!\n"); -#endif /* NeXT */ - /* #if defined (GNU_MALLOC) && \ defined (ERROR_CHECK_MALLOC) && \ @@ -2594,6 +2578,10 @@ of the XEmacs binary we are running. This can now be used in a definite test for out of date dumped files. -slb */ int restarted = 0; +#if !defined(PDUMP) && (defined(NeXT) || defined(DARWIN)) + extern int malloc_cookie; +#endif + #ifdef QUANTIFY quantify_stop_recording_data (); quantify_clear_data (); @@ -2608,6 +2596,22 @@ #ifdef LINUX_SBRK_BUG sbrk (1); #endif + +#if !defined(PDUMP) && (defined(NeXT) || defined(DARWIN)) + /* 19-Jun-1995 -baw + * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman + * . Note that even Carl doesn't know what this + * does; it was provided by NeXT, and it presumable makes NS's mallocator + * work with dumping. But malloc_jumpstart() and malloc_freezedry() in + * unexnext.c are both completely undocumented, even in NS header files! + * But hey, it solves all NS related memory problems, so who's + * complaining? */ + if (initialized && malloc_jumpstart (malloc_cookie) != 0) + { + stderr_out("malloc jumpstart failed!\n"); + abort(); + } +#endif /* NeXT || DARWIN */ if (!initialized) { diff -Naur xemacs-21.2.44-old/src/lisp.h xemacs-21.2.44/src/lisp.h --- xemacs-21.2.44-old/src/lisp.h Wed Jan 31 12:25:16 2001 +++ xemacs-21.2.44/src/lisp.h Sat Mar 24 22:51:44 2001 @@ -2254,6 +2254,8 @@ #ifdef HAVE_INTTYPES_H #include +#elif defined(DARWIN_INTPTR_T) +/* Darwin automatically defines these types, but not in inttypes.h */ #elif SIZEOF_VOID_P == SIZEOF_INT typedef int intptr_t; typedef unsigned int uintptr_t; diff -Naur xemacs-21.2.44-old/src/m/powermacintosh.h xemacs-21.2.44/src/m/powermacintosh.h --- xemacs-21.2.44-old/src/m/powermacintosh.h Wed Dec 31 16:00:00 1969 +++ xemacs-21.2.44/src/m/powermacintosh.h Sat Mar 24 22:51:37 2001 @@ -0,0 +1,45 @@ +/* Apple Power Macintosh machine/system dependent defines + Copyright (C) 1997 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +/* The following line tells the configuration script what sort of + operating system this machine is likely to run. + USUAL-OPSYS="darwin" */ + +/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word + is the most significant byte. */ + +#define WORDS_BIG_ENDIAN + +/* Define NO_ARG_ARRAY if you cannot take the address of the first of a + * group of arguments and treat it as an array of the arguments. */ + +#define NO_ARG_ARRAY + +/* Use type int rather than a union, to represent Lisp_Object */ +/* This is desirable for most machines. */ + +#define NO_UNION_TYPE + +/* Define addresses, macros, change some setup for dump */ + +#define NO_REMAP + +#define DATA_SEG_BITS 0 diff -Naur xemacs-21.2.44-old/src/s/darwin.h xemacs-21.2.44/src/s/darwin.h --- xemacs-21.2.44-old/src/s/darwin.h Wed Dec 31 16:00:00 1969 +++ xemacs-21.2.44/src/s/darwin.h Sat Mar 24 22:51:36 2001 @@ -0,0 +1,97 @@ +/* Configuration file for Darwin OS. + Copyright (C) 1997 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* We give these symbols the numeric values found in to + avoid warnings about redefined macros. */ +#define BSD 199506 +#define BSD4_3 1 +#define BSD4_4 1 + +#include "bsd4-3.h" + +/* SYSTEM_TYPE should indicate the kind of system you are using. + It sets the Lisp variable system-type. We'll need to undo the bsd one. */ + +#undef SYSTEM_TYPE +#define SYSTEM_TYPE "darwin" + +#ifndef DARWIN +#define DARWIN +#endif + +#define DARWIN_INTPTR_T + +#undef KERNEL_FILE +#define KERNEL_FILE "/mach_kernel" + +#define HAVE_ALLOCA + +#ifndef HAVE_MACH_MACH_H +#define HAVE_MACH_MACH_H +#endif + +#define SYSTEM_MALLOC + +#define WAIT_USE_INT + +#define SOCKLEN_TYPE int + +#define GETPGRP_NO_ARG + +#define TERMCAP_FILE "/usr/share/misc/termcap" + +#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) + +#define A_OUT_H_FILE + +#define UNEXEC unexdyld.o + +/* Definitions for how to compile & link. */ + +/* Link this program just by running cc. */ +#define ORDINARY_LINK + +/* #define C_SWITCH_SYSTEM */ + +/* We don't have a g library, so override the -lg LIBS_DEBUG switch */ +#define LIBS_DEBUG + +/* Adding -lm confuses the dynamic linker, so omit it. */ +#define LIB_MATH + +/* Definitions for how to dump. */ + +#define START_FILES pre-crt0.o + +/* start_of_text isn't actually used, so make it compile without error. */ +#define TEXT_START (0) + +#ifndef NOT_C_CODE +extern unsigned long get_etext(void); +extern unsigned long get_edata(void); +#endif + +/* This seems to be right for end_of_text, but it may not be used anyway. */ +#define TEXT_END get_etext() + +/* This seems to be right for end_of_data, but it may not be used anyway. */ +#define DATA_END get_edata() + +#define TAB3 OXTABS