Compile for Mac

From UFO:AI
(Difference between revisions)
Jump to: navigation, search
(updates from LittleJohn)
 
Line 8: Line 8:
  
 
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====
 
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===
 
===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 \
  jpeg libpng XviD libtheora gtk2 gtkglext gtksourceview2 libtheora XviD git-core \
+
jpeg libpng XviD libtheora gtk2 gtkglext gtksourceview2 git p7zip python27 \
  p7zip python26
+
doxygen libsdl2 libsdl2_mixer libsdl2_ttf
  
 
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.
Line 30: Line 24:
 
Toward the bottom, substitute this export command:
 
Toward the bottom, substitute this export command:
  
  export PATH=$PATH:/opt/local/bin:opt/local/sbin:opt/local
+
  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.
 
Save the file, quit Terminal, then relaunch Terminal to make the new PATH operative.
Line 36: Line 30:
 
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.
 
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.
  
 +
Change directory into the main ufoai folder.
 +
cd ufoai
 +
Establish the appropriate configuration for compiling.
 +
configure
 
To compile the binaries, just type (after the configure call was successful).
 
To compile the binaries, just type (after the configure call was successful).
 
  make
 
  make

Latest revision as of 15:39, 6 November 2014

Contents

[edit] macports

[edit] 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

[edit] Step 2: Install dependencies

sudo port install libsdl-framework libsdl_mixer-framework libsdl_ttf-framework \
jpeg libpng XviD libtheora gtk2 gtkglext gtksourceview2 git p7zip python27 \
doxygen libsdl2 libsdl2_mixer libsdl2_ttf

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

[edit] 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.

Change directory into the main ufoai folder.

cd ufoai

Establish the appropriate configuration for compiling.

configure

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

[edit] 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
Personal tools