Difference between revisions of "Compile for Mac"

From UFO:AI
Line 1: Line 1:
==Step 1. Installation==
+
==macports==
 +
===Step 1. Installation===
  
 
Install Xcode, X11, and MacPorts
 
Install Xcode, X11, and MacPorts
Line 8: Line 9:
 
You can also download the X11.app from {{http|xquartz.macosforge.org/landing/|here}}
 
You can also download the X11.app from {{http|xquartz.macosforge.org/landing/|here}}
  
===Add headerpad_max_install_names LDFLAGS to MacPorts===
+
====Add headerpad_max_install_names LDFLAGS to MacPorts====
 
Modify /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl configure.ldflags to  
 
Modify /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl configure.ldflags to  
 
  default configure.ldflags {"-L${prefix}/lib -Wl,-headerpad_max_install_names"}
 
  default configure.ldflags {"-L${prefix}/lib -Wl,-headerpad_max_install_names"}
Line 14: Line 15:
 
This change is only needed if you would like to create dmgs.
 
This change is only needed if you would like to create dmgs.
  
==Step 2: Install dependencies==
+
===Step 2: Install dependencies===
  
 
  sudo port install libsdl-framework libsdl_mixer-framework libsdl_ttf-framework \
 
  sudo port install libsdl-framework libsdl_mixer-framework libsdl_ttf-framework \
Line 22: Line 23:
 
Now you should be able to [[Getting the source|fetch UFO-AI]] and compile it.
 
Now you should be able to [[Getting the source|fetch UFO-AI]] and compile it.
  
==Step 3: Compilation==
+
===Step 3: Compilation===
 
UFO:AI compilation requires some paths that are not taken care of for you by the MacPorts installation process. Therefore, a minor edit to your .profile is needed.
 
UFO:AI compilation requires some paths that are not taken care of for you by the MacPorts installation process. Therefore, a minor edit to your .profile is needed.
  
Line 41: Line 42:
 
To create the application bundle (i.e., a .dmg), just type
 
To create the application bundle (i.e., a .dmg), just type
 
  make macinstaller
 
  make macinstaller
 +
 +
==fink==
 +
 +
After installing fink you should just type the following to your console:
 +
 +
fink install sdl sdl-ttf sdl-mixer libtheora0 libjpeg8 libpng15 libxml2 libcurl4 xvidcore gtk+2 gtksourceview2-dev gtksourceview2-shlibs gtkglext1 glib2-dev glib2-shlibs
  
 
[[Category:Coding]]
 
[[Category:Coding]]

Revision as of 13:39, 15 May 2012

macports

Step 1. Installation

Install Xcode, X11, and MacPorts

Instructions are at http://guide.macports.org/#installing This will have you install Apple's X11, the Xcode development environment (needed for the compiler, etc), and the MacPorts program.

You can also download the X11.app from here

Add headerpad_max_install_names LDFLAGS to MacPorts

Modify /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl configure.ldflags to

default configure.ldflags {"-L${prefix}/lib -Wl,-headerpad_max_install_names"}

This change is only needed if you would like to create dmgs.

Step 2: Install dependencies

sudo port install libsdl-framework libsdl_mixer-framework libsdl_ttf-framework \
 jpeg libpng XviD libtheora gtk2 gtkglext gtksourceview2 libtheora XviD git-core \
 p7zip python26

Now you should be able to fetch UFO-AI and compile it.

Step 3: Compilation

UFO:AI compilation requires some paths that are not taken care of for you by the MacPorts installation process. Therefore, a minor edit to your .profile is needed.

If you don't understand the preceding sentences: (a) Download TextWrangler (freeware) from http://www.barebones.com/products/textwrangler/download.html ; (b) Use its File > Open to navigate to your home folder and enable its "Show hidden files" option; and (c) Open the ".profile" file you should see now so you can edit it.

Toward the bottom, substitute this export command:

export PATH=$PATH:/opt/local/bin:opt/local/sbin:opt/local

Save the file, quit Terminal, then relaunch Terminal to make the new PATH operative.

Now, the following "make" commands should execute without errors. You should also be able to compile newer versions of UFO:AI without editing .profile again, i.e., this is a one-time fix.

To compile the binaries, just type (after the configure call was successful).

make

after that, you need to create the languages and maps

make lang models maps-sync

To create the application bundle (i.e., a .dmg), just type

make macinstaller

fink

After installing fink you should just type the following to your console:

fink install sdl sdl-ttf sdl-mixer libtheora0 libjpeg8 libpng15 libxml2 libcurl4 xvidcore gtk+2 gtksourceview2-dev gtksourceview2-shlibs gtkglext1 glib2-dev glib2-shlibs