[haiku-commits] haiku: hrev52582 - build/jam headers/build src/build/libroot src/bin/rc headers/build/host/sunos

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 23 Nov 2018 16:30:49 -0500 (EST)

hrev52582 adds 3 changesets to branch 'master'
old head: 26b2733af3028208d332d50ab861a16ae12f8dfd
new head: d113c00b5ac2cc233ff95bc887d4a32194c91e62
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=d113c00b5ac2+%5E26b2733af302

----------------------------------------------------------------------------

37c106060a0a: 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.

807304b10037: build: Add basic support for MinGW hosts.
  
  This doesn't fully work yet (the FS code in libroot_build
  needs to be adapted, as some of the symlink-related calls
  are not available on MinGW), but it gets much further than
  the "Cygwin" target did.

d113c00b5ac2: Remove more HOST_PLATFORM_SUNOS cruft.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

16 files changed, 112 insertions(+), 142 deletions(-)
build/jam/BuildSetup                             | 36 ++++-----------
build/jam/MainBuildRules                         | 10 ++--
build/jam/OverriddenJamRules                     |  8 ++--
configure                                        |  3 +-
headers/build/BeOSBuildCompatibility.h           | 40 ++++++++--------
headers/build/host/mingw/endian.h                | 15 ++++++
headers/build/host/sunos/endian.h                | 22 ---------
src/bin/addattr/main.cpp                         |  6 ---
src/bin/keymap/main.cpp                          |  4 --
src/bin/mimeset.cpp                              |  4 --
src/bin/rc/rc.cpp                                | 48 +++++++++-----------
src/bin/setversion.cpp                           |  4 --
src/build/libroot/Jamfile                        |  2 +-
src/build/libroot/errors.cpp                     | 44 +++++++++++++-----
src/build/libsolv/Jamfile                        |  2 +
.../makebootable/platform/bios_ia32/Jamfile      |  6 +--

############################################################################

Commit:      37c106060a0a40f692cbe014e43bf6f4b68acd75
URL:         https://git.haiku-os.org/haiku/commit/?id=37c106060a0a
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Fri Nov 23 20:40:50 2018 UTC

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.

----------------------------------------------------------------------------

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 <ctype.h>
-#endif
-
-#ifdef HAIKU_HOST_PLATFORM_SUNOS
-#      include <limits.h>
-#      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 <build>makebootable : RAWT:666:BootCode : 
stage1.bin ;
 }
 
@@ -39,7 +38,6 @@ BuildPlatformMain <build>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 <build>makebootable : BootCode : raw : stage1.bin ;
 }

############################################################################

Commit:      807304b100372b8ac3d9a234fb7efa6fca8a6176
URL:         https://git.haiku-os.org/haiku/commit/?id=807304b10037
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Fri Nov 23 21:21:48 2018 UTC

build: Add basic support for MinGW hosts.

This doesn't fully work yet (the FS code in libroot_build
needs to be adapted, as some of the symlink-related calls
are not available on MinGW), but it gets much further than
the "Cygwin" target did.

----------------------------------------------------------------------------

diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
index 939bf12976..d0611404ff 100644
--- a/build/jam/BuildSetup
+++ b/build/jam/BuildSetup
@@ -242,7 +242,7 @@ HOST_UNARFLAGS              ?= x ;
 
 # check the host platform compatibility
 SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
-       : linux openbsd freebsd darwin ;
+       : linux openbsd freebsd darwin mingw ;
 HOST_PLATFORM_(host)_COMPATIBLE = 1 ;
 
 if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
@@ -670,6 +670,7 @@ 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 mingw              : HOST_DEFINES  += HAIKU_HOST_PLATFORM_MINGW ;
 }
 
 # define host platform 64 bit macro
diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules
index 5652f4503f..ab665d00e5 100644
--- a/build/jam/MainBuildRules
+++ b/build/jam/MainBuildRules
@@ -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) = mingw {
+               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/build/jam/OverriddenJamRules b/build/jam/OverriddenJamRules
index 599ba2003d..3caf99c64a 100644
--- a/build/jam/OverriddenJamRules
+++ b/build/jam/OverriddenJamRules
@@ -322,7 +322,7 @@ rule Cc
 
 actions Cc
 {
-       $(CC) $(CCFLAGS) -c "$(2)" $(CCDEFS) $(CCHDRS) -o "$(1)" ;
+       $(CC) $(CCFLAGS) -c "$(2)" $(CCDEFS) $(CCHDRS) -o "$(1)"
 }
 
 rule C++
@@ -399,13 +399,13 @@ rule C++
 
 actions C++
 {
-       $(C++) -c "$(2)" $(C++FLAGS) $(CCDEFS) $(CCHDRS) -o "$(1)" ;
+       $(C++) -c "$(2)" $(C++FLAGS) $(CCDEFS) $(CCHDRS) -o "$(1)"
 }
 
+# Force recreation of the archive to avoid build errors caused by
+# stale dependencies after renaming or deleting object files.
 actions together Archive
 {
-       # Force recreation of the archive to avoid build errors caused by
-       # stale dependencies after renaming or deleting object files.
        $(RM) $(<)
        $(AR) $(<) $(>)
 }
diff --git a/configure b/configure
old mode 100755
new mode 100644
index f21bc513bf..097abbaadf
--- a/configure
+++ b/configure
@@ -782,6 +782,7 @@ case "${platform}" in
        Haiku)  HOST_PLATFORM=haiku_host ;;
        Linux)  HOST_PLATFORM=linux ;;
        OpenBSD) HOST_PLATFORM=openbsd ;;
