Use Mac's libtool instead of ar to enable Universal Binary development
[supertux.git] / mk / jam / macosx.jam
1 #============================================================================
2 # Jam configuration and actions for MacOS/X
3 # Copyright (C) 2003 by Eric Sunshine <sunshine@sunshineco.com>
4 #============================================================================
5 SHELL ?= "/bin/sh" ;
6 DEEPCOPY ?= "cp -R" ;
7
8 # Experience seems to indicate that library scanning misbehaves on MacOS/X with
9 # Jam 2.4, consequently we disable it.
10 MACLIBTOOL = "libtool" ;
11 NOARUPDATE = true ;
12 NOARSCAN = true ;
13 actions Archive
14 {
15   $(MACLIBTOOL) -static -o $(<) $(>)
16 }
17
18 #------------------------------------------------------------------------------
19 # Public rules.
20 #------------------------------------------------------------------------------
21
22 # ConstructApplicationTarget target : options
23 #    Constructs the application target name (ie. foo.app for foo)
24 rule ConstructApplicationTarget
25 {
26   return $(<) ;
27 }
28
29 # ConstructLibraryTarget target : options
30 rule ConstructLibraryTarget
31 {
32   return lib$(<).a ;
33 }
34
35 # SystemLinkApplication target : objects : options
36 rule SystemLinkApplication
37 {
38   local target = $($(<)_TARGET) ;
39   Depends $(target) : $(>) ;
40     
41   LinkApplication $(target) : $(>) ;
42   LIBS on $(target) = $(LIBS) ;
43   Clean clean : $(target) ;
44   Clean $(<)clean : $(target) ;
45 }
46
47 # LinkApplicationConsole exe : objects
48 #    Link a console (non-GUI) appliation from a set of object files.
49 actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
50 {
51   $(MACOSX.ENVIRON)
52   $(LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
53 }
54