Commit 376f6f5867afbe8f38bc1bbdc23ac5513f2732da

Authored by dg
1 parent 697fa5bb

updated osx building


git-svn-id: http://svn.net-core.org/repos/t-engine4@6304 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -35,19 +35,14 @@ project "TEngine"
35 35 includedirs {
36 36 "/System/Library/Frameworks/OpenGL.framework/Headers",
37 37 "/System/Library/Frameworks/OpenAL.framework/Headers",
38   - "/Library/Frameworks/SDL.framework/Headers",
39   - "/Library/Frameworks/SDL.framework/Headers",
40   - "/Library/Frameworks/SDL_net.framework/Headers",
41   - "/Library/Frameworks/SDL_image.framework/Headers",
42   - "/Library/Frameworks/SDL_ttf.framework/Headers",
43   - "/Library/Frameworks/SDL_mixer.framework/Headers",
44   - "/opt/local/include",
45   - "/opt/local/include/Vorbis"
  38 + "/Library/Frameworks/SDL2.framework/Headers",
  39 + "/Library/Frameworks/SDL2_image.framework/Headers",
  40 + "/Library/Frameworks/SDL2_ttf.framework/Headers"
46 41 }
47 42 defines { "USE_TENGINE_MAIN", 'SELFEXE_MACOSX' }
48   - linkoptions { "-framework SDL", "-framework SDL_image", "-framework SDL_ttf", "-framework SDL_mixer", "-framework Cocoa", "-framework OpenGL" , "-framework OpenAL", "-pagezero_size 10000","-image_base 100000000" }
  43 + linkoptions { "-framework SDL2", "-framework SDL2_image", "-framework SDL2_ttf", "-framework libpng", "-framework Cocoa", "-framework OpenGL" , "-framework OpenAL", "-pagezero_size 10000", "-image_base 100000000", "-isysroot /Developer/SDKs/MacOSX10.5.sdk", "-mmacosx-version-min=10.5" }
49 44 targetdir "."
50   - links { "IOKit" }
  45 + links { "IOKit", "vorbisfile" }
