summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--network_core.h5
-rw-r--r--os/macosx/Makefile.setup26
-rw-r--r--saveload.c2
-rw-r--r--screenshot.c2
-rw-r--r--unix.c7
6 files changed, 25 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index bfb0ea6d8..66bd47924 100644
--- a/Makefile
+++ b/Makefile
@@ -486,8 +486,10 @@ endif
endif
ifdef OSX
+ifndef JAGUAR
LIBS += -liconv
endif
+endif
# enables/disables assert()
ifdef DISABLE_ASSERTS
diff --git a/network_core.h b/network_core.h
index 98dcea13a..7a9dd4e42 100644
--- a/network_core.h
+++ b/network_core.h
@@ -11,13 +11,10 @@
#ifdef ENABLE_NETWORK
-#ifdef __APPLE__
-#include <AvailabilityMacros.h>
-#if (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_2)
+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_2)
// OSX 10.2 don't have socklen_t defined, so we will define it here
typedef int socklen_t;
#endif
-#endif
// Windows stuff
#if defined(WIN32) || defined(WIN64)
diff --git a/os/macosx/Makefile.setup b/os/macosx/Makefile.setup
index 4871e156e..159bf0aa5 100644
--- a/os/macosx/Makefile.setup
+++ b/os/macosx/Makefile.setup
@@ -23,16 +23,6 @@ endif
UNIVERSAL_BINARY:=1
endif
-ifndef UNIVERSAL_BINARY
-ifndef JAGUAR
-ifeq ($(shell uname), Darwin)
-# it's a hardware mac, not crosscompiling
-$(shell $(CC) os/macosx/G5_detector.c -o os/macosx/G5_detector)
-IS_G5:=$(shell os/macosx/G5_detector)
-endif
-endif
-endif
-
ifdef UNIVERSAL_BINARY
ifndef STATIC
$(warning Compiling a universal binary, that is not static. Adding static flag)
@@ -78,3 +68,19 @@ ifdef TRIPLE_BINARY
LDFLAGS += -arch ppc970
endif
endif
+
+# setting up flags to make a binary, that fits the system it builds on
+ifndef UNIVERSAL_BINARY
+ ifndef JAGUAR
+ ifeq ($(shell uname), Darwin)
+ # it's a hardware mac, not crosscompiling
+ # the next line fails if it got whitespace in front of it
+$(shell $(CC) os/macosx/G5_detector.c -o os/macosx/G5_detector)
+ IS_G5:=$(shell os/macosx/G5_detector)
+ ifeq ($(shell uname -r), 6.8)
+ # OSX 10.2.8 uses Darwin 6.8, so we better set JAGUAR so we avoid the stuff that was added in 10.3 or later
+ JAGUAR:=1
+ endif
+ endif
+ endif
+endif
diff --git a/saveload.c b/saveload.c
index 7f2e19191..653ff2402 100644
--- a/saveload.c
+++ b/saveload.c
@@ -1314,7 +1314,7 @@ extern bool AfterLoadGame(void);
extern void BeforeSaveGame(void);
extern bool LoadOldSaveGame(const char *file);
-#ifdef __APPLE__
+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
extern const char *convert_to_fs_charset(const char *filename);
#else
#define convert_to_fs_charset(str) (str)
diff --git a/screenshot.c b/screenshot.c
index 1c4783804..963c5cff3 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -12,7 +12,7 @@
#include "screenshot.h"
#include "variables.h"
-#ifdef __APPLE__
+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
extern const char *convert_to_fs_charset(const char *filename);
#else
#define convert_to_fs_charset(str) (str)
diff --git a/unix.c b/unix.c
index 291e90110..29ddec090 100644
--- a/unix.c
+++ b/unix.c
@@ -43,8 +43,6 @@ ULONG __stack = (1024*1024)*2; // maybe not that much is needed actually ;)
#endif
#if defined(__APPLE__)
- #include <iconv.h>
- #include <locale.h>
#if defined(WITH_SDL)
//the mac implementation needs this file included in the same file as main()
#include <SDL.h>
@@ -606,12 +604,15 @@ void CSleep(int milliseconds)
#endif // __AMIGA__
}
-#ifdef __APPLE__
+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
/* FYI: This is not thread-safe.
Assumptions:
- the 'from' charset is ISO-8859-15
- the 'to' charset is either the same, or UTF-8
+NOTE: iconv was added in OSX 10.3. 10.2.x will still have the invalid char issues. There aren't any easy fix for this
*/
+#include <iconv.h>
+#include <locale.h>
const char *convert_to_fs_charset(const char *filename)
{
static char statout[1024], statin[1024];