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.
This commit is contained in:
Augustin Cavalier
2018-11-23 16:24:25 -05:00
parent 37c106060a
commit 807304b100
9 changed files with 79 additions and 42 deletions
+2 -1
View File
@@ -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
+3 -3
View File
@@ -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=)\" ;
+4 -4
View File
@@ -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) $(<) $(>)
}