README.MacOSX
changeset 172 37e3ca9254c7
parent 53 25dfe480c75e
child 191 c151cfc43c07
     1.1 --- a/README.MacOSX	Tue Sep 11 18:52:45 2001 +0000
     1.2 +++ b/README.MacOSX	Tue Sep 11 19:00:18 2001 +0000
     1.3 @@ -18,11 +18,7 @@
     1.4  
     1.5  (You may need to create the subdirs of /usr/local manually.)
     1.6  
     1.7 -For some reason, libtool doesn't run ranlib properly, so do this
     1.8 -manually:
     1.9 -
    1.10 -	ranlib /usr/local/lib/libSDL.a
    1.11 -
    1.12 +/*
    1.13  To use the library once it's built, you need to use the "Carbon
    1.14  framework", which is the port of the old Mac Toolbox to OS X.
    1.15  To do this, use the -F and -framework arguments for compiling
    1.16 @@ -33,6 +29,79 @@
    1.17  
    1.18  sdl-config knows about the linking path and -framework, so it's
    1.19  recommended to use it to fill in your Makefile variables.
    1.20 +*/
    1.21 +
    1.22 +To use the library once it's built, you essential have two possibilities:
    1.23 +use the traditional autoconf/automake/make method, or use Apple's Project Builder.
    1.24 +
    1.25 +==============================================================================
    1.26 +Using the Simple DirectMedia Layer with a traditional Makefile
    1.27 +==============================================================================
    1.28 +
    1.29 +In the following, it will be mostly assumed that you are using autoconf and
    1.30 +automake to setup your SDL project, and furthermore that you use the AM_PATH_SDL
    1.31 +macro provided by SDL in sdl.m4. If you are not using these tools, you can
    1.32 +still use SDL but it will be somewhat hard to get running.
    1.33 +
    1.34 +Only step 1) is really required to get started, but for full OS X support you
    1.35 +will want to do the other steps, too.
    1.36 +
    1.37 +1) Update your acinclude.m4 file in case you have copied an older version of
    1.38 +   sdl.m4 into it. This is essential as AM_PATH_SDL now performs some additional
    1.39 +   tasks when used on MacOS X
    1.40 +
    1.41 +   Rationale: AM_PATH_SDL copies /usr/local/share/sdl/Info.plist and the folder
    1.42 +   /usr/local/share/sdl/SDLMain.nib/ into the directory where configure is invoked.
    1.43 +   This is essential for the configure script to be able to run the test code
    1.44 +   that detects SDL.
    1.45 +
    1.46 +2) Copy SDL's Info.plist.in file (from src/main/macosx) into your project's main
    1.47 +   folder (the same spot that your configure.in sits), and edit it to suite your
    1.48 +   needs. Then add it to your AC_OUTPUT list in configure.in
    1.49 +
    1.50 +   Rationale: The Info.plist file can be used to specify an icon file for
    1.51 +   your app, and also to provide a human readable version/copyright string
    1.52 +   and other meta-information to the user via the Finder's Get Info dialog.
    1.53 +
    1.54 +3) Add something like the following rule to your Makefile.am:
    1.55 +
    1.56 +APP_NAME.app: EXE_NAME
    1.57 +	mkdir -p $@/Contents/MacOS
    1.58 +	mkdir -p $@/Contents/Resources
    1.59 +	mkdir -p $@/Contents/Resources/SDLMain.nib
    1.60 +	echo "APPL????" > $@/Contents/PkgInfo
    1.61 +	$(INSTALL_DATA) Info.plist $@/Contents/
    1.62 +	$(INSTALL_DATA) SDLMain.nib/*.nib $@/Contents/Resources/
    1.63 +	$(INSTALL_PROGRAM) $< $@/Contents/MacOS/
    1.64 +
    1.65 +   You should replace EXE_NAME with the name of the executable. APP_NAME is what
    1.66 +   will be visible to the user in the Finder. Usually it will be the same
    1.67 +   as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME 
    1.68 +   usually is "TestGame"
    1.69 +
    1.70 +   If your project builds more than one application, you will have to do a bit more.
    1.71 +   For each of your target applications, you need a seperate rule. Furthermore, each
    1.72 +   needs its own Info.plist file, since that has to contain the exact name of the 
    1.73 +   executable (i.e. EXE_NAME above). One way to do that is to use sed in your make rules
    1.74 +   and modify a single master Info.plist.
    1.75 +
    1.76 +   Rationale: on Mac OS X, executables have to be put into so-called "bundles".
    1.77 +   The make rule given above will construct such a bundle around the executable
    1.78 +   for you. You need to make a copy of it for each target application.
    1.79 +
    1.80 +4) If you want the create bundles to be installed, you may want to add this
    1.81 +   rule to your Makefile.am:
    1.82 +
    1.83 +install-exec-local: Exult.app
    1.84 +	mkdir -p /Applications/
    1.85 +	cp -r $< /Applications/
    1.86 +
    1.87 +   This rule takes the Bundle created by the rule from step 3 and installs them
    1.88 +   into /Applications/. An alternate installation place would be $HOME/Applications/
    1.89 +
    1.90 +   Again, if you want to install multiple applications, you will have to augment
    1.91 +   the make rule accordingly.
    1.92 +
    1.93  
    1.94  ==============================================================================
    1.95  Using the Simple DirectMedia Layer with Project Builder
    1.96 @@ -122,3 +191,4 @@
    1.97          but I expect that things will still work on older versions.
    1.98          
    1.99  Known bugs are listed in the file "BUGS"
   1.100 + LocalWords:  Stuffit