Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Fix OSX compiling mess, reducing number of configure env vars that ne…
Browse files Browse the repository at this point in the history
…ed to be set!
  • Loading branch information
DanielOaks committed Oct 13, 2014
1 parent f6645a6 commit 14876b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions INSTALL.md
Expand Up @@ -45,7 +45,7 @@ The Sun Workshop compilers are known NOT to work.
Microsoft's C++ compiler will not work with the Ponscripter build
system, but should theoretically be capable of building the program.

On OSX, clang has worked.
On OS X, clang has worked.


# Building
Expand Down Expand Up @@ -94,24 +94,24 @@ On windows, just running `./configure --steam` in addition to the otherwise norm

Compiling with OS X is a bit more difficult than most else, but it is confirmed to build with [Clang](http://clang.llvm.org/), the new OS X default compiler.

This fork only builds with OS X 10.5+ support, right now (SDL2 support). Building SDL also requires you to enable OpenGL and/or OpenGL ES for it. It does not yet see Clang as a legitimate compiler unfortunately, though we will work with this in the future.
This fork only builds with OS X 10.5+ support because of SDL2 and a few other things. Ponscripter does not yet see Clang as a legitimate compiler unfortunately, but with `--unsupported-compiler` it works fine.

OS X is best built with internal libs. Otherwise, you may run into issues with varying versions of operating systems and libraries.

Here are my standard `./configure` and `make` lines, successfully building on OS X 10.9:

```
CC="clang -mmacosx-version-min=10.5" CXX="clang++ -mmacosx-version-min=10.5" SDLOTHERCONFIG="--enable-video-opengl --enable-video-opengles" ./configure --unsupported-compiler --with-internal-libs
./configure --unsupported-compiler --with-internal-libs
```
```
CC="clang -mmacosx-version-min=10.5" CXX="clang++ -mmacosx-version-min=10.5" SDLOTHERCONFIG="--enable-video-opengl --enable-video-opengles" make
make
```

## Building with Steam on OS X

As per above instructions, make sure the [Steamworks SDK](https://partner.steamgames.com) is in `src/extlib/src/steam-sdk`. Once this is done, simply adding the `--steam` flag to your `./configure` line should be enough, as shown:
```
CC="clang -mmacosx-version-min=10.5" CXX="clang++ -mmacosx-version-min=10.5" SDLOTHERCONFIG="--enable-video-opengl --enable-video-opengles" ./configure --unsupported-compiler --with-internal-libs --steam
./configure --unsupported-compiler --with-internal-libs --steam
```

As with Linux builds, you should ensure the `steam_api.so` file is alongside the binary and `steam_appid.txt` is present. Otherwise, it will crash when launching.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -35,7 +35,7 @@ The following platforms are supported:

* Any modern Linux
* Windows 7/8
* OSX 10.6+
* OSX 10.5+

Any issues on these platforms should be reported.

Expand Down
7 changes: 5 additions & 2 deletions configure
Expand Up @@ -875,8 +875,7 @@ $echo_n "Writing Makefile... ${nobr}"

case "$SYS" in
Posix) EXE= ; OBJ=.o ; LIB=.a ; W32= ;;
MacOSX) EXE= ; OBJ=.o ; LIB=.a ; W32=
CFLAGSEXTRA="-fpascal-strings $CFLAGSEXTRA" ;;
MacOSX) EXE= ; OBJ=.o ; LIB=.a ; W32= ;;
MinGW) EXE=.exe ; OBJ=.o ; LIB=.a ; W32=true ;;
*) echo "error: unsupported system";
exit 1 ;;
Expand Down Expand Up @@ -965,6 +964,10 @@ LIBS = $OURLIBS \\
$LINKSDL2_mixer $LINKogg $LINKvorbis $LINKvorbisfile \\
$LINKbz2 -lm -framework QuickTime -framework CoreFoundation
CFLAGS = -mmacosx-version-min=10.5 $CFLAGS
CXXFLAGS = -mmacosx-version-min=10.5 $CXXFLAGS
SDLOTHERCONFIG = --enable-video-opengl --enable-video-opengles $SDLOTHERCONFIG
DEFS = -DMACOSX -DUTF8_CAPTION -DUTF8_FILESYSTEM -DUSE_OGG_VORBIS $OURDEFS
NO_DEFAULT_ICON = true
EXT_OBJS = $GFX_EXT_OBJS
Expand Down

0 comments on commit 14876b3

Please sign in to comment.