Option to jump with up on keyboard.
[supertux.git] / mk / jam / macosx.jam
index d865eca..832fb09 100644 (file)
@@ -38,8 +38,20 @@ rule SystemLinkApplication
 {
   local target = $($(<)_TARGET) ;
   Depends $(target) : $(>) ;
-    
-  LinkApplication $(target) : $(>) ;
+
+  if [ IsElem linkerfile : $(3) ]
+  {
+    RemoveLinkerInputFile $(target) ;
+    local i ;
+    for i in $(>) { AppendLinkerInputFile $(target) : $(i) ; }
+    LinkApplicationFromFile $(target) : $(target) ;
+    RemoveLinkerInputFile $(target) ;
+  }
+  else
+  {
+    LinkApplication $(target) : $(>) ;
+  }
+
   LIBS on $(target) = $(LIBS) ;
   Clean clean : $(target) ;
   Clean $(<)clean : $(target) ;
@@ -53,3 +65,30 @@ actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
   $(LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
 }
 
+actions quietly RemoveLinkerInputFile
+{
+  $(RM) $(<).opt
+}
+
+actions quietly together piecemeal AppendLinkerInputFile
+{
+  echo $(>) >> $(<).opt
+}
+
+actions LinkApplicationFromFile bind NEEDLIBS bind EXTRAOBJECTS
+{
+  $(MACOSX.ENVIRON)
+  $(LINK) -o $(<) `cat $(>).opt` $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
+#  $(LINK) -o $(<) -Xlinker @$(>).opt $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
+}
+
+# Fix a Bison quirk... headers for ".cpp" are made ".cpp.h" (not ".hpp")
+# under OS X
+if $(BISON)
+{
+  actions Bison
+  {
+    $(BISON) -d $(BISON_FLAGS) -o $(<[1]) $(>)
+    test -f $(<[1]).h && $(MV) $(<[1]).h $(<[2])
+  }
+}