summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/AppHdr.h
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-09-29 20:05:11 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-09-29 20:08:30 -0700
commit5f6474e368cb6ea002441f0de647d8d83fe7dc04 (patch)
tree1c87d3af681a2d6e521e63ed5a03bd723807e7fc /crawl-ref/source/AppHdr.h
parent5998b265381b181b894f8301d4b26ea206439022 (diff)
downloadcrawl-ref-5f6474e368cb6ea002441f0de647d8d83fe7dc04.tar.gz
crawl-ref-5f6474e368cb6ea002441f0de647d8d83fe7dc04.zip
AppHdr.h: FreeBSD support added
With FreeBSD, we have to use SAVE_PACKAGE_NONE for now, because the /usr/bin/zip program isn't part of the base installation, and GNU tar isn't either. FreeBSD has a 'tar' command, but it's BSD tar, rather than GNU tar. And FreeBSD's tar doesn't have the very important '--remove-files' parameter. I've posted on the FreeBSD forums asking about the best way to emulate the '--remove-files' option using nothing but FreeBSD's stock commands. I'll add a SAVE_PACKAGE_BSD_TAR option or similar once I have more information. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/AppHdr.h')
-rw-r--r--crawl-ref/source/AppHdr.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index 50a3dc0eda..6d9029ee8e 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -21,6 +21,16 @@
#ifndef APPHDR_H
#define APPHDR_H
+// Very simple OS detection, done via predefined macros
+// For a list of predefined macros, see
+// http://predef.sourceforge.net/
+#if defined(__MACH__)
+ #define OSX
+#endif
+#if defined(__FreeBSD__)
+ #define FREEBSD
+#endif
+
// The maximum memory that the user-script Lua interpreter can
// allocate, in kilobytes. This limit is enforced to prevent
// badly-written or malicious user scripts from consuming too much
@@ -51,7 +61,9 @@
// especially bad, so we'll want to remap that. OS X is otherwise
// Unix-ish, so we shouldn't need other special handling.
#if defined(OSX)
+ #ifndef UNIX
#define UNIX
+ #endif
#define USE_8_COLOUR_TERM_MAP
#define COL_TO_REPLACE_DARKGREY BLUE
@@ -60,6 +72,15 @@
#endif
#endif
+// FreeBSD
+// There's no /usr/bin/zip in FreeBSD.
+#if defined(FREEBSD)
+ #ifndef UNIX
+ #define UNIX
+ #endif
+ #define SAVE_PACKAGE_NONE
+#endif
+
// =========================================================================
// System Defines
// =========================================================================