Patch for engine to successfully build on Mac OS X by Michael Schindler
authorunc0rr
Tue, 30 Dec 2008 19:17:47 +0000
changeset 1556 3369f016b79d
parent 1555 0a62938e695a
child 1557 0d1fa1d6d8d5
Patch for engine to successfully build on Mac OS X by Michael Schindler
hedgewars/SDLh.pas
--- a/hedgewars/SDLh.pas	Sun Dec 28 20:57:51 2008 +0000
+++ b/hedgewars/SDLh.pas	Tue Dec 30 19:17:47 2008 +0000
@@ -27,8 +27,12 @@
 {$ENDIF}
 
 {$IFDEF UNIX}
-{$linklib c}
-{$linklib pthread}
+  {$IFDEF DARWIN}
+    {$linklib gcc}
+  {$ELSE}
+    {$linklib c}
+  {$ENDIF}
+  {$linklib pthread}
 {$ENDIF}
 
 {$PACKRECORDS C}
@@ -38,7 +42,15 @@
       SDLLibName = 'SDL.dll';
       {$ENDIF}
       {$IFDEF UNIX}
-      SDLLibName = 'libSDL.so';
+	{$IFDEF DARWIN}
+	  SDLLibName = 'libSDL.dylib';
+	  {$linklib libSDL}
+	  {$linklib SDLmain}
+	  {$linkframework Cocoa}
+	  {$PASCALMAINNAME SDL_main}
+	{$ELSE}
+          SDLLibName = 'libSDL.so';
+        {$ENDIF}
       {$ENDIF}
       SDL_SWSURFACE   = $00000000;
       SDL_HWSURFACE   = $00000001;
@@ -265,7 +277,12 @@
       SDL_TTFLibName = 'SDL_ttf.dll';
       {$ENDIF}
       {$IFDEF UNIX}
-      SDL_TTFLibName = 'libSDL_ttf.so';
+	{$IFDEF DARWIN}
+	  SDL_TTFLibName = 'libSDL_ttf.dylib';
+	  {$linklib libSDL_ttf}
+	{$ELSE}
+          SDL_TTFLibName = 'libSDL_ttf.so';
+        {$ENDIF}
       {$ENDIF}
       TTF_STYLE_NORMAL = 0;
       TTF_STYLE_BOLD   = 1;
@@ -295,7 +312,12 @@
       SDL_MixerLibName = 'SDL_mixer.dll';
       {$ENDIF}
       {$IFDEF UNIX}
-      SDL_MixerLibName = 'libSDL_mixer.so';
+	{$IFDEF DARWIN}
+	  SDL_MixerLibName = 'libSDL_mixer.dylib';
+	  {$linklib libSDL_mixer}
+	{$ELSE}
+          SDL_MixerLibName = 'libSDL_mixer.so';
+	{$ENDIF}
       {$ENDIF}
 
 const MIX_MAX_VOLUME = 128;
@@ -353,7 +375,12 @@
       SDL_ImageLibName = 'SDL_image.dll';
       {$ENDIF}
       {$IFDEF UNIX}
-      SDL_ImageLibName = 'libSDL_image.so';
+	{$IFDEF DARWIN}
+	  SDL_ImageLibName = 'libSDL_image.dylib';
+	  {$linklib libSDL_image}
+	{$ELSE}
+           SDL_ImageLibName = 'libSDL_image.so';
+	{$ENDIF}
       {$ENDIF}
 
 function IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
@@ -364,7 +391,12 @@
       SDL_NetLibName = 'SDL_net.dll';
       {$ENDIF}
       {$IFDEF UNIX}
-      SDL_NetLibName = 'libSDL_net.so';
+	{$IFDEF DARWIN}
+	  SDL_NetLibName = 'libSDL_net.dylib';
+	  {$linklib libSDL_net}
+	{$ELSE}
+          SDL_NetLibName = 'libSDL_net.so';
+	{$ENDIF}
       {$ENDIF}
 
 type TIPAddress = record