51 46
52 47 configuration "windows"
53 48 links { "mingw32", "SDL2main", "SDL2", "SDL2_ttf", "SDL2_image", "openal32", "vorbisfile", "OPENGL32", "GLU32", "wsock32", "png" }
... ...
... ... @@ -419,7 +419,7 @@ function _M:selectFunFact(ffdata)
419 419 if ffdata.total_time then l[#l+1] = "Total playtime of all registered players:\n"..ffdata.total_time end
420 420 if ffdata.top_five_races then l[#l+1] = ("#LIGHT_BLUE#%s#WHITE# is one of the top five played races"):format(rng.table(ffdata.top_five_races).name) end
421 421 if ffdata.top_five_classes then l[#l+1] = ("#LIGHT_BLUE#%s#WHITE# is one of the top five played classes"):format(rng.table(ffdata.top_five_classes).name) end
422   - if ffdata.top_ten_killer then l[#l+1] = ("#CRIMSON#%s#WHITE# is one of the top ten killer"):format(rng.table(ffdata.top_ten_killer).name:capitalize()) end
  422 + if ffdata.top_ten_killer then l[#l+1] = ("#CRIMSON#%s#WHITE# is one of the top ten killers"):format(rng.table(ffdata.top_ten_killer).name:capitalize()) end
423 423 if ffdata.top_ten_raceclass then l[#l+1] = ("#LIGHT_BLUE#%s#WHITE# is one of the top ten race/class combo"):format(rng.table(ffdata.top_ten_raceclass).name:capitalize()) end
424 424 if ffdata.nb_players then l[#l+1] = ("There are currently %d people playing online"):format(ffdata.nb_players) end
425 425 if ffdata.total_deaths then l[#l+1] = ("The character's vault has registered a total of #RED#%d#WHITE# character's deaths"):format(ffdata.total_deaths) end
... ...
... ... @@ -37,7 +37,7 @@ configuration "windows"
37 37 }
38 38
39 39 configuration "macosx"
40   - buildoptions { "-pagezero_size 10000", "-image_base 100000000" }
  40 + buildoptions { "-pagezero_size 10000", "-image_base 100000000", "-Wno-return-type", "-isysroot /Developer/SDKs/MacOSX10.5.sdk", "-mmacosx-version-min=10.5" }
41 41
42 42 configuration "Debug"
43 43 defines { }
... ...
... ... @@ -30,6 +30,7 @@
30 30 #include <string.h>
31 31 #include <unistd.h>
32 32 #include <fcntl.h>
  33 +#include <sys/types.h>
33 34
34 35 static off_t offtin(u_char *buf)
35 36 {
... ...
... ... @@ -37,7 +37,12 @@
37 37 #include "useshader.h"
38 38 #include <math.h>
39 39 #include <time.h>
  40 +
  41 +#ifdef __APPLE__
  42 +#include <libpng/png.h>
  43 +#else
40 44 #include <png.h>
  45 +#endif
41 46
42 47 extern SDL_Window *window;
43 48
... ...
... ... @@ -82,7 +82,7 @@
82 82
83 83 // SDL_main support for OSX
84 84 #ifdef TCOD_MACOSX
85   -#include "SDL/SDL.h"
  85 +#include "SDL2/SDL.h"
86 86 #endif
87 87
88 88 // base types
... ...
  1 +/* Exception handling and frame unwind runtime interface routines.
  2 + Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
  3 +
  4 + This file is part of GCC.
  5 +
  6 + GCC is free software; you can redistribute it and/or modify it
  7 + under the terms of the GNU General Public License as published by
  8 + the Free Software Foundation; either version 2, or (at your option)
  9 + any later version.
  10 +
  11 + GCC is distributed in the hope that it will be useful, but WITHOUT
  12 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  13 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  14 + License for more details.
  15 +
  16 + You should have received a copy of the GNU General Public License
  17 + along with GCC; see the file COPYING. If not, write to the Free
  18 + Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  19 + 02111-1307, USA. */
  20 +
  21 +/* As a special exception, if you include this header file into source
  22 + files compiled by GCC, this header file does not by itself cause
  23 + the resulting executable to be covered by the GNU General Public
  24 + License. This exception does not however invalidate any other
  25 + reasons why the executable file might be covered by the GNU General
  26 + Public License. */
  27 +
  28 +/* This is derived from the C++ ABI for IA-64. Where we diverge
  29 + for cross-architecture compatibility are noted with "@@@". */
  30 +
  31 +#ifndef _UNWIND_H
  32 +#define _UNWIND_H
  33 +
  34 +#ifndef HIDE_EXPORTS
  35 +#pragma GCC visibility push(default)
  36 +#endif
  37 +
  38 +#ifdef __cplusplus
  39 +extern "C" {
  40 +#endif
  41 +
  42 + /* Level 1: Base ABI */
  43 +
  44 + /* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
  45 + inefficient for 32-bit and smaller machines. */
  46 + typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
  47 + typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
  48 +#if defined(__ia64__) && defined(__hpux__)
  49 + typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
  50 +#else
  51 + typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
  52 +#endif
  53 + typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
  54 +
  55 + /* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
  56 + consumer of an exception. We'll go along with this for now even on
  57 + 32-bit machines. We'll need to provide some other option for
  58 + 16-bit machines and for machines with > 8 bits per byte. */
  59 + typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
  60 +
  61 + /* The unwind interface uses reason codes in several contexts to
  62 + identify the reasons for failures or other actions. */
  63 + typedef enum
  64 + {
  65 + _URC_NO_REASON = 0,
  66 + _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
  67 + _URC_FATAL_PHASE2_ERROR = 2,
  68 + _URC_FATAL_PHASE1_ERROR = 3,
  69 + _URC_NORMAL_STOP = 4,
  70 + _URC_END_OF_STACK = 5,
  71 + _URC_HANDLER_FOUND = 6,
  72 + _URC_INSTALL_CONTEXT = 7,
  73 + _URC_CONTINUE_UNWIND = 8
  74 + } _Unwind_Reason_Code;
  75 +
  76 +
  77 + /* The unwind interface uses a pointer to an exception header object
  78 + as its representation of an exception being thrown. In general, the
  79 + full representation of an exception object is language- and
  80 + implementation-specific, but it will be prefixed by a header
  81 + understood by the unwind interface. */
  82 +
  83 + struct _Unwind_Exception;
  84 +
  85 + typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
  86 + struct _Unwind_Exception *);
  87 +
  88 + struct _Unwind_Exception
  89 + {
  90 + _Unwind_Exception_Class exception_class;
  91 + _Unwind_Exception_Cleanup_Fn exception_cleanup;
  92 + _Unwind_Word private_1;
  93 + _Unwind_Word private_2;
  94 +
  95 + /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
  96 + Taking that literally does not make much sense generically. Instead we
  97 + provide the maximum alignment required by any type for the machine. */
  98 + } __attribute__((__aligned__));
  99 +
  100 +
  101 + /* The ACTIONS argument to the personality routine is a bitwise OR of one
  102 + or more of the following constants. */
  103 + typedef int _Unwind_Action;
  104 +
  105 +#define _UA_SEARCH_PHASE 1
  106 +#define _UA_CLEANUP_PHASE 2
  107 +#define _UA_HANDLER_FRAME 4
  108 +#define _UA_FORCE_UNWIND 8
  109 +#define _UA_END_OF_STACK 16
  110 +
  111 + /* This is an opaque type used to refer to a system-specific data
  112 + structure used by the system unwinder. This context is created and
  113 + destroyed by the system, and passed to the personality routine
  114 + during unwinding. */
  115 + struct _Unwind_Context;
  116 +
  117 + /* Raise an exception, passing along the given exception object. */
  118 + extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
  119 +
  120 + /* Raise an exception for forced unwinding. */
  121 +
  122 + typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
  123 + (int, _Unwind_Action, _Unwind_Exception_Class,
  124 + struct _Unwind_Exception *, struct _Unwind_Context *, void *);
  125 +
  126 + extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
  127 + _Unwind_Stop_Fn,
  128 + void *);
  129 +
  130 + /* Helper to invoke the exception_cleanup routine. */
  131 + extern void _Unwind_DeleteException (struct _Unwind_Exception *);
  132 +
  133 + /* Resume propagation of an existing exception. This is used after
  134 + e.g. executing cleanup code, and not to implement rethrowing. */
  135 + extern void _Unwind_Resume (struct _Unwind_Exception *);
  136 +
  137 + /* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow
  138 + a normal exception that was handled. */
  139 + extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
  140 +
  141 + /* @@@ Use unwind data to perform a stack backtrace. The trace callback
  142 + is called for every stack frame in the call chain, but no cleanup
  143 + actions are performed. */
  144 + typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
  145 + (struct _Unwind_Context *, void *);
  146 +
  147 + extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
  148 +
  149 + /* These functions are used for communicating information about the unwind
  150 + context (i.e. the unwind descriptors and the user register state) between
  151 + the unwind library and the personality routine and landing pad. Only
  152 + selected registers maybe manipulated. */
  153 +
  154 + extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
  155 + extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
  156 +
  157 + extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
  158 + extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
  159 +
  160 + /* @@@ Retrieve the CFA of the given context. */
  161 + extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
  162 +
  163 + extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
  164 +
  165 + extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
  166 +
  167 +
  168 + /* The personality routine is the function in the C++ (or other language)
  169 + runtime library which serves as an interface between the system unwind
  170 + library and language-specific exception handling semantics. It is
  171 + specific to the code fragment described by an unwind info block, and
  172 + it is always referenced via the pointer in the unwind info block, and
  173 + hence it has no ABI-specified name.
  174 +
  175 + Note that this implies that two different C++ implementations can
  176 + use different names, and have different contents in the language
  177 + specific data area. Moreover, that the language specific data
  178 + area contains no version info because name of the function invoked
  179 + provides more effective versioning by detecting at link time the
  180 + lack of code to handle the different data format. */
  181 +
  182 + typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
  183 + (int, _Unwind_Action, _Unwind_Exception_Class,
  184 + struct _Unwind_Exception *, struct _Unwind_Context *);
  185 +
  186 + /* @@@ The following alternate entry points are for setjmp/longjmp
  187 + based unwinding. */
  188 +
  189 + struct SjLj_Function_Context;
  190 + extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
  191 + extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
  192 +
  193 + extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException
  194 + (struct _Unwind_Exception *);
  195 + extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind
  196 + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
  197 + extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *);
  198 + extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
  199 +
  200 + /* @@@ The following provide access to the base addresses for text
  201 + and data-relative addressing in the LDSA. In order to stay link
  202 + compatible with the standard ABI for IA-64, we inline these. */
  203 +
  204 +#ifdef __ia64__
  205 +#include <stdlib.h>
  206 +
  207 + static inline _Unwind_Ptr
  208 + _Unwind_GetDataRelBase (struct _Unwind_Context *_C)
  209 + {
  210 + /* The GP is stored in R1. */
  211 + return _Unwind_GetGR (_C, 1);
  212 + }
  213 +
  214 + static inline _Unwind_Ptr
  215 + _Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
  216 + {
  217 + abort ();
  218 + return 0;
  219 + }
  220 +
  221 + /* @@@ Retrieve the Backing Store Pointer of the given context. */
  222 + extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
  223 +#else
  224 + extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
  225 + extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
  226 +#endif
  227 +
  228 + /* @@@ Given an address, return the entry point of the function that
  229 + contains it. */
  230 + extern void * _Unwind_FindEnclosingFunction (void *pc);
  231 +
  232 +#ifdef __cplusplus
  233 +}
  234 +#endif
  235 +
  236 +#ifndef HIDE_EXPORTS
  237 +#pragma GCC visibility pop
  238 +#endif
  239 +
  240 +#endif /* unwind.h */
... ...
  1 +WARNING: This XCode project is very out of date, and has not been able to compile the Mac port for some time. Please compile using the command line instead, with something like "premake4 --lua=jit2 gmake; make config=release". See http://te4.org/wiki/howtocompile for more details on prerequisites and compilation. In addition to those prerequisites, you will also need the binaries for the Ogg, Vorbis, and libpng libraries. You may find it easier to take them from an already existing Mac version of ToME (v1.0 or later).
  2 +
  3 +Note that you will have to piece together the T-Engine.app yourself as well, as the one generated on the command line is empty except for the actual executable. (If you're having trouble finding it, due to the copy at the end failing, look in your t-engine4/build directory.) Do NOT use your mostly-empty .app generated from the command line as the final .app, as this .app does not seem to work even when it is filled with the right resources. Instead, please download a previous Mac version of ToME (v1.0 or later) and replace the files/folders within with those from your source tree (if they exist).
... ...
... ... @@ -5,7 +5,7 @@
5 5 Feel free to customize this file to suit your needs
6 6 */
7 7
8   -#import <SDL/SDL.h>
  8 +#import <SDL2/SDL.h>
9 9 #import "SDLMain.h"
10 10 #import <sys/param.h> /* for MAXPATHLEN */
11 11 #import <unistd.h>
... ...
... ... @@ -22,21 +22,25 @@
22 22 #define _MUSIC_H_
23 23
24 24 #ifdef __APPLE__
25   -#include <al.h>
26   -#include <alc.h>
27   -#include <vorbisfile.h>
  25 +#include <OpenAL/al.h>
  26 +#include <OpenAL/alc.h>
  27 +#include <vorbis/vorbisfile.h>
  28 +#include <SDL2/SDL.h>
  29 +#include <SDL2/SDL_thread.h>
28 30 #elif defined(WIN32)
29 31 #include <AL/al.h>
30 32 #include <AL/alc.h>
31 33 #include <vorbis/vorbisfile.h>
  34 +#include "SDL.h"
  35 +#include "SDL_thread.h"
32 36 #else
33 37 #include <AL/al.h>
34 38 #include <AL/alc.h>
35 39 #include <vorbis/vorbisfile.h>
36   -#endif
37   -
38 40 #include "SDL.h"
39 41 #include "SDL_thread.h"
  42 +#endif
  43 +
40 44 #include "lua.h"
41 45 #include "lauxlib.h"
42 46 #include "types.h"
... ...
1 1 #ifdef __APPLE__
2   -#include <SDL/SDL.h>
3   -#include <SDL_ttf/SDL_ttf.h>
4   -//#include <SDL_mixer/SDL_mixer.h>
5   -#include <SDL_image/SDL_image.h>
  2 +#include <SDL2/SDL.h>
  3 +#include <SDL2_ttf/SDL_ttf.h>
  4 +//#include <SDL2_mixer/SDL_mixer.h>
  5 +#include <SDL2_image/SDL_image.h>
6 6 #else
7 7 #include <SDL.h>
8 8 #include <SDL_ttf.h>
... ...