Removed unused hatch files.
[supertux.git] / mk / jam / macosx.jam
index 21c433d..5fcb299 100644 (file)
@@ -1,18 +1,19 @@
 #============================================================================
 # Jam configuration and actions for MacOS/X
 # Copyright (C) 2003 by Eric Sunshine <sunshine@sunshineco.com>
+# Copyright (C) 2006 by Ondrej Hosek <ondra.hosek@gmail.com>
 #============================================================================
 SHELL ?= "/bin/sh" ;
 DEEPCOPY ?= "cp -R" ;
 
 # Experience seems to indicate that library scanning misbehaves on MacOS/X with
 # Jam 2.4, consequently we disable it.
-AR = "ar ru" ;
+MACLIBTOOL = "libtool" ;
 NOARUPDATE = true ;
 NOARSCAN = true ;
 actions Archive
 {
-  $(AR) $(<) $(>)
+  $(MACLIBTOOL) -static -o $(<) $(>)
 }
 
 #------------------------------------------------------------------------------
@@ -38,16 +39,24 @@ rule SystemLinkApplication
   local target = $($(<)_TARGET) ;
   Depends $(target) : $(>) ;
     
+  if $(<)_WHOLE_ARCHIVE
+  {
+    WHOLE_ARCH_BEGIN on $(target) = -Wl,--whole-archive ;
+    WHOLE_ARCH_END on $(target) = -Wl,--no-whole-archive ;
+  }
+
   LinkApplication $(target) : $(>) ;
+  LIBS on $(target) = $(LIBS) ;
   Clean clean : $(target) ;
   Clean $(<)clean : $(target) ;
 }
 
 # LinkApplicationConsole exe : objects
 #    Link a console (non-GUI) appliation from a set of object files.
-actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
+actions LinkApplication bind NEEDLIBS bind NEEDLIBS_WHOLE bind EXTRAOBJECTS
 {
   $(MACOSX.ENVIRON)
-  $(LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LFLAGS)
+  $(LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(WHOLE_ARCH_BEGIN) \
+    $(NEEDLIBS_WHOLE) $(WHOLE_ARCH_END) $(LIBS)
 }