OS X build fixes; configure: improved
[sdk] / crossplatform.mk
index 28d725b..c6ffc2a 100644 (file)
@@ -135,6 +135,20 @@ ifdef ARCH
 
 endif
 
+# On Windows/32 bit systems, pass -m32 as TDM-GCC packaged with the installer produces 64 bit executables by default
+# Disable this if your compiler does not accept -m32
+ifndef ARCH
+ ifeq "$(HOST_PLATFORM)" "win32"
+  ifeq "$(TARGET_PLATFORM)" "win32"
+   ifndef ProgramFiles(x86)
+    ARCH := x32
+    TARGET_ARCH := i386
+    ARCH_FLAGS := -m32
+   endif
+  endif
+ endif
+endif
+
 # DEBUG SUFFIX
 ifdef DEBUG
 DEBUG_SUFFIX := .debug
@@ -278,7 +292,7 @@ ifndef REPOSITORY_VER
       else
          ifneq ($(shell $(GIT) log -n 1 --format="%%%%" $(nullerror)),)
             export GIT_REPOSITORY := yes
-            export REPOSITORY_VER := $(shell $(GIT) describe --tags --dirty="\ (dirty)" --always)
+            export REPOSITORY_VER := $(shell $(GIT) describe --tags --dirty=" (dirty)" --always)
          endif
       endif
    endif
@@ -298,7 +312,7 @@ ECSLIBOPT := $(if $(STATIC_LIBRARY_TARGET),-staticlib,$(if $(SHARED_LIBRARY_TARG
 FVISIBILITY := $(if $(WINDOWS_TARGET),,-fvisibility=hidden)
 FPIC := $(if $(WINDOWS_TARGET),,-fPIC)
 EXECUTABLE := $(if $(WINDOWS_TARGET),$(if $(EXECUTABLE_TARGET),$(CONSOLE),),)
-INSTALLNAME := $(if $(OSX_TARGET),$(if $(STATIC_LIBRARY_TARGET),-install_name $(LP)$(MODULE)$(SO),),)
+INSTALLNAME := $(if $(OSX_TARGET),$(if $(SHARED_LIBRARY_TARGET),-install_name $(LP)$(MODULE)$(SO),),)
 
 # LINKER OPTIONS
 SHAREDLIB := $(if $(SHARED_LIBRARY_TARGET),$(if $(OSX_TARGET),-dynamiclib -single_module -multiply_defined suppress,-shared),)