+       MINGW*) HOST_PLATFORM=mingw ;;
        *)              echo Unsupported platform: ${platform}
                        exit 1 ;;
 esac
diff --git a/headers/build/BeOSBuildCompatibility.h 
b/headers/build/BeOSBuildCompatibility.h
index fdc909d8e5..9217c34102 100644
--- a/headers/build/BeOSBuildCompatibility.h
+++ b/headers/build/BeOSBuildCompatibility.h
@@ -1,6 +1,21 @@
 #ifndef BEOS_BUILD_COMPATIBILITY_H
 #define BEOS_BUILD_COMPATIBILITY_H
 
+// These things have to be done before anything is included
+#if defined(HAIKU_HOST_PLATFORM_MINGW)
+#define _MODE_T_
+#define _POSIX_
+typedef int mode_t;
+
+#include <stdint.h>
+#include <limits.h>
+typedef uint32_t uid_t;
+typedef uint32_t gid_t;
+
+#include <io.h>
+#define mkdir(path, mode) mkdir(path)
+#endif
+
 // 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)
@@ -25,9 +40,12 @@ typedef unsigned long        haiku_build_addr_t;
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <sys/uio.h>
 #include <unistd.h>
 
+#if !defined(HAIKU_HOST_PLATFORM_MINGW)
+#include <sys/uio.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/headers/build/host/mingw/endian.h 
b/headers/build/host/mingw/endian.h
new file mode 100644
index 0000000000..912957b372
--- /dev/null
+++ b/headers/build/host/mingw/endian.h
@@ -0,0 +1,15 @@
+#ifndef _HAIKU_BUILD_COMPATIBILITY_MINGW_ENDIAN
+#define _HAIKU_BUILD_COMPATIBILITY_MINGW_ENDIAN
+
+
+// There's no <endian.h> in MinGW.
+
+#include <sys/param.h>
+
+#define        __LITTLE_ENDIAN LITTLE_ENDIAN
+#define        __BIG_ENDIAN    BIG_ENDIAN
+
+#define __BYTE_ORDER BYTE_ORDER
+
+
+#endif // _HAIKU_BUILD_COMPATIBILITY_MINGW_ENDIAN
diff --git a/headers/build/host/sunos/endian.h 
b/headers/build/host/sunos/endian.h
deleted file mode 100644
index 7676633959..0000000000
--- a/headers/build/host/sunos/endian.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN
-#define _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN
-
-// There's no <endian.h> in Solaris.
-
-#include <sys/byteorder.h>
-
-#define        __LITTLE_ENDIAN 1234
-#define        __BIG_ENDIAN    4321
-#define __PDP_ENDIAN   3412
-
-#if defined(_LITTLE_ENDIAN)
-#define        BYTE_ORDER              __LITTLE_ENDIAN
-#elif defined(_BIG_ENDIAN)
-#define        BYTE_ORDER              __BIG_ENDIAN
-#else
-#error Unable to determine byte order!
-#endif
-
-#define __BYTE_ORDER   BYTE_ORDER
-
-#endif // _HAIKU_BUILD_COMPATIBILITY_SUNOS_ENDIAN
diff --git a/src/build/libroot/errors.cpp b/src/build/libroot/errors.cpp
index e0691a963d..bd8aa7e299 100644
--- a/src/build/libroot/errors.cpp
+++ b/src/build/libroot/errors.cpp
@@ -49,7 +49,9 @@ init_error_map()
        ADD_ERROR(ERANGE);
        ADD_ERROR(EPROTOTYPE);
        ADD_ERROR(EPROTONOSUPPORT);
-       ADD_ERROR(EPFNOSUPPORT);
+       #ifdef EPFNOSUPPORT
+               ADD_ERROR(EPFNOSUPPORT);
+       #endif
        ADD_ERROR(EAFNOSUPPORT);
        ADD_ERROR(EADDRINUSE);
        ADD_ERROR(EADDRNOTAVAIL);
