don't install miniswig
[supertux.git] / mk / jam / unix.jam
index 281b738..6b4df54 100644 (file)
@@ -34,22 +34,43 @@ rule SystemLinkApplication
   
     Depends $(target) : $(>) ;
 
-    if $(<)_WHOLE_ARCHIVE
+    if [ IsElem linkerfile : $(3) ]
     {
-        WHOLE_ARCH_BEGIN on $(target) = -Wl,--whole-archive ;
-        WHOLE_ARCH_END on $(target) = -Wl,--no-whole-archive ;
+        RemoveLinkerInputFile $(target) ;
+        local i ;
+        for i in $(>) { AppendLinkerInputFile $(target) : $(i) ; }
+        LinkApplicationFromFile $(target) : $(target) ;
+        RemoveLinkerInputFile $(target) ;
+    }
+    else
+    {
+        LinkApplication $(target) : $(>) ;
     }
 
-    LinkApplication $(target) : $(>) ;
     LIBS on $(target) = $(LIBS) ;
     # setup clean rules
     Clean clean : $(target) ;
     Clean $(<)clean : $(target) ;
 }
 
-actions LinkApplication bind NEEDLIBS bind NEEDLIBS_WHOLE bind EXTRAOBJECTS
+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
 {
-    $(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)
 }