aboutsummaryrefslogtreecommitdiff
path: root/depends/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'depends/hosts')
-rw-r--r--depends/hosts/darwin.mk8
-rw-r--r--depends/hosts/default.mk23
-rw-r--r--depends/hosts/linux.mk23
-rw-r--r--depends/hosts/mingw32.mk2
4 files changed, 56 insertions, 0 deletions
diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk
new file mode 100644
index 0000000000..9e2415655e
--- /dev/null
+++ b/depends/hosts/darwin.mk
@@ -0,0 +1,8 @@
+OSX_MIN_VERSION=10.6
+OSX_SDK_VERSION=10.7
+OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk
+darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK)
+darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK)
+darwin_CFLAGS=-pipe -O2
+darwin_CXXFLAGS=$(darwin_CFLAGS)
+darwin_native_toolchain=native_cctools
diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk
new file mode 100644
index 0000000000..b9fe5d858a
--- /dev/null
+++ b/depends/hosts/default.mk
@@ -0,0 +1,23 @@
+default_host_CC = $(host_toolchain)gcc
+default_host_CXX = $(host_toolchain)g++
+default_host_AR = $(host_toolchain)ar
+default_host_RANLIB = $(host_toolchain)ranlib
+default_host_STRIP = $(host_toolchain)strip
+default_host_LIBTOOL = $(host_toolchain)libtool
+default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool
+default_host_OTOOL = $(host_toolchain)otool
+default_host_NM = $(host_toolchain)nm
+
+define add_host_tool_func
+$(host_os)_$1?=$$(default_host_$1)
+$(host_arch)_$(host_os)_$1?=$$($(host_os)_$1)
+host_$1=$$($(host_arch)_$(host_os)_$1)
+endef
+
+define add_host_flags_func
+$(host_arch)_$(host_os)_$1 += $($(host_os)_$1)
+host_$1 = $$($(host_arch)_$(host_os)_$1)
+endef
+
+$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool))))
+$(foreach flags,CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))
diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk
new file mode 100644
index 0000000000..194d71d557
--- /dev/null
+++ b/depends/hosts/linux.mk
@@ -0,0 +1,23 @@
+linux_CFLAGS=-pipe -O2
+linux_CXXFLAGS=$(linux_CFLAGS)
+
+ifeq (86,$(findstring 86,$(build_arch)))
+i686_linux_CC=gcc -m32
+i686_linux_CXX=g++ -m32
+i686_linux_AR=ar
+i686_linux_RANLIB=ranlib
+i686_linux_NM=nm
+i686_linux_STRIP=strip
+
+x86_64_linux_CC=gcc -m64
+x86_64_linux_CXX=g++ -m64
+x86_64_linux_AR=ar
+x86_64_linux_RANLIB=ranlib
+x86_64_linux_NM=nm
+x86_64_linux_STRIP=strip
+else
+i686_linux_CC=$(default_host_CC) -m32
+i686_linux_CXX=$(default_host_CXX) -m32
+x86_64_linux_CC=$(default_host_CC) -m64
+x86_64_linux_CXX=$(default_host_CXX) -m64
+endif
diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk
new file mode 100644
index 0000000000..ffe4a55842
--- /dev/null
+++ b/depends/hosts/mingw32.mk
@@ -0,0 +1,2 @@
+mingw32_CFLAGS=-pipe -O2
+mingw32_CXXFLAGS=$(mingw32_CFLAGS)