@@ -60,7 +62,9 @@ init_error_map()
        ADD_ERROR(ECONNRESET);
        ADD_ERROR(EISCONN);
        ADD_ERROR(ENOTCONN);
-       ADD_ERROR(ESHUTDOWN);
+       #ifdef ESHUTDOWN
+               ADD_ERROR(ESHUTDOWN);
+       #endif
        ADD_ERROR(ECONNREFUSED);
        ADD_ERROR(EHOSTUNREACH);
        ADD_ERROR(ENOPROTOOPT);
@@ -68,25 +72,41 @@ init_error_map()
        ADD_ERROR(EINPROGRESS);
        ADD_ERROR(EALREADY);
        ADD_ERROR(EILSEQ);
-       ADD_ERROR(ENOMSG);
-       ADD_ERROR(ESTALE);
+       #ifdef ENOMSG
+               ADD_ERROR(ENOMSG);
+       #endif
+       #ifdef ESTALE
+               ADD_ERROR(ESTALE);
+       #endif
        ADD_ERROR(EOVERFLOW);
        ADD_ERROR(EMSGSIZE);
        ADD_ERROR(EOPNOTSUPP);
        ADD_ERROR(ENOTSOCK);
-       ADD_ERROR(EHOSTDOWN);
-       ADD_ERROR(EBADMSG);
+       #ifdef EHOSTDOWN
+               ADD_ERROR(EHOSTDOWN);
+       #endif
+       #ifdef EBADMSG
+               ADD_ERROR(EBADMSG);
+       #endif
        #ifdef ECANCELED
                ADD_ERROR(ECANCELED);
        #endif
        ADD_ERROR(EDESTADDRREQ);
-       ADD_ERROR(EDQUOT);
-       ADD_ERROR(EIDRM);
-       ADD_ERROR(EMULTIHOP);
+       #ifdef EDQUOT
+               ADD_ERROR(EDQUOT);
+       #endif
+       #ifdef EIDRM
+               ADD_ERROR(EIDRM);
+       #endif
+       #ifdef EMULTIHOP
+               ADD_ERROR(EMULTIHOP);
+       #endif
        #ifdef ENODATA
                ADD_ERROR(ENODATA);
        #endif
-       ADD_ERROR(ENOLINK);
+       #ifdef ENOLINK
+               ADD_ERROR(ENOLINK);
+       #endif
        #ifdef ENOSR
                ADD_ERROR(ENOSR);
        #endif
@@ -98,7 +118,9 @@ init_error_map()
        #ifdef ETIME
                ADD_ERROR(ETIME);
        #endif
-       ADD_ERROR(ETXTBSY);
+       #ifdef ETXTBSY
+               ADD_ERROR(ETXTBSY);
+       #endif
        ADD_ERROR(ENOMEM);
        ADD_ERROR(EACCES);
        ADD_ERROR(EINTR);
diff --git a/src/build/libsolv/Jamfile b/src/build/libsolv/Jamfile
index 3cedcf7d79..5571267b4b 100644
--- a/src/build/libsolv/Jamfile
+++ b/src/build/libsolv/Jamfile
@@ -33,6 +33,8 @@ switch $(HOST_PLATFORM) {
                DEFINES += HAVE_STRCHRNUL HAVE_FUNOPEN ;
        case darwin :
                DEFINES += HAVE_FUNOPEN HAVE_QSORT_R ;
+       case mingw :
+               DEFINES += ;
        case * :
                Exit $(SUBDIR)/Jamfile: "Please add a case for your platform"
                        "($(HOST_PLATFORM))!" ;

############################################################################

Revision:    hrev52582
Commit:      d113c00b5ac2cc233ff95bc887d4a32194c91e62
URL:         https://git.haiku-os.org/haiku/commit/?id=d113c00b5ac2
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Fri Nov 23 21:29:57 2018 UTC

Remove more HOST_PLATFORM_SUNOS cruft.

----------------------------------------------------------------------------

diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
index d0611404ff..229f5a9a55 100644
--- a/build/jam/BuildSetup
+++ b/build/jam/BuildSetup
@@ -503,12 +503,8 @@ if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
        HOST_NETWORK_LIBS = network ;
        HOST_NETAPI_LIB = bnetapi ;
        HOST_SELECT_UNAME_ETC_LIB = ;   # libroot
-} else if $(HOST_PLATFORM) = "sunos" {
-       HOST_NETWORK_LIBS = xnet ;
-       HOST_NETAPI_LIB = ;
-       HOST_SELECT_UNAME_ETC_LIB = ;
 } else {
-       # Linux,...
+       # Linux, ...
        HOST_NETWORK_LIBS = ;
        HOST_NETAPI_LIB = ;
        HOST_SELECT_UNAME_ETC_LIB = ;
diff --git a/src/bin/addattr/main.cpp b/src/bin/addattr/main.cpp
index 1f03d40193..385f728cd3 100644
--- a/src/bin/addattr/main.cpp
+++ b/src/bin/addattr/main.cpp
@@ -29,14 +29,8 @@ static struct option const kLongOptions[] = {
 };
 
 
-#ifndef HAIKU_HOST_PLATFORM_SUNOS
 extern const char *__progname;
-#endif
-#ifdef HAIKU_HOST_PLATFORM_SUNOS
-static const char *kProgramName = "addattr";
-#else
 static const char *kProgramName = __progname;
-#endif
 
 
 // supported types (if you add any, make sure that writeAttr() handles
diff --git a/src/bin/keymap/main.cpp b/src/bin/keymap/main.cpp
index 7746d99ba2..a22d3d5ac2 100644
--- a/src/bin/keymap/main.cpp
+++ b/src/bin/keymap/main.cpp
@@ -19,12 +19,8 @@
 #include "Keymap.h"
 
 
-#ifdef HAIKU_HOST_PLATFORM_SUNOS
-static const char *sProgramName = "keymap";
-#else
 extern char *__progname;
 static const char *sProgramName = __progname;
-#endif
 
 
 static void
diff --git a/src/bin/mimeset.cpp b/src/bin/mimeset.cpp
index 18f5b7640e..b83b4a96f9 100644
--- a/src/bin/mimeset.cpp
+++ b/src/bin/mimeset.cpp
@@ -24,12 +24,8 @@
 using namespace BPrivate::Storage::Mime;
 
 
-#ifdef HAIKU_HOST_PLATFORM_SUNOS
-static const char* sProgramName = "mimeset";
-#else
 extern const char* __progname;
 static const char* sProgramName = __progname;
-#endif
 
 // options
 bool gFiles = true;
diff --git a/src/bin/rc/rc.cpp b/src/bin/rc/rc.cpp
index b24e2df834..bbc605b9cc 100644
--- a/src/bin/rc/rc.cpp
+++ b/src/bin/rc/rc.cpp
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Matthijs Hollemans
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a 
- * copy of this software and associated documentation files (the "Software"), 
- * to deal in the Software without restriction, including without limitation 
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- * and/or sell copies of the Software, and to permit persons to whom the 
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in 
+ *
+ * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
@@ -29,16 +29,10 @@
 #include "rdef.h"
 
 
-#ifndef HAIKU_HOST_PLATFORM_SUNOS
 extern const char *__progname;
-#endif
 
 static const char *kTitle = "Haiku Resource Compiler 1.1";
-#ifdef HAIKU_HOST_PLATFORM_SUNOS
-static const char *kProgramName = "rc";
-#else
 static const char *kProgramName = __progname;
-#endif
 
 
 static bool sQuiet = false;
@@ -81,7 +75,7 @@ error(const char *format, ...)
 }
 
 
-static void 
+static void
 usage()
 {
        printf("%s\n\n"
@@ -133,7 +127,7 @@ version()
 }
 
 
-static bool 
+static bool
 has_extension(char *name, const char *ext)
 {
        size_t nameLength = strlen(name);
@@ -242,7 +236,7 @@ parse_options(int argc, char *argv[])
        }
 
        if (sOutputFile[0] == '\0') {
-               // no output file name was given, use the name of the 
+               // no output file name was given, use the name of the
                // first source file as base
                strlcpy(sOutputFile, sFirstInputFile, sizeof(sOutputFile));
 
@@ -252,7 +246,7 @@ parse_options(int argc, char *argv[])
 }
 
 
-static void 
+static void
 compile()
 {
        if (!has_extension(sOutputFile, ".rsrc"))
@@ -262,7 +256,7 @@ compile()
 }
 
 
-static void 
+static void
 decompile()
 {
        if (!has_extension(sOutputFile, ".rdef"))
@@ -272,7 +266,7 @@ decompile()
 }
 
 
-static void 
+static void
 report_error()
 {
        switch (rdef_err) {
diff --git a/src/bin/setversion.cpp b/src/bin/setversion.cpp
index 1c56fbfbd3..b27ba12762 100644
--- a/src/bin/setversion.cpp
+++ b/src/bin/setversion.cpp
@@ -15,13 +15,9 @@
 #include <string.h>
 
 
-#ifdef HAIKU_HOST_PLATFORM_SUNOS
-const char *kProgramName = "setversion";
-#else
 extern const char *__progname;
 
 const char *kProgramName = __progname;
-#endif
 
 
 enum arg_needed {


Other related posts:

  • » [haiku-commits] haiku: hrev52582 - build/jam headers/build src/build/libroot src/bin/rc headers/build/host/sunos - waddlesplash