VirtualBox

Changeset 2623 in kBuild


Ignore:
Timestamp:
Aug 5, 2012 2:38:18 AM (13 years ago)
Author:
bird
Message:

MINGWW64.kmk: MinGW-W64 experiments.

File:
1 copied

Legend:

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

    r2611 r2623  
    11# $Id$
    22## @file
    3 # kBuild Tool Config - MinGW32 GCC v3.3+.
    4 #
    5 
    6 #
    7 # Copyright (c) 2004-2010 knut st. osmundsen <[email protected]>
     3# kBuild Tool Config - MinGW-W64.
     4#
     5
     6#
     7# Copyright (c) 2004-2012 knut st. osmundsen <[email protected]>
    88#
    99# This file is part of kBuild.
     
    3232#
    3333
    34 ifdef TOOL_MINGW32
    35 $(error Already included (TOOL_MINGW32=$(TOOL_MINGW32)))
    36 endif
    37 TOOL_MINGW32 := MinGW32 GCC v3.3+.
     34ifdef TOOL_MINGWW64
     35$(error Already included (TOOL_MINGWW64=$(TOOL_MINGWW64)))
     36endif
     37TOOL_MINGWW64 := MinGW-W64 - The incomprehensible 64-bit GCC port to Windows.
    3838
    3939# Tool Specific Properties
    40 ifndef PATH_TOOL_MINGW32
    41  PATH_TOOL_MINGW32 := $(wildcard $(PATH_DEVTOOLS_BLD)/mingw32/v*.*)
    42  ifeq ($(PATH_TOOL_MINGW32),)
    43   PATH_TOOL_MINGW32 := $(wildcard $(PATH_DEVTOOLS)/win.x86/mingw32/v*.*)
    44  endif
    45  ifeq ($(PATH_TOOL_MINGW32),)
    46   PATH_TOOL_MINGW32 := $(wildcard $(PATH_DEVTOOLS)/x86.win32/mingw32/v*.*)
    47  endif
    48  ifneq ($(PATH_TOOL_MINGW32),)
    49   PATH_TOOL_MINGW32 := $(lastword $(sort $(PATH_TOOL_MINGW32)))
     40ifndef PATH_TOOL_MINGWW64
     41 PATH_TOOL_MINGWW64 := $(wildcard $(PATH_DEVTOOLS_BLD)/mingw-w64/r*)
     42 ifeq ($(PATH_TOOL_MINGWW64),)
     43  PATH_TOOL_MINGWW64 := $(wildcard $(PATH_DEVTOOLS)/win.amd64/mingw-w64/r*)
     44 endif
     45 ifeq ($(PATH_TOOL_MINGWW64),)
     46  PATH_TOOL_MINGWW64 := $(wildcard $(PATH_DEVTOOLS)/win.x86/mingw-w64/r*)
     47 endif
     48 ifneq ($(PATH_TOOL_MINGWW64),)
     49  PATH_TOOL_MINGWW64 := $(lastword $(sort $(PATH_TOOL_MINGWW64)))
    5050 endif
    5151else
    5252 # Resolve any fancy stuff once and for all.
    53  PATH_TOOL_MINGW32 := $(PATH_TOOL_MINGW32)
     53 PATH_TOOL_MINGWW64 := $(PATH_TOOL_MINGWW64)
    5454endif
    5555
    5656# figure out if it's native or needs a win32 launcher
    57 TOOL_MINGW32_HOSTSUFF_EXE ?= $(HOSTSUFF_EXE)
    58 ifndef TOOL_MINGW32_PREFIX
    59  ifneq ($(PATH_TOOL_MINGW32),)
    60   TOOL_MINGW32_PREFIX := $(PATH_TOOL_MINGW32)/bin/
     57TOOL_MINGWW64_HOSTSUFF_EXE ?= $(HOSTSUFF_EXE)
     58ifndef TOOL_MINGWW64_PREFIX
     59 ifneq ($(PATH_TOOL_MINGWW64),)
     60  TOOL_MINGWW64_PREFIX := $(PATH_TOOL_MINGWW64)/bin/
    6161 else
    62   TOOL_MINGW32_PREFIX :=
     62  TOOL_MINGWW64_PREFIX :=
    6363 endif
    6464 ifneq ($(KBUILD_HOST),win)
    65   # we're cross compiling either using an emulator (wine/odin) or a cross compiler.
    66   ifneq ($(PATH_TOOL_MINGW32),$(subst /win.x86,,$(subst /x86.win,,$(PATH_TOOL_MINGW32))))
    67    TOOL_MINGW32_PREFIX := $(EXEC_X86_WIN32) $(TOOL_MINGW32_PREFIX)
    68    TOOL_MINGW32_HOSTSUFF_EXE := .exe
    69   else
    70    TOOL_MINGW32_PREFIX := $(TOOL_MINGW32_PREFIX)i386-mingw32msvc-
    71    TOOL_MINGW32_HOSTSUFF_EXE :=
    72    TOOL_MINGW32_XCOMPILE := 1
    73   endif
     65#  # we're cross compiling either using an emulator (wine/odin) or a cross compiler.
     66#  ifneq ($(PATH_TOOL_MINGWW64),$(subst /win.x86,,$(subst /x86.win,,$(PATH_TOOL_MINGWW64))))
     67   TOOL_MINGWW64_PREFIX := $(EXEC_X86_WIN32) $(TOOL_MINGWW64_PREFIX)
     68   TOOL_MINGWW64_HOSTSUFF_EXE := .exe
     69#  else
     70#   TOOL_MINGWW64_PREFIX := $(TOOL_MINGWW64_PREFIX)i386-mingw32msvc-
     71#   TOOL_MINGWW64_HOSTSUFF_EXE :=
     72#   TOOL_MINGWW64_XCOMPILE := 1
     73#  endif
    7474 endif
    7575else
    7676 # Resolve any fancy stuff once and for all.
    77  TOOL_MINGW32_PREFIX := $(TOOL_MINGW32_PREFIX)
    78 endif
    79 
    80 TOOL_MINGW32_CC  ?= $(TOOL_MINGW32_PREFIX)gcc$(TOOL_MINGW32_HOSTSUFF_EXE)
    81 TOOL_MINGW32_CXX ?= $(TOOL_MINGW32_PREFIX)g++$(TOOL_MINGW32_HOSTSUFF_EXE)
    82 TOOL_MINGW32_AS  ?= $(TOOL_MINGW32_PREFIX)gcc$(TOOL_MINGW32_HOSTSUFF_EXE)
    83 TOOL_MINGW32_AR  ?= $(TOOL_MINGW32_PREFIX)ar$(TOOL_MINGW32_HOSTSUFF_EXE)
    84 ifndef TOOL_MINGW32_XCOMPILE# The gentoo package doesn't have g++.
    85 TOOL_MINGW32_LD  ?= $(TOOL_MINGW32_PREFIX)g++$(TOOL_MINGW32_HOSTSUFF_EXE)
     77 TOOL_MINGWW64_PREFIX := $(TOOL_MINGWW64_PREFIX)
     78endif
     79
     80TOOL_MINGWW64_CC  ?= $(TOOL_MINGWW64_PREFIX)gcc$(TOOL_MINGWW64_HOSTSUFF_EXE)
     81TOOL_MINGWW64_CXX ?= $(TOOL_MINGWW64_PREFIX)g++$(TOOL_MINGWW64_HOSTSUFF_EXE)
     82TOOL_MINGWW64_AS  ?= $(TOOL_MINGWW64_PREFIX)gcc$(TOOL_MINGWW64_HOSTSUFF_EXE)
     83TOOL_MINGWW64_AR  ?= $(TOOL_MINGWW64_PREFIX)ar$(TOOL_MINGWW64_HOSTSUFF_EXE)
     84ifndef TOOL_MINGWW64_XCOMPILE# The gentoo package doesn't have g++.
     85TOOL_MINGWW64_LD  ?= $(TOOL_MINGWW64_PREFIX)g++$(TOOL_MINGWW64_HOSTSUFF_EXE)
    8686else
    87 TOOL_MINGW32_LD  ?= $(TOOL_MINGW32_PREFIX)gcc$(TOOL_MINGW32_HOSTSUFF_EXE)
    88 endif
    89 TOOL_MINGW32_DLLWRAP ?= $(TOOL_MINGW32_PREFIX)dllwrap$(TOOL_MINGW32_HOSTSUFF_EXE)
    90 TOOL_MINGW32_DLLTOOL ?= $(TOOL_MINGW32_PREFIX)dlltool$(TOOL_MINGW32_HOSTSUFF_EXE)
     87TOOL_MINGWW64_LD  ?= $(TOOL_MINGWW64_PREFIX)gcc$(TOOL_MINGWW64_HOSTSUFF_EXE)
     88endif
     89TOOL_MINGWW64_DLLWRAP ?= $(TOOL_MINGWW64_PREFIX)dllwrap$(TOOL_MINGWW64_HOSTSUFF_EXE)
     90TOOL_MINGWW64_DLLTOOL ?= $(TOOL_MINGWW64_PREFIX)dlltool$(TOOL_MINGWW64_HOSTSUFF_EXE)
    9191
    9292# General Properties used by kBuild
    93 TOOL_MINGW32_COBJSUFF           ?= .o
    94 TOOL_MINGW32_CFLAGS             ?= -g
    95 TOOL_MINGW32_CFLAGS.debug       ?= -O0
    96 TOOL_MINGW32_CFLAGS.release     ?= -O2
    97 TOOL_MINGW32_CFLAGS.profile     ?= -O2 #-pg
    98 TOOL_MINGW32_CINCS              ?=
    99 TOOL_MINGW32_CDEFS              ?=
    100 
    101 TOOL_MINGW32_CXXOBJSUFF         ?= .o
    102 TOOL_MINGW32_CXXOBJSUFF         ?= .o
    103 TOOL_MINGW32_CXXFLAGS           ?= -g
    104 TOOL_MINGW32_CXXFLAGS.debug     ?= -O0
    105 TOOL_MINGW32_CXXFLAGS.release   ?= -O2
    106 TOOL_MINGW32_CXXFLAGS.profile   ?= -O2 #-pg
    107 TOOL_MINGW32_CXXINCS            ?=
    108 TOOL_MINGW32_CXXDEFS            ?=
    109 
    110 TOOL_MINGW32_ASFLAGS            ?= -g -x assembler-with-cpp
    111 TOOL_MINGW32_ASOBJSUFF          ?= .o
    112 
    113 TOOL_MINGW32_ARFLAGS            ?= cr
    114 TOOL_MINGW32_ARLIBSUFF          ?= .a
    115 
    116 TOOL_MINGW32_LDFLAGS            ?=
    117 TOOL_MINGW32_LDFLAGS.debug      ?= -g
    118 TOOL_MINGW32_LDFLAGS.release    ?= -s
     93TOOL_MINGWW64_COBJSUFF           ?= .o
     94TOOL_MINGWW64_CFLAGS             ?= -g
     95TOOL_MINGWW64_CFLAGS.debug       ?= -O0
     96TOOL_MINGWW64_CFLAGS.release     ?= -O2
     97TOOL_MINGWW64_CFLAGS.profile     ?= -O2 #-pg
     98TOOL_MINGWW64_CINCS              ?=
     99TOOL_MINGWW64_CDEFS              ?=
     100
     101TOOL_MINGWW64_CXXOBJSUFF         ?= .o
     102TOOL_MINGWW64_CXXOBJSUFF         ?= .o
     103TOOL_MINGWW64_CXXFLAGS           ?= -g
     104TOOL_MINGWW64_CXXFLAGS.debug     ?= -O0
     105TOOL_MINGWW64_CXXFLAGS.release   ?= -O2
     106TOOL_MINGWW64_CXXFLAGS.profile   ?= -O2 #-pg
     107TOOL_MINGWW64_CXXINCS            ?=
     108TOOL_MINGWW64_CXXDEFS            ?=
     109
     110TOOL_MINGWW64_ASFLAGS            ?= -g -x assembler-with-cpp
     111TOOL_MINGWW64_ASOBJSUFF          ?= .o
     112
     113TOOL_MINGWW64_ARFLAGS            ?= cr
     114TOOL_MINGWW64_ARLIBSUFF          ?= .a
     115
     116TOOL_MINGWW64_LDFLAGS            ?=
     117TOOL_MINGWW64_LDFLAGS.debug      ?= -g
     118TOOL_MINGWW64_LDFLAGS.release    ?= -s
    119119
    120120
     
    131131# @param    $(outbase)  Output basename (full). Use this for list files and such.
    132132# @param    $(objsuff)  Object suffix.
    133 TOOL_MINGW32_COMPILE_C_OUTPUT =
    134 TOOL_MINGW32_COMPILE_C_DEPEND =
    135 TOOL_MINGW32_COMPILE_C_DEPORD =
    136 define TOOL_MINGW32_COMPILE_C_CMDS
    137         $(QUIET)$(TOOL_MINGW32_CC) -c\
     133TOOL_MINGWW64_COMPILE_C_OUTPUT =
     134TOOL_MINGWW64_COMPILE_C_DEPEND =
     135TOOL_MINGWW64_COMPILE_C_DEPORD =
     136define TOOL_MINGWW64_COMPILE_C_CMDS
     137        $(QUIET)$(TOOL_MINGWW64_CC) -c\
    138138                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    139139                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
     
    155155# @param    $(outbase)  Output basename (full). Use this for list files and such.
    156156# @param    $(objsuff)  Object suffix.
    157 TOOL_MINGW32_COMPILE_CXX_OUTPUT =
    158 TOOL_MINGW32_COMPILE_CXX_DEPEND =
    159 TOOL_MINGW32_COMPILE_CXX_DEPORD =
    160 define TOOL_MINGW32_COMPILE_CXX_CMDS
    161         $(QUIET)$(TOOL_MINGW32_CXX) -c\
     157TOOL_MINGWW64_COMPILE_CXX_OUTPUT =
     158TOOL_MINGWW64_COMPILE_CXX_DEPEND =
     159TOOL_MINGWW64_COMPILE_CXX_DEPORD =
     160define TOOL_MINGWW64_COMPILE_CXX_CMDS
     161        $(QUIET)$(TOOL_MINGWW64_CXX) -c\
    162162                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    163163                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
     
    180180# @param    $(objsuff)  Object suffix.
    181181#
    182 TOOL_MINGW32_COMPILE_AS_OUTPUT =
    183 TOOL_MINGW32_COMPILE_AS_DEPEND =
    184 TOOL_MINGW32_COMPILE_AS_DEPORD =
    185 define TOOL_MINGW32_COMPILE_AS_CMDS
    186         $(QUIET)$(TOOL_MINGW32_AS) -c\
     182TOOL_MINGWW64_COMPILE_AS_OUTPUT =
     183TOOL_MINGWW64_COMPILE_AS_DEPEND =
     184TOOL_MINGWW64_COMPILE_AS_DEPORD =
     185define TOOL_MINGWW64_COMPILE_AS_CMDS
     186        $(QUIET)$(TOOL_MINGWW64_AS) -c\
    187187                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    188188                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
     
    201201#
    202202# @param    $(outbase)  Output basename (full). Use this for list files and such.
    203 TOOL_MINGW32_LINK_LIBRARY_OUTPUT = $(out).ar-script
    204 TOOL_MINGW32_LINK_LIBRARY_DEPEND = $(othersrc)
    205 TOOL_MINGW32_LINK_LIBRARY_DEPORD =
    206 define TOOL_MINGW32_LINK_LIBRARY_CMDS
     203TOOL_MINGWW64_LINK_LIBRARY_OUTPUT = $(out).ar-script
     204TOOL_MINGWW64_LINK_LIBRARY_DEPEND = $(othersrc)
     205TOOL_MINGWW64_LINK_LIBRARY_DEPORD =
     206define TOOL_MINGWW64_LINK_LIBRARY_CMDS
    207207        $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
    208208        $(QUIET)$(APPEND) -n $(out).ar-script \
     
    211211        $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
    212212        $(QUIET)$(APPEND) $(out).ar-script 'END'
    213         $(QUIET)$(TOOL_MINGW32_AR) -M < $(out).ar-script
     213        $(QUIET)$(TOOL_MINGWW64_AR) -M < $(out).ar-script
    214214endef
    215215
     
    230230#
    231231# @param    $(outbase)  Output basename (full). Use this for list files and such.
    232 TOOL_MINGW32_LINK_PROGRAM_OUTPUT =
    233 TOOL_MINGW32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
    234 TOOL_MINGW32_LINK_PROGRAM_DEPORD =
    235 define TOOL_MINGW32_LINK_PROGRAM_CMDS
    236         $(QUIET)$(TOOL_MINGW32_LD) $(flags) -o $(out) $(objs)\
     232TOOL_MINGWW64_LINK_PROGRAM_OUTPUT =
     233TOOL_MINGWW64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     234TOOL_MINGWW64_LINK_PROGRAM_DEPORD =
     235define TOOL_MINGWW64_LINK_PROGRAM_CMDS
     236        $(QUIET)$(TOOL_MINGWW64_LD) $(flags) -o $(out) $(objs)\
    237237                $(foreach p,$(libpath), -L$(p))\
    238238                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
     
    253253# @param    $(custom_post)  Custom step invoked after linking.
    254254# @param    $(outbase)  Output basename (full). Use this for list files and such.
    255 TOOL_MINGW32_LINK_DLL_OUTPUT =
    256 TOOL_MINGW32_LINK_DLL_OUTPUT_MAYBE = $(outbase).a $(outbase).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).a
     255TOOL_MINGWW64_LINK_DLL_OUTPUT =
     256TOOL_MINGWW64_LINK_DLL_OUTPUT_MAYBE = $(outbase).a $(outbase).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).a
    257257## @todo Find a better solution for installing the extra files (.a, .exp, .pdb, etc).
    258 TOOL_MINGW32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     258TOOL_MINGWW64_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
    259259        $(filter %.def %.res,$(othersrc))
    260 TOOL_MINGW32_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
    261 define TOOL_MINGW32_LINK_DLL_CMDS
    262         $(QUIET)$(TOOL_MINGW32_DLLWRAP) $(flags)\
     260TOOL_MINGWW64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
     261define TOOL_MINGWW64_LINK_DLL_CMDS
     262        $(QUIET)$(TOOL_MINGWW64_DLLWRAP) $(flags)\
    263263                --dllname=$(out)\
    264264                --output-exp=$(outbase).exp\
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette