summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-09-29 20:05:11 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-09-30 00:29:17 -0700
commit6943c77da2eded654f24d677f81aa49fd8177b4c (patch)
tree5909f9e621ad7930ce9232cb7e3ad162383571cf
parent50534d76830f90fd9b4cc43733800233211d7651 (diff)
downloadcrawl-ref-6943c77da2eded654f24d677f81aa49fd8177b4c.tar.gz
crawl-ref-6943c77da2eded654f24d677f81aa49fd8177b4c.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>
-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 bf4c551106..c3ea5a403c 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
// =========================================================================