Ticket #6662: clang-framework.patch

File clang-framework.patch, 3.4 KB (added by bsantos@…, 11 years ago)
  • tools/build/v2/tools/clang-darwin.jam

    diff --git a/tools/build/v2/tools/clang-darwin.jam b/tools/build/v2/tools/clang-darwin.jam
    index a8abc7d..e43d933 100644
    a b import gcc ;  
    1313import common ;
    1414import errors ;
    1515import generators ;
     16import darwin ;
    1617
    1718feature.extend-subfeature toolset clang : platform : darwin ;
    1819
    SPACE = " " ;  
    7475
    7576flags clang-darwin.compile OPTIONS <cflags> ;
    7677flags clang-darwin.compile OPTIONS <cxxflags> ;
     78flags clang-darwin.compile FRAMEWORK <framework> ;
    7779# flags clang-darwin.compile INCLUDES <include> ;
    7880
    7981# Declare flags and action for compilation.
    toolset.flags clang-darwin.compile OPTIONS <debug-symbols>on : -g ;  
    9496toolset.flags clang-darwin.compile OPTIONS <profiling>on : -pg ;
    9597toolset.flags clang-darwin.compile OPTIONS <rtti>off : -fno-rtti ;
    9698
     99rule compile.c ( targets * : sources * : properties * )
     100{
     101  darwin.prepare-framework-path $(<) ;
     102}
     103
    97104actions compile.c
    98105{
    99     "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
     106    "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" $(FRAMEWORK_PATH) -c -o "$(<)" "$(>)"
     107}
     108
     109rule compile.c++ ( targets * : sources * : properties * )
     110{
     111  darwin.prepare-framework-path $(<) ;
    100112}
    101113
    102114actions compile.c++
    103115{
    104     "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
     116    "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" $(FRAMEWORK_PATH) -c -o "$(<)" "$(>)"
    105117}
    106118
    107119flags clang-darwin ARFLAGS <archiveflags> ;
    actions piecemeal archive  
    149161}
    150162
    151163flags clang-darwin.link USER_OPTIONS <linkflags> ;
     164flags clang-darwin.link FRAMEWORK <framework> ;
    152165
    153166# Declare actions for linking
    154167rule link ( targets * : sources * : properties * )
    rule link ( targets * : sources * : properties * )  
    157170  # Serialize execution of the 'link' action, since
    158171  # running N links in parallel is just slower.
    159172  JAM_SEMAPHORE on $(targets) = <s>clang-darwin-link-semaphore ;
     173  darwin.prepare-framework-path $(<) ;
    160174}
    161175
    162176actions link bind LIBRARIES
    163177{
    164     "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
     178    "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) -framework$(SPACE)$(FRAMEWORK:D=:S=) $(OPTIONS)
    165179}
    166180
    167181actions link.dll bind LIBRARIES
    168182{
    169     "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "$(<[1]:D=)" "$(>)"  "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
     183    "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "$(<[1]:D=)" "$(>)"  "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) -framework$(SPACE)$(FRAMEWORK:D=:S=) $(OPTIONS)
    170184}
  • tools/build/v2/tools/darwin.jam

    diff --git a/tools/build/v2/tools/darwin.jam b/tools/build/v2/tools/darwin.jam
    index dd6eacb..4955576 100644
    a b flags darwin.link FORCE_LOAD <force-load> ;  
    529529_ = " " ;
    530530
    531531# set up the -F option to include the paths to any frameworks used.
    532 local rule prepare-framework-path ( target + )
     532rule prepare-framework-path ( target + )
    533533{
    534534    # The -framework option only takes basename of the framework.
    535535    # The -F option specifies the directories where a framework