From 6943c77da2eded654f24d677f81aa49fd8177b4c Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Tue, 29 Sep 2009 20:05:11 -0700 Subject: 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 --- crawl-ref/source/AppHdr.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 // ========================================================================= -- cgit v1.2.3-54-g00ecf