applied farnkerls patch to handle the jam commandline limitation problems
[supertux.git] / mk / jam / macosx.jam
index 5fcb299..9979bbd 100644 (file)
@@ -38,14 +38,20 @@ rule SystemLinkApplication
 {
   local target = $($(<)_TARGET) ;
   Depends $(target) : $(>) ;
-    
-  if $(<)_WHOLE_ARCHIVE
+
+  if [ IsElem linkerfile : $(3) ]
+  {
+    RemoveLinkerInputFile $(target) ;
+    local i ;
+    for i in $(>) { AppendLinkerInputFile $(target) : $(i) ; }
+    LinkApplicationFromFile $(target) : $(target) ;
+    RemoveLinkerInputFile $(target) ;
+  }
+  else
   {
-    WHOLE_ARCH_BEGIN on $(target) = -Wl,--whole-archive ;
-    WHOLE_ARCH_END on $(target) = -Wl,--no-whole-archive ;
+    LinkApplication $(target) : $(>) ;
   }
 
-  LinkApplication $(target) : $(>) ;
   LIBS on $(target) = $(LIBS) ;
   Clean clean : $(target) ;
   Clean $(<)clean : $(target) ;
@@ -53,10 +59,26 @@ rule SystemLinkApplication
 
 # LinkApplicationConsole exe : objects
 #    Link a console (non-GUI) appliation from a set of object files.
-actions LinkApplication bind NEEDLIBS bind NEEDLIBS_WHOLE bind EXTRAOBJECTS
+actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
+{
+  $(MACOSX.ENVIRON)
+  $(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 $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(WHOLE_ARCH_BEGIN) \
-    $(NEEDLIBS_WHOLE) $(WHOLE_ARCH_END) $(LIBS)
+  $(LINK) -o $(<) `cat $(>).opt` $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
+#  $(LINK) -o $(<) -Xlinker @$(>).opt $(EXTRAOBJECTS) $(NEEDLIBS) $(LIBS)
 }