Ignore:
Timestamp:
Aug 1, 2011, 1:45:20 AM (14 years ago)
Author:
bird
Message:

kBuild: debug info installation support, core hacking + mac os x.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/tools/GCC4MACHO.kmk

    r2431 r2523  
    5151TOOL_GCC4MACHO_LDFLAGS.sysmod ?= -r
    5252#TOOL_GCC4MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
     53TOOL_GCC4MACHO_DSYMUTIL  ?= dsymutil
    5354
    5455ifdef SLKRUNS
     
    104105TOOL_GCC4MACHO_LDFLAGS.debug    ?= -g
    105106TOOL_GCC4MACHO_LDFLAGS.profile  ?= -g
     107
     108
     109##
     110# Calculate the files in the debug bundle.
     111# @param    1           The whole output filename.
     112# @param    2           The output filename sans suffix.
     113TOOL_GCC4MACHO_DEBUG_BUNDLE_FN = \
     114    $(1).dSYM/ \
     115    $(1).dSYM/Contents/ \
     116    $(1).dSYM/Contents/Resources/ \
     117    $(1).dSYM/Contents/Resources/DWARF/ \
     118    $(1).dSYM/Contents/Info.plist \
     119    $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))
     120
     121##
     122# Calculate the files in the debug bundle.
     123# @param    1           The whole linker output filename.
     124# @param    2           The linker output filename sans suffix.
     125# @param    3           The desired install name (no dir slash).
     126TOOL_GCC4MACHO_DEBUG_INSTALL_FN= \
     127    $(3).dSYM/ \
     128    $(3).dSYM/Contents/ \
     129    $(3).dSYM/Contents/Resources/ \
     130    $(3).dSYM/Contents/Resources/DWARF/ \
     131    $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \
     132    $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(1))
    106133
    107134
     
    350377# @param    $(outbase)  Output basename (full). Use this for list files and such.
    351378TOOL_GCC4MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp
     379TOOL_GCC4MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out))
     380TOOL_GCC4MACHO_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN)
    352381TOOL_GCC4MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
    353382TOOL_GCC4MACHO_LINK_PROGRAM_DEPORD =
     
    358387                $(foreach p,$(libpath), -L$(p))\
    359388                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
    360 endef
     389 ifeq ($(ld_debug),split)
     390        $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out)
     391 endif
     392endef
     393
    361394
    362395
     
    375408# @param    $(outbase)  Output basename (full). Use this for list files and such.
    376409TOOL_GCC4MACHO_LINK_DLL_OUTPUT = $(outbase).rsp
     410TOOL_GCC4MACHO_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out))
     411TOOL_GCC4MACHO_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN)
    377412TOOL_GCC4MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
    378413TOOL_GCC4MACHO_LINK_DLL_DEPORD =
     
    384419                $(foreach p,$(libpath), -L$(p))\
    385420                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
     421 ifeq ($(ld_debug),split)
     422        $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out)
     423 endif
    386424endef
    387425
     
    401439# @param    $(outbase)  Output basename (full). Use this for list files and such.
    402440TOOL_GCC4MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp
     441TOOL_GCC4MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out))
     442TOOL_GCC4MACHO_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN)
    403443TOOL_GCC4MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
    404444TOOL_GCC4MACHO_LINK_SYSMOD_DEPORD =
     
    409449                $(foreach p,$(libpath), -L$(p))\
    410450                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
    411 endef
    412 
     451 ifeq ($(ld_debug),split)
     452        $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out)
     453 endif
     454endef
     455
Note: See TracChangeset for help on using the changeset viewer.