#============================================================================
# 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 $(<) $(>)
}
#------------------------------------------------------------------------------
{
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) ;
$(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)
+}
+