HOST_windows-x86.mk revision 668427c941bd88cacdf24d0562e6b68eb93038a1
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 Linux on x86. 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 22TOOLS_PREFIX := #prebuilt/windows/host/bin/ 23TOOLS_EXE_SUFFIX := .exe 24 25# Settings to use MinGW has a cross-compiler under Linux 26ifneq ($(findstring Linux,$(UNAME)),) 27ifneq ($(strip $(USE_MINGW)),) 28HOST_ACP_UNAVAILABLE := true 29TOOLS_EXE_SUFFIX := 30HOST_GLOBAL_CFLAGS += -DUSE_MINGW 31ifneq ($(strip $(BUILD_HOST_64bit)),) 32TOOLS_PREFIX := /usr/bin/amd64-mingw32msvc- 33HOST_C_INCLUDES += /usr/lib/gcc/amd64-mingw32msvc/4.4.2/include 34HOST_GLOBAL_LD_DIRS += -L/usr/amd64-mingw32msvc/lib 35else 36TOOLS_PREFIX := /usr/bin/i586-mingw32msvc- 37HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include 38HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib 39endif # BUILD_HOST_64bit 40endif # USE_MINGW 41endif # Linux 42 43# Workaround differences in inttypes.h between host and target. 44# See bug 12708004. 45HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 46 47HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX) 48HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX) 49HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX) 50 51HOST_GLOBAL_CFLAGS += -include $(call select-android-config-h,windows) 52HOST_GLOBAL_LDFLAGS += --enable-stdcall-fixup 53ifneq ($(strip $(BUILD_HOST_static)),) 54# Statically-linked binaries are desirable for sandboxed environment 55HOST_GLOBAL_LDFLAGS += -static 56endif # BUILD_HOST_static 57 58# when building under Cygwin, ensure that we use Mingw compilation by default. 59# you can disable this (i.e. to generate Cygwin executables) by defining the 60# USE_CYGWIN variable in your environment, e.g.: 61# 62# export USE_CYGWIN=1 63# 64# note that the -mno-cygwin flags are not needed when cross-compiling the 65# Windows host tools on Linux 66# 67ifneq ($(findstring CYGWIN,$(UNAME)),) 68ifeq ($(strip $(USE_CYGWIN)),) 69HOST_GLOBAL_CFLAGS += -mno-cygwin 70HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole 71endif 72endif 73 74HOST_SHLIB_SUFFIX := .dll 75HOST_EXECUTABLE_SUFFIX := .exe 76 77# $(1): The file to check 78# TODO: find out what format cygwin's stat(1) uses 79define get-file-size 80999999999 81endef 82