From bab9733f2f9af33981c9bcb0c518d6c8ba05a8c1 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Wed, 13 Jul 2005 13:40:57 +0000
Subject: [PATCH] Build support for FreeBSD, based on patches from Eduardo
 Munoz.

code/bsd-os.lisp:
o Automatically define :freebsd4 and :elf, if compiling lisp has them
  defined.

tools/create-target.sh:
o Support FreeBSD.

tools/setenv-scripts/freebsd-features.lisp:
o New file with default (commented out) example for FreeBSD.
---
 code/bsd-os.lisp                           | 7 ++++++-
 tools/create-target.sh                     | 7 +++++++
 tools/setenv-scripts/freebsd-features.lisp | 9 +++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 tools/setenv-scripts/freebsd-features.lisp

diff --git a/code/bsd-os.lisp b/code/bsd-os.lisp
index dd9eee4d5..1b7309800 100644
--- a/code/bsd-os.lisp
+++ b/code/bsd-os.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/bsd-os.lisp,v 1.7 2004/07/25 19:32:37 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/bsd-os.lisp,v 1.8 2005/07/13 13:40:55 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -31,6 +31,11 @@
 		       #+Darwin :Darwin
 		       #-(or FreeBSD NetBSD OpenBSD Darwin) :bsd)
 
+#+freebsd4
+(register-lisp-feature :freebsd4)
+#+elf
+(register-lisp-feature :elf)
+
 (setq *software-type* #+OpenBSD "OpenBSD"
                       #+NetBSD "NetBSD"
                       #+FreeBSD "FreeBSD"
diff --git a/tools/create-target.sh b/tools/create-target.sh
index 5fc06f13b..859698421 100755
--- a/tools/create-target.sh
+++ b/tools/create-target.sh
@@ -117,6 +117,13 @@ case $LISP_VARIANT in
       esac
       sed "s;@@gcname@@;$gcname;" $SETENV/openbsd-features.lisp >> $TARGET/setenv.lisp
       ;;
+  *FreeBSD*)
+      case $LISP_VARIANT in
+        *_gencgc*) gcname=":gencgc" ;;
+	*) gcname=":cgc" ;;
+      esac
+      sed "s;@@gcname@@;$gcname;" $SETENV/freebsd-features.lisp >> $TARGET/setenv.lisp
+      ;;
   *solaris*)
       cat $SETENV/solaris-features.lisp >> $TARGET/setenv.lisp
       ;;
diff --git a/tools/setenv-scripts/freebsd-features.lisp b/tools/setenv-scripts/freebsd-features.lisp
new file mode 100644
index 000000000..6b35514dd
--- /dev/null
+++ b/tools/setenv-scripts/freebsd-features.lisp
@@ -0,0 +1,9 @@
+;; e.g. for FreeBSD on x86 you probably want:
+;;(pushnew :freebsd4 *features*)
+;;(pushnew :freebsd *features*)
+;;(pushnew :elf *features*)
+
+;; We can't really do this before adding #+freebsd5 reader
+;; conditionals to the source code at appropiate places
+;; (setf *features* (remove :freebsd4 *features*))
+;; (pushnew :freebsd5 *features*)
-- 
GitLab