build: Remove support for cross-building from Cygwin and SunOS.

These have been broken for a long time. Some Cygwin changes that
are relevant on MinGW are kept here, but users on Windows who
want to build Haiku should probably use WSL at this point.

However, now that we are using relative paths and don't need
to worry about drive path kludges, it's actually possible to
get some host tools built on MinGW. Changes for that coming.
This commit is contained in:
Augustin Cavalier
2018-11-23 15:40:50 -05:00
parent 26b2733af3
commit 37c106060a
6 changed files with 19 additions and 58 deletions
+6 -23
View File
@@ -242,23 +242,17 @@ HOST_UNARFLAGS ?= x ;
# check the host platform compatibility
SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
: linux openbsd freebsd darwin sunos cygwin ;
: linux openbsd freebsd darwin ;
HOST_PLATFORM_(host)_COMPATIBLE = 1 ;
if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
|| $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin
|| $(HOST_PLATFORM) = sunos || $(HOST_PLATFORM) = openbsd {
|| $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = openbsd {
# don't use lex: otherwise rc will not work correctly
if $(LEX) = lex {
LEX = flex ;
}
}
if $(HOST_PLATFORM) = cygwin {
HOST_LINKFLAGS += -Xlinker --allow-multiple-definition -Xlinker
--enable-auto-import ;
}
HOST_CPU ?= $(OSPLAT:L) ;
# Jam doesn't know x86_64, so override HOST_CPU, if 64 bit.
@@ -304,10 +298,8 @@ HOST_ASFLAGS = ;
HOST_CCFLAGS += -Wno-multichar ;
HOST_C++FLAGS += -Wno-multichar ;
if $(HOST_PLATFORM) != cygwin {
HOST_PIC_CCFLAGS += -fPIC ;
HOST_PIC_C++FLAGS += -fPIC ;
}
HOST_PIC_CCFLAGS += -fPIC ;
HOST_PIC_C++FLAGS += -fPIC ;
if $(HOST_GCC_VERSION[1]) >= 3 {
HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-delete-null-pointer-checks ;
@@ -433,7 +425,7 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
} else {
HOST_LINKFLAGS += -lm -ldl ;
HOST_LIBSTDC++ = stdc++ ;
if $(HOST_PLATFORM) = cygwin {
if $(HOST_PLATFORM) = mingw {
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
= "export PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
} else if $(HOST_PLATFORM) = darwin {
@@ -444,14 +436,7 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
= "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
}
if $(HOST_PLATFORM) = cygwin {
# not needed
HOST_PTHREAD_LINKFLAGS = ;
} else if $(HOST_PLATFORM) = freebsd {
HOST_PTHREAD_LINKFLAGS = -pthread ;
} else {
HOST_PTHREAD_LINKFLAGS = -pthread ;
}
HOST_PTHREAD_LINKFLAGS = -pthread ;
# the C++ support library
if $(HOST_GCC_VERSION[1]) < 3 {
@@ -685,8 +670,6 @@ switch $(HOST_PLATFORM) {
case linux : HOST_DEFINES += HAIKU_HOST_PLATFORM_LINUX ;
case freebsd : HOST_DEFINES += HAIKU_HOST_PLATFORM_FREEBSD ;
case darwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_DARWIN ;
case cygwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_CYGWIN ;
case sunos : HOST_DEFINES += HAIKU_HOST_PLATFORM_SUNOS ;
}
# define host platform 64 bit macro
+7 -7
View File
@@ -621,7 +621,7 @@ rule BuildPlatformObjects
Objects $(sources) ;
}
actions CygwinExtensionFix
actions Win32ExtensionFix
{
if test -f $(1).exe ; then
rm -f $(1)
@@ -658,14 +658,14 @@ rule BuildPlatformMain
Main $(target) : $(sources) ;
LinkAgainst $(target) : $(libs) ;
if $(HOST_PLATFORM) = cygwin {
# Cygwin gcc adds the ".exe" extension. We cannot force
if $(HOST_PLATFORM) = mingw {
# MinGW GCC adds the ".exe" extension. We cannot force
# jam to use SUFEXE as haiku target executables are not
# supposed to have this extension, thus finding
# dependencies will fail for these.
# The hack is to remove the extension after a successful
# build of the Target.
CygwinExtensionFix $(target) ;
Win32ExtensionFix $(target) ;
}
}
@@ -685,9 +685,9 @@ rule BuildPlatformSharedLibrary
if $(HOST_PLATFORM) = darwin {
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
-dynamic -dynamiclib -Xlinker -flat_namespace ;
} else if $(HOST_PLATFORM) = cygwin {
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
-shared -Xlinker --allow-multiple-definition ;
# } else if $(HOST_PLATFORM) = cygwin {
# LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
# -shared -Xlinker --allow-multiple-definition ;
} else {
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
-shared -Xlinker -soname=\"$(target:G=)\" ;