Home | History | Annotate | Download | only in combo
      1 #
      2 # Copyright (C) 2006 The Android Open Source Project
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #      http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 #
     16 
     17 # Configuration for Windows on x86_64.
     18 # Included by combo/select.make
     19 
     20 # right now we get these from the environment, but we should
     21 # pick them from the tree somewhere
     22 TOOLS_PREFIX := #prebuilt/windows/host/bin/
     23 TOOLS_EXE_SUFFIX := .exe
     24 
     25 # Settings to use MinGW has a cross-compiler under Linux
     26 ifneq ($(findstring Linux,$(UNAME)),)
     27 ifneq ($(strip $(USE_MINGW)),)
     28 HOST_ACP_UNAVAILABLE := true
     29 TOOLS_EXE_SUFFIX :=
     30 HOST_GLOBAL_CFLAGS += -DUSE_MINGW
     31 TOOLS_PREFIX := /usr/bin/amd64-mingw32msvc-
     32 HOST_C_INCLUDES += /usr/lib/gcc/amd64-mingw32msvc/4.4.2/include
     33 HOST_GLOBAL_LD_DIRS += -L/usr/amd64-mingw32msvc/lib
     34 endif # USE_MINGW
     35 endif # Linux
     36 
     37 # Workaround differences in inttypes.h between host and target.
     38 # See bug 12708004.
     39 HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO
     40 
     41 HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
     42 HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
     43 HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
     44 
     45 HOST_GLOBAL_CFLAGS += -include $(call select-android-config-h,windows)
     46 HOST_GLOBAL_LDFLAGS += --enable-stdcall-fixup
     47 ifneq ($(strip $(BUILD_HOST_static)),)
     48 # Statically-linked binaries are desirable for sandboxed environment
     49 HOST_GLOBAL_LDFLAGS += -static
     50 endif # BUILD_HOST_static
     51 
     52 # when building under Cygwin, ensure that we use Mingw compilation by default.
     53 # you can disable this (i.e. to generate Cygwin executables) by defining the
     54 # USE_CYGWIN variable in your environment, e.g.:
     55 #
     56 #   export USE_CYGWIN=1
     57 #
     58 # note that the -mno-cygwin flags are not needed when cross-compiling the
     59 # Windows host tools on Linux
     60 #
     61 ifneq ($(findstring CYGWIN,$(UNAME)),)
     62 ifeq ($(strip $(USE_CYGWIN)),)
     63 HOST_GLOBAL_CFLAGS += -mno-cygwin
     64 HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
     65 endif
     66 endif
     67