Changeset 21767


Ignore:
Timestamp:
Oct 31, 2011, 4:38:42 PM (14 years ago)
Author:
dmik
Message:

Use ImpDef tool to modify .def file for import library generation.

This is necessary so that the import library give access to DLL exports
using their internal names (from the sources) rather than external ones
(presented in the DLL).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/Config.kmk

    r21756 r21767  
    88
    99##
    10 # Defines import library target for the given DLL.
     10# Defines an import library target for the given DLL target.
     11#
    1112# @param 1 DLL target name.
    12 # @param 2 .def file (defaults to <param 1>.def).
    13 # @param 3 .def file for debug (defaults to <param 2>).
     13# @param 2 .def file (defaults to <1>.def).
     14# @param 3 .def file for debug (defaults to <2>).
    1415#
    15 define odin_implib
     16odin_implib = $(evalcall odin_implib_common,$(1),$(2),$(3))
     17
     18define odin_implib_common
     19    local target := $(1)
     20        local def := $(if $(2),$(2),$(1).def)
     21        local def_exp := $(basename $(def)).exp.def
     22ifneq ($(3),)
     23    local def_debug := $(3)
     24        local def_exp_debug := $$$$($(1)_imp_0_OUTDIR)/$(basename $(def_debug)).exp.def
     25endif
    1626    $(eval $(def_odin_implib))
    1727endef
    1828
    1929define def_odin_implib
    20     LIBRARIES += $(1)_imp
    21     $(1)_imp_TEMPLATE = OdinCxx
    22     $(1)_imp_NAME     = $(1)
    23 ifeq ($(3),)
    24     $(1)_imp_SOURCES  = $(if $(2),$(2),$(1).def)
     30    LIBRARIES += $(target)_imp
     31    $(target)_imp_TEMPLATE = OdinCxx
     32    $(target)_imp_NAME     = $(target)
     33ifeq ($(def_exp_debug),)
     34    $(target)_imp_SOURCES  = $$($(target)_imp_0_OUTDIR)/$(def_exp)
     35    $$$$($(target)_imp_0_OUTDIR)/$(def_exp): $(def) | $$$$(dir $$$$@)
     36                $$(PATH_STAGE_BIN)/impdef $$< $$@
     37    $(target)_imp_CLEAN   += $$($(target)_imp_0_OUTDIR)/$(def_exp)
    2538else
    26     $(1)_imp_SOURCES.release = $(if $(2),$(2),$(1).def)
    27     $(1)_imp_SOURCES.debug   = $(3)
     39    $(target)_imp_SOURCES.release  = $(def_exp)
     40    $(def_exp): $(def) | $$$$(dir $$$$@)
     41                $$(PATH_STAGE_BIN)/impdef $$< $$@
     42    $(target)_imp_CLEAN   += $(def_exp)
     43    $(target)_imp_SOURCES.debug   = $(def_exp_debug)
     44    $(def_exp_debug): $(def_debug) | $$$$(dir $$$$@)
     45                $$(PATH_STAGE_BIN)/impdef $$< $$@
     46    $(target)_imp_CLEAN   += $(def_exp_debug)
    2847endif
    2948endef
    3049
    3150##
    32 # Shortcut to $(call odin_implib, <param 1>, <param 1>.def, <param 1>dbg.def).
     51# Shortcut to $(evalcall odin_implib, <1>, <1>.def, <1>dbg.def).
     52#
    3353# @param 1 DLL target name.
    3454#
    35 define odin_implib_2
    36     $(call odin_implib, $(1), $(1).def, $(1)dbg.def)
    37 endef
     55# @note Must be called with $(evalcall).
     56#
     57odin_implib_2 = $(call odin_implib,$(1),$(1).def,$(1)dbg.def)
    3858
     59#
    3960# Handler for Wine RC (.orc) source files
     61#
    4062KBUILD_SRC_HANDLERS += .orc:def_src_handler_wrc
    4163define def_src_handler_wrc
     
    4466endef
    4567
     68#
    4669# Override handler for .asm files to compile them with the MASM-compilant tool
     70#
    4771KBUILD_SRC_HANDLERS := .asm:def_src_handler_masm $(KBUILD_SRC_HANDLERS)
    4872define def_src_handler_masm
     
    5579#------------------------------------------------------------------------------
    5680
     81#
    5782# Add support for Wine RC to the GCC compiler
     83#
    5884TOOL_GXX3OMF_WRC                = $(PATH_STAGE_BIN)/winerc.exe
    5985TOOL_GXX3OMF_WRCOBJSUFF         = $(TOOL_GXX3OMF_COBJSUFF)
Note: See TracChangeset for help on using the changeset viewer.