configure & build: Add basic support for building with MSYS.
Also remove the MINGW support, as it was far too incomplete. This *should* work under case-sensitive NTFS, but instead, it seems #14963 occurs. So perhaps there is a GCC bug related to case-sensitive vs. case-insensitivity after all.
This commit is contained in:
@@ -216,7 +216,7 @@ HOST_UNARFLAGS ?= x ;
|
|||||||
|
|
||||||
# check the host platform compatibility
|
# check the host platform compatibility
|
||||||
SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
|
SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
|
||||||
: linux openbsd freebsd darwin mingw ;
|
: linux openbsd freebsd darwin msys ;
|
||||||
HOST_PLATFORM_(host)_COMPATIBLE = 1 ;
|
HOST_PLATFORM_(host)_COMPATIBLE = 1 ;
|
||||||
|
|
||||||
if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
|
if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
|
||||||
@@ -400,7 +400,7 @@ if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
|
|||||||
} else {
|
} else {
|
||||||
HOST_LINKFLAGS += -lm -ldl ;
|
HOST_LINKFLAGS += -lm -ldl ;
|
||||||
HOST_LIBSTDC++ = stdc++ ;
|
HOST_LIBSTDC++ = stdc++ ;
|
||||||
if $(HOST_PLATFORM) = mingw {
|
if $(HOST_PLATFORM) = msys {
|
||||||
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
|
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
|
||||||
= "PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
|
= "PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
|
||||||
} else if $(HOST_PLATFORM) = darwin {
|
} else if $(HOST_PLATFORM) = darwin {
|
||||||
@@ -635,7 +635,7 @@ switch $(HOST_PLATFORM) {
|
|||||||
case linux : HOST_DEFINES += HAIKU_HOST_PLATFORM_LINUX ;
|
case linux : HOST_DEFINES += HAIKU_HOST_PLATFORM_LINUX ;
|
||||||
case freebsd : HOST_DEFINES += HAIKU_HOST_PLATFORM_FREEBSD ;
|
case freebsd : HOST_DEFINES += HAIKU_HOST_PLATFORM_FREEBSD ;
|
||||||
case darwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_DARWIN ;
|
case darwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_DARWIN ;
|
||||||
case mingw : HOST_DEFINES += HAIKU_HOST_PLATFORM_MINGW ;
|
case msys : HOST_DEFINES += HAIKU_HOST_PLATFORM_MSYS ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# define host platform 64 bit macro
|
# define host platform 64 bit macro
|
||||||
|
|||||||
@@ -686,9 +686,6 @@ rule BuildPlatformSharedLibrary
|
|||||||
if $(HOST_PLATFORM) = darwin {
|
if $(HOST_PLATFORM) = darwin {
|
||||||
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
||||||
-dynamic -dynamiclib -Xlinker -flat_namespace ;
|
-dynamic -dynamiclib -Xlinker -flat_namespace ;
|
||||||
} else if $(HOST_PLATFORM) = mingw {
|
|
||||||
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
|
||||||
-shared -Xlinker --allow-multiple-definition ;
|
|
||||||
} else {
|
} else {
|
||||||
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
||||||
-shared -Xlinker -soname=\"$(target:G=)\" ;
|
-shared -Xlinker -soname=\"$(target:G=)\" ;
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ check_native_xattrs()
|
|||||||
xattr_set="setextattr"; xattr_set_args="user \$NAME \"\$VALUE\""
|
xattr_set="setextattr"; xattr_set_args="user \$NAME \"\$VALUE\""
|
||||||
xattr_get="getextattr"; xattr_get_args="user \$NAME"
|
xattr_get="getextattr"; xattr_get_args="user \$NAME"
|
||||||
;;
|
;;
|
||||||
linux)
|
linux|msys)
|
||||||
xattr_set="setfattr"; xattr_set_args="-n user.\$NAME -v \"\$VALUE\""
|
xattr_set="setfattr"; xattr_set_args="-n user.\$NAME -v \"\$VALUE\""
|
||||||
xattr_get="getfattr"; xattr_get_args="-n user.\$NAME"
|
xattr_get="getfattr"; xattr_get_args="-n user.\$NAME"
|
||||||
;;
|
;;
|
||||||
@@ -585,7 +585,7 @@ case "${platform}" in
|
|||||||
Haiku) HOST_PLATFORM=haiku_host ;;
|
Haiku) HOST_PLATFORM=haiku_host ;;
|
||||||
Linux) HOST_PLATFORM=linux ;;
|
Linux) HOST_PLATFORM=linux ;;
|
||||||
OpenBSD) HOST_PLATFORM=openbsd ;;
|
OpenBSD) HOST_PLATFORM=openbsd ;;
|
||||||
MINGW*) HOST_PLATFORM=mingw ;;
|
MSYS*) HOST_PLATFORM=msys ;;
|
||||||
*) echo Unsupported platform: ${platform}
|
*) echo Unsupported platform: ${platform}
|
||||||
exit 1 ;;
|
exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,22 +1,7 @@
|
|||||||
#ifndef BEOS_BUILD_COMPATIBILITY_H
|
#ifndef BEOS_BUILD_COMPATIBILITY_H
|
||||||
#define BEOS_BUILD_COMPATIBILITY_H
|
#define BEOS_BUILD_COMPATIBILITY_H
|
||||||
|
|
||||||
// These things have to be done before anything is included
|
// DEFFILEMODE is not available on platforms with MUSL
|
||||||
#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
|
#ifndef DEFFILEMODE
|
||||||
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
|
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
|
||||||
#endif
|
#endif
|
||||||
@@ -33,6 +18,10 @@ typedef uint32_t gid_t;
|
|||||||
typedef unsigned long haiku_build_addr_t;
|
typedef unsigned long haiku_build_addr_t;
|
||||||
#define addr_t haiku_build_addr_t
|
#define addr_t haiku_build_addr_t
|
||||||
|
|
||||||
|
#if defined(HAIKU_HOST_PLATFORM_MSYS)
|
||||||
|
#define __addr_t_defined
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Errors.h>
|
#include <Errors.h>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -41,10 +30,7 @@ typedef unsigned long haiku_build_addr_t;
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if !defined(HAIKU_HOST_PLATFORM_MINGW)
|
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -62,11 +48,6 @@ extern size_t strlcat(char* dest, const char* source, size_t length);
|
|||||||
extern size_t strnlen(const char* string, size_t length);
|
extern size_t strnlen(const char* string, size_t length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAIKU_HOST_PLATFORM_MINGW)
|
|
||||||
extern char* stpcpy(char* dest, const char* src);
|
|
||||||
extern char* strcasestr(const char* s, const char* find);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// BeOS only
|
// BeOS only
|
||||||
extern ssize_t read_pos(int fd, off_t pos, void* buffer, size_t count);
|
extern ssize_t read_pos(int fd, off_t pos, void* buffer, size_t count);
|
||||||
extern ssize_t write_pos(int fd, off_t pos, const void* buffer, size_t count);
|
extern ssize_t write_pos(int fd, off_t pos, const void* buffer, size_t count);
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
#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
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
// Include the interface to the host platform attributes support, if it shall be
|
// Include the interface to the host platform attributes support, if it shall be
|
||||||
// used to tag files with unique IDs to identify their attribute directory.
|
// used to tag files with unique IDs to identify their attribute directory.
|
||||||
#if HAIKU_HOST_USE_XATTR_REF
|
#if HAIKU_HOST_USE_XATTR_REF
|
||||||
# if defined(HAIKU_HOST_PLATFORM_LINUX)
|
# if defined(HAIKU_HOST_PLATFORM_LINUX) || defined(HAIKU_HOST_PLATFORM_MSYS)
|
||||||
# include "fs_attr_xattr.h"
|
# include "fs_attr_xattr.h"
|
||||||
# elif defined(HAIKU_HOST_PLATFORM_FREEBSD)
|
# elif defined(HAIKU_HOST_PLATFORM_FREEBSD)
|
||||||
# include "fs_attr_extattr.h"
|
# include "fs_attr_extattr.h"
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ switch $(HOST_PLATFORM) {
|
|||||||
DEFINES += HAVE_STRCHRNUL HAVE_FUNOPEN ;
|
DEFINES += HAVE_STRCHRNUL HAVE_FUNOPEN ;
|
||||||
case darwin :
|
case darwin :
|
||||||
DEFINES += HAVE_FUNOPEN HAVE_QSORT_R ;
|
DEFINES += HAVE_FUNOPEN HAVE_QSORT_R ;
|
||||||
case mingw :
|
case msys :
|
||||||
DEFINES += ;
|
DEFINES += HAVE_STRCHRNUL HAVE_QSORT_R HAVE_FOPENCOOKIE ;
|
||||||
case * :
|
case * :
|
||||||
Exit $(SUBDIR)/Jamfile: "Please add a case for your platform"
|
Exit $(SUBDIR)/Jamfile: "Please add a case for your platform"
|
||||||
"($(HOST_PLATFORM))!" ;
|
"($(HOST_PLATFORM))!" ;
|
||||||
|
|||||||
Reference in New Issue
Block a user