From: <re...@us...> - 2010-12-08 14:59:27
|
Revision: 6503 http://planeshift.svn.sourceforge.net/planeshift/?rev=6503&view=rev Author: res2002 Date: 2010-12-08 14:59:20 +0000 (Wed, 08 Dec 2010) Log Message: ----------- Update Jam files from CS Modified Paths: -------------- trunk/mk/jam/crystalspace_staticplugins_msvc.jam trunk/mk/jam/debuginfo.jam trunk/mk/jam/docs.jam trunk/mk/jam/icons.jam trunk/mk/jam/macosx.jam trunk/mk/jam/msvcgen.jam trunk/mk/jam/static.jam trunk/mk/jam/win32.jam Modified: trunk/mk/jam/crystalspace_staticplugins_msvc.jam =================================================================== --- trunk/mk/jam/crystalspace_staticplugins_msvc.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/crystalspace_staticplugins_msvc.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -1,14 +1,13 @@ -# This is an example on how to include the MSVC static plugins information -# for external projects. -# The information itself is split across multiple files, one for each -# supported version of MSVC; the files for the desired MSVC versions must -# be included (usually all). - -# The inclusions below are of examplary nature and would only work within -# the source tree of CS. For an external project you could either directly -# refer to the files inside CS or a copy in your project's sources; either -# way, the include statements below would obviously have to adjusted -# appropriately. -include $(TOP)/mk/jam/crystalspace_staticplugins_msvc8.jam ; -include $(TOP)/mk/jam/crystalspace_staticplugins_msvc9.jam ; -include $(TOP)/mk/jam/crystalspace_staticplugins_msvc10.jam ; +# This is an example on how to include the MSVC static plugins information +# for external projects. +# The information itself is split across multiple files, one for each +# supported version of MSVC; the files for the desired MSVC versions must +# be included (usually all). + +# The inclusions below are of examplary nature and would only work within +# the source tree of CS. For an external project you could either directly +# refer to the files inside CS or a copy in your project's sources; either +# way, the include statements below would obviously have to adjusted +# appropriately. +include $(TOP)/mk/msvc/crystalspace_staticplugins_msvc8.jam ; +include $(TOP)/mk/msvc/crystalspace_staticplugins_msvc9.jam ; Modified: trunk/mk/jam/debuginfo.jam =================================================================== --- trunk/mk/jam/debuginfo.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/debuginfo.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -36,7 +36,7 @@ { $(CMD.OBJCOPY) --only-keep-debug $(<) $(DEBUG_FILE) $(CMD.OBJCOPY) --strip-unneeded $(<) - $(CMD.OBJCOPY) --add-gnu-debuglink=$(DEBUG_FILE) $(<) + $(CMD.OBJCOPY) $(CMD.OBJCOPY.LONG_SECTION_NAMES_ENABLE) --add-gnu-debuglink=$(DEBUG_FILE) $(<) test -n "$(CHMOD)" && $(CHMOD) a-x $(DEBUG_FILE) } Modified: trunk/mk/jam/docs.jam =================================================================== --- trunk/mk/jam/docs.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/docs.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -353,7 +353,7 @@ if $(CMD.C++CPP) { doxycpp = [ GenerateDoxygenCppWrapper $(outfile) : - $(CMD.C++CPP) [ FDefines DOXYGEN_RUN ] ] ; + $(CMD.C++CPP) "-C" [ FDefines DOXYGEN_RUN ] ] ; } local have_dot = "NO" ; Modified: trunk/mk/jam/icons.jam =================================================================== --- trunk/mk/jam/icons.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/icons.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -238,9 +238,34 @@ rule IconsMakeWin32ICO { } } -if $(CMD.MAKEICNS) != "" +if $(CMD.MAKEICNS) != "" || $(CMD.PNG2ICNS) != "" { - ## IconsMakeWinMacICNS filename : iconname [: sizes] + # DownsampleImage target : source : size ; + # Returns file name of (temp) file with resampled imaged. + rule DownsampleImage + { + local target = $(1) ; + local source = $(2) ; + local size = $(3) ; + + local tempdir = [ ConcatDirs $(BUILDTOP) out iconstmp $(SUBDIR) $(size) ] ; + local outfile = $(source:G=$(tempdir)) ; + + MakeLocate $(outfile) : $(tempdir) ; + Depends $(outfile) : $(source) ; + SIZE on $(outfile) = $(size) ; + ConvertReduce $(outfile) : $(source) ; + RmTemps $(target) : $(outfile) ; + + return $(outfile) ; + } + + actions ConvertReduce + { + $(CMD.CONVERT) $(>) -resize $(SIZE)x$(SIZE) $(<) + } + + ## IconsMakeMacICNS filename : iconname [: sizes] ## Generate a MacOS/X ICNS file from a PNG image such as produced by ## IconsFromSVG. ## `sizes' specify the available source image resolutions. Allowed sizes @@ -264,7 +289,7 @@ local icon = $(2) ; local in_sizes = $(3) ; - # Default to the size used by Leopard and aboce. + # Default to the size used by Leopard and above. if "$(in_sizes)" = "" { in_sizes = 512 ; } # Filter out unsupported sizes (only certain sizes are allowed in ICNS # icons, and we don't provide/care about images sized below 128x128) @@ -296,17 +321,67 @@ Depends $(icnsfile) : $(pngfile) ; in_$(size) = $(pngfile) ; } - # If an image of a size is not available, default to the next larger size. - # Note that `makeicns' takes care of downsizing to the smaller size in - # that case. - if ! $(in_256) { in_256 = $(in_512) ; } - if ! $(in_128) { in_128 = $(in_256) ; } - INPUT_512 on $(icnsfile) = $(in_512) ; - INPUT_256 on $(icnsfile) = $(in_256) ; - INPUT_128 on $(icnsfile) = $(in_128) ; - MakeLocate $(icnsfile) : $(SUBDIR) ; - MakeIcns $(icnsfile) ; - Depends generateicons : $(icnsfile) ; + if $(CMD.MAKEICNS) != "" + { + # Generate ICNS using makeicns + + # If an image of a size is not available, default to the next larger size. + # Note that `makeicns' takes care of downsizing to the smaller size in + # that case. + if ! $(in_256) { in_256 = $(in_512) ; } + if ! $(in_128) { in_128 = $(in_256) ; } + INPUT_512 on $(icnsfile) = $(in_512) ; + INPUT_256 on $(icnsfile) = $(in_256) ; + INPUT_128 on $(icnsfile) = $(in_128) ; + MakeLocate $(icnsfile) : $(SUBDIR) ; + MakeIcns $(icnsfile) ; + Depends generateicons : $(icnsfile) ; + } + else + { + # Generate ICNS using png2icns + + if $(CMD.CONVERT) != "" + { + # png2icns doesn't handle resizing, so do it ourselves + if ! $(in_256) + { + if $(in_512) + { + in_256 = [ DownsampleImage generateicons : $(in_512) : 256 ] ; + Depends $(icnsfile) : $(in_256) ; + } + } + if ! $(in_128) + { + if $(in_256) + { + in_128 = [ DownsampleImage generateicons : $(in_256) : 128 ] ; + Depends $(icnsfile) : $(in_128) ; + } + } + } + else + { + # Make do with the images we have, but issue a warning + local need_resize ; + if $(in_512) + { + if ! $(in_256) || ! $(in_128) { need_resize = "yes" ; } + } + else if $(in_256) + { + if ! $(in_128) { need_resize = "yes" ; } + } + if $(need_resize) + { + Echo "ImageMagick not available, $(icnsfile) will be incomplete" ; + } + } + MakeLocate $(icnsfile) : $(SUBDIR) ; + Png2icns $(icnsfile) : $(in_128) $(in_256) $(in_512) ; + Depends generateicons : $(icnsfile) ; + } } } @@ -324,6 +399,11 @@ fi $(CMD.MAKEICNS) $args -out $(<) } + + actions Png2icns + { + $(CMD.PNG2ICNS) $(<) $(>) + } } else { Modified: trunk/mk/jam/macosx.jam =================================================================== --- trunk/mk/jam/macosx.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/macosx.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -21,7 +21,7 @@ MACOSX_ENVIRONMENT = "export MACOSX_DEPLOYMENT_TARGET=10.2" ; -PLUGIN.LFLAGS += "-bundle" ; +PLUGIN.LFLAGS += "" ; # We use the ugly -Wl form, which does not contain embedded whitespace (unlike # "-framework AppKit"), to help external projects which use the result of @@ -208,7 +208,7 @@ actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS { $(MACOSX_ENVIRONMENT) - $(CMD.LINK) -bundle -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) + $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) } # LinkApplicationConsole exe : objects Modified: trunk/mk/jam/msvcgen.jam =================================================================== --- trunk/mk/jam/msvcgen.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/msvcgen.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -1031,12 +1031,12 @@ ResponseFile $(respfile) : $(MSVC.RESPEMIT.GLOBAL) : notfile : $(respdir) ; local inckeys = "include" includedebug ; - local incdirs = $(MSVC.INCDIRS_LITERAL) $(MSVC.INCDIRS_LITERAL.$(rawname)) ; + local incdirs = $(MSVC.INCDIRS_LITERAL) ; ResponseFile $(respfile) : "$(inckeys)|$(incdirs)" : notfile : $(respdir) ; ResponseFile $(respfile) : "$(inckeys)-x64|$(incdirs)" : notfile : $(respdir) ; - + local incdir ; - for incdir in $(MSVC.INCDIRS) $(MSVC.INCDIRS.$(rawname)) + for incdir in $(MSVC.INCDIRS) { if $(incdir) = "." { @@ -1050,6 +1050,8 @@ ResponseFile $(respfile) : "$(inckeys)-x64|$(incdir)" : notfile : $(respdir) ; } + # Per-project include dirs are handled in the IncludeDir rule + if ! [ Property msvcgen : templatedir ] { exit "Error: You must invoke MsvcGenTemplateDir for project generation." ; @@ -2019,24 +2021,56 @@ if ! [ IsElem transient : $(options) ] { - local tag = "INCDIRS" ; - if [ IsElem literal : $(options) ] { tag = "INCDIRS_LITERAL" ; } - - if $(dir) + if $(target) { - dir = [ ConcatDirs $(dir) ] ; - } - else - { - dir = "." ; - } + # IncludeDir for a target must be called _after_ the target was set up, + # hence we can assume a project response file is present + local inckeys = "include" includedebug ; + local relpath = [ Property msvcgen : relpath$(MSVC_VERSION) ] ; + local respfile = $($(target)_PRJ_RESPFILE) ; + local respdir = $($(target)_PRJ_RESPDIR) ; + if [ IsElem literal : $(options) ] + { + if $(dir) + { + dir = [ ConcatDirs $(dir) ] ; + } + else + { + dir = "." ; + } - if $(target) - { - MSVC.$(tag).$(target) += $(dir) ; + ResponseFile $(respfile) : "$(inckeys)|$(dir)" : notfile : $(respdir) ; + ResponseFile $(respfile) : "$(inckeys)-x64|$(dir)" : notfile : $(respdir) ; + } + else + { + if $(dir) + { + dir = [ ConcatDirs $(relpath) $(SUBDIR_TOKENS) $(dir) ] ; + } + else + { + dir = [ ConcatDirs $(relpath) $(SUBDIR_TOKENS) ] ; + } + + ResponseFile $(respfile) : "$(inckeys)|$(dir)" : notfile : $(respdir) ; + ResponseFile $(respfile) : "$(inckeys)-x64|$(dir)" : notfile : $(respdir) ; + } + } else { + local tag = "INCDIRS" ; + if [ IsElem literal : $(options) ] { tag = "INCDIRS_LITERAL" ; } + if $(dir) + { + dir = [ ConcatDirs $(dir) ] ; + } + else + { + dir = "." ; + } MSVC.$(tag) += $(dir) ; } } Modified: trunk/mk/jam/static.jam =================================================================== --- trunk/mk/jam/static.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/static.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -260,14 +260,16 @@ Echo "$(target): Warning: Static plugin \"$(p)\" from package \"$(package)\" not available." ; } CFlags $(target) : $(STATICPLUGIN.$(p).CFLAGS) ; - lflags = [ MergeRemovingDups $(lflags) : $(STATICPLUGIN.$(p).LFLAGS) ] ; + local staticplugin_lflags = [ InferFlagTuples $(STATICPLUGIN.$(p).LFLAGS) ] ; + lflags = [ MergeRemovingDups $(lflags) : $(staticplugin_lflags) ] ; local relaydeps = $(STATICPLUGIN.$(p).RELAYDEPS) ; for relaydep in $(relaydeps) { CFlags $(target) : $(STATICPLUGIN.$(p).RELAYCFLAGS.$(relaydep)) ; + local staticplugin_relayflags = [ InferFlagTuples $(STATICPLUGIN.$(p).RELAYLFLAGS.$(relaydep)) ] ; lflags = [ MergeRemovingDups $(lflags) : - [ RelayLFlags $(COMPILER.LFLAGS) $(STATICPLUGIN.$(p).RELAYLFLAGS.$(relaydep)) : + [ RelayLFlags $(COMPILER.LFLAGS) $(staticplugin_relayflags) : $(STATICPLUGIN.$(p).RELAYLIBS.$(relaydep)) ] ] ; # @@@ If we can get the .a file name for the static plugin lib # we could pass that for the minimal-objects @@ -293,7 +295,8 @@ # Grab flags for p in $(plugins) { - lflags += [ Filter $($(p).LFLAGS.EXTERNAL) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ; + local staticplugin_lflags = [ InferFlagTuples $($(p).LFLAGS.EXTERNAL) ] ; + lflags += [ Filter $(staticplugin_lflags) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ; libs += $($(p).NEEDLIBS) ; local relaydeps = $($(p).RELAYDEPS) ; @@ -304,8 +307,9 @@ [ on $($(STATICPLUGINS.LIBRARY)_TARGET) GetVar SEARCH ] $($(STATICPLUGINS.LIBRARY)_TARGET) ] ; + local staticplugin_relayflags = [ InferFlagTuples $($(relaydep).LFLAGS) ] ; lflags = [ MergeRemovingDups $(lflags) : - [ RelayLFlags $(COMPILER.LFLAGS) $($(relaydep).LFLAGS) : + [ RelayLFlags $(COMPILER.LFLAGS) $(staticplugin_relayflags) : $($(p).RELAYLIBS.$(relaydep)) : $(libpath) ] ] ; relayobjs += [ RelayObjs $(target) : $($(p).RELAYLIBS.$(relaydep)) : $(relaydep) ] ; Modified: trunk/mk/jam/win32.jam =================================================================== --- trunk/mk/jam/win32.jam 2010-12-08 14:58:32 UTC (rev 6502) +++ trunk/mk/jam/win32.jam 2010-12-08 14:59:20 UTC (rev 6503) @@ -447,14 +447,13 @@ local suffix = $(4) ; if "$(suffix)" { - local target_suffixed = $(<)-$(suffix) ; + local target_suffixed = "$(<:B)-$(suffix)$(<:S)" ; local installed = [ DoInstallFile $(<) : $(bindir) $(2) : $(target_suffixed) : $(INSTALL_PROGRAM) ] ; Depends install_bin : $(installed) ; - NotFile $(target_suffixed) ; local linktarget = $(<:D=$(bindir)) ; Depends install_bin : [ - InstallSymLink $(linktarget) : $(target_suffixed) ] ; + InstallSymLink $(linktarget) : $(installed) ] ; } else { @@ -615,12 +614,16 @@ echo "EXPORTS" > $(<) } +# Take an extracted .drectve section and generate .def file entries of it +# - Convertes spaces to newlines +# - Filters out any option other than '-export' ones +# - Filter the symbol name, handle ',data' decoration actions piecemeal together DrectveToDef { for d in $(>) do sed -e "s/ /\\ -/g" $d | sed -e "s/-export:\(.*\)/\1/g" | sed -e "s/,data/ DATA/g" >> $(<) +/g" $d | grep "-export" | sed -e "s/-export:\(.*\)/\1/g" | sed -e "s/,data/ DATA/g" >> $(<) done } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |