From 37c106060a0a40f692cbe014e43bf6f4b68acd75 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 23 Nov 2018 15:40:50 -0500 Subject: [PATCH] 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. --- build/jam/BuildSetup | 29 ++++--------------- build/jam/MainBuildRules | 14 ++++----- configure | 2 -- headers/build/BeOSBuildCompatibility.h | 24 ++------------- src/build/libroot/Jamfile | 2 +- .../makebootable/platform/bios_ia32/Jamfile | 6 ++-- 6 files changed, 19 insertions(+), 58 deletions(-) diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index b4939b58c6..939bf12976 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -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 diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules index b85b2d3398..5652f4503f 100644 --- a/build/jam/MainBuildRules +++ b/build/jam/MainBuildRules @@ -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=)\" ; diff --git a/configure b/configure index 701684a800..f21bc513bf 100755 --- a/configure +++ b/configure @@ -782,8 +782,6 @@ case "${platform}" in Haiku) HOST_PLATFORM=haiku_host ;; Linux) HOST_PLATFORM=linux ;; OpenBSD) HOST_PLATFORM=openbsd ;; - SunOS) HOST_PLATFORM=sunos ;; - CYGWIN_NT-*) HOST_PLATFORM=cygwin ;; *) echo Unsupported platform: ${platform} exit 1 ;; esac diff --git a/headers/build/BeOSBuildCompatibility.h b/headers/build/BeOSBuildCompatibility.h index 582f97e1cb..fdc909d8e5 100644 --- a/headers/build/BeOSBuildCompatibility.h +++ b/headers/build/BeOSBuildCompatibility.h @@ -1,20 +1,12 @@ #ifndef BEOS_BUILD_COMPATIBILITY_H #define BEOS_BUILD_COMPATIBILITY_H -#if defined(HAIKU_HOST_PLATFORM_CYGWIN) -# ifndef __addr_t_defined -# define __addr_t_defined -# endif -#endif - -// DEFFILEMODE is not available on Cygwin, SunOS and when building with musl c -#if defined(HAIKU_HOST_PLATFORM_CYGWIN) || defined(HAIKU_HOST_PLATFORM_SUNOS) \ - || !defined(DEFFILEMODE) +// DEFFILEMODE is not available on MinGW and on platforms with MUSL #ifndef DEFFILEMODE #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) #endif -// There's no ALLPERMS when building with musl c +// There's no ALLPERMS on platforms with MUSL #ifndef ALLPERMS # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) #endif @@ -23,16 +15,6 @@ #define S_IUMSK 07777 #endif -#include -#endif - -#ifdef HAIKU_HOST_PLATFORM_SUNOS -# include -# ifndef NAME_MAX -# define NAME_MAX MAXNAMELEN -# endif -#endif - typedef unsigned long haiku_build_addr_t; #define addr_t haiku_build_addr_t @@ -62,7 +44,7 @@ extern size_t strlcat(char* dest, const char* source, size_t length); extern size_t strnlen(const char* string, size_t length); #endif -#if defined(HAIKU_HOST_PLATFORM_CYGWIN) || defined(HAIKU_HOST_PLATFORM_SUNOS) +#if defined(HAIKU_HOST_PLATFORM_MINGW) extern char* stpcpy(char* dest, const char* src); extern char* strcasestr(const char* s, const char* find); #endif diff --git a/src/build/libroot/Jamfile b/src/build/libroot/Jamfile index 1d22d3cd33..779126bad0 100644 --- a/src/build/libroot/Jamfile +++ b/src/build/libroot/Jamfile @@ -40,7 +40,7 @@ if $(HOST_PLATFORM) != darwin && $(HOST_PLATFORM) != haiku_host { strlSources = strlcpy.c strlcat.c ; } -if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos { +if $(HOST_PLATFORM) = mingw { strlSources += stpcpy.c strcasestr.c ; } diff --git a/src/tools/makebootable/platform/bios_ia32/Jamfile b/src/tools/makebootable/platform/bios_ia32/Jamfile index f64aeaad0e..68045206f1 100644 --- a/src/tools/makebootable/platform/bios_ia32/Jamfile +++ b/src/tools/makebootable/platform/bios_ia32/Jamfile @@ -27,8 +27,7 @@ if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd || $(HOST_PLATFORM) = # Write the stage 1 boot loader into the makebootable resources. On Darwin # resources don't seem to work; there we use an attribute instead. -if $(HOST_PLATFORM) != darwin && $(HOST_PLATFORM) != cygwin - && $(HOST_PLATFORM) != sunos { +if $(HOST_PLATFORM) != darwin && $(HOST_PLATFORM) != mingw { AddFileDataResource makebootable : RAWT:666:BootCode : stage1.bin ; } @@ -39,7 +38,6 @@ BuildPlatformMain makebootable : ; # on Darwin write the boot loader code into an attribute -if $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin - || $(HOST_PLATFORM) = sunos { +if $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = mingw { AddFileDataAttribute makebootable : BootCode : raw : stage1.bin ; }