mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 23:05:27 +00:00
ported Nim to proprietary CrossOS [backport] (#18889)
This commit is contained in:
@@ -74,6 +74,8 @@ _nimBuildCsourcesIfNeeded(){
|
||||
makeX=gmake
|
||||
elif [ "$unamestr" = 'NetBSD' ]; then
|
||||
makeX=gmake
|
||||
elif [ "$unamestr" = 'CROSSOS' ]; then
|
||||
makeX=gmake
|
||||
else
|
||||
makeX=make
|
||||
fi
|
||||
|
||||
@@ -13,6 +13,7 @@ Platforms: """
|
||||
netbsd: i386;amd64
|
||||
openbsd: i386;amd64;arm;arm64
|
||||
dragonfly: i386;amd64
|
||||
crossos: amd64
|
||||
haiku: i386;amd64
|
||||
android: i386;arm;arm64
|
||||
nintendoswitch: arm64
|
||||
|
||||
@@ -577,11 +577,13 @@ proc isDefined*(conf: ConfigRef; symbol: string): bool =
|
||||
osQnx, osAtari, osAix,
|
||||
osHaiku, osVxWorks, osSolaris, osNetbsd,
|
||||
osFreebsd, osOpenbsd, osDragonfly, osMacosx, osIos,
|
||||
osAndroid, osNintendoSwitch, osFreeRTOS}
|
||||
osAndroid, osNintendoSwitch, osFreeRTOS, osCrossos}
|
||||
of "linux":
|
||||
result = conf.target.targetOS in {osLinux, osAndroid}
|
||||
of "bsd":
|
||||
result = conf.target.targetOS in {osNetbsd, osFreebsd, osOpenbsd, osDragonfly}
|
||||
result = conf.target.targetOS in {osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osCrossos}
|
||||
of "freebsd":
|
||||
result = conf.target.targetOS in {osFreebsd, osCrossos}
|
||||
of "emulatedthreadvars":
|
||||
result = platform.OS[conf.target.targetOS].props.contains(ospLacksThreadVars)
|
||||
of "msdos": result = conf.target.targetOS == osDos
|
||||
|
||||
@@ -20,7 +20,7 @@ type
|
||||
TSystemOS* = enum # Also add OS in initialization section and alias
|
||||
# conditionals to condsyms (end of module).
|
||||
osNone, osDos, osWindows, osOs2, osLinux, osMorphos, osSkyos, osSolaris,
|
||||
osIrix, osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osAix, osPalmos, osQnx,
|
||||
osIrix, osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osCrossos, osAix, osPalmos, osQnx,
|
||||
osAmiga, osAtari, osNetware, osMacos, osMacosx, osIos, osHaiku, osAndroid, osVxWorks
|
||||
osGenode, osJS, osNimVM, osStandalone, osNintendoSwitch, osFreeRTOS, osAny
|
||||
|
||||
@@ -105,6 +105,10 @@ const
|
||||
scriptExt: ".sh", curDir: ".",
|
||||
exeExt: "", extSep: ".",
|
||||
props: {ospNeedsPIC, ospPosix}),
|
||||
(name: "CROSSOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
|
||||
objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/",
|
||||
scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".",
|
||||
props: {ospNeedsPIC, ospPosix}),
|
||||
(name: "AIX", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
|
||||
objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/",
|
||||
scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".",
|
||||
|
||||
@@ -3007,7 +3007,7 @@ when not weirdTarget and (defined(freebsd) or defined(dragonfly) or defined(netb
|
||||
proc sysctl(name: ptr cint, namelen: cuint, oldp: pointer, oldplen: ptr csize_t,
|
||||
newp: pointer, newplen: csize_t): cint
|
||||
{.importc: "sysctl",header: """#include <sys/types.h>
|
||||
#include <sys/sysctl.h>"""}
|
||||
#include <sys/sysctl.h>""".}
|
||||
const
|
||||
CTL_KERN = 1
|
||||
KERN_PROC = 14
|
||||
|
||||
@@ -109,6 +109,11 @@ case $uos in
|
||||
CC="clang"
|
||||
LINK_FLAGS="$LINK_FLAGS -lm"
|
||||
;;
|
||||
*crossos* )
|
||||
myos="crossos"
|
||||
CC="clang"
|
||||
LINK_FLAGS="$LINK_FLAGS -lm"
|
||||
;;
|
||||
*openbsd* )
|
||||
myos="openbsd"
|
||||
CC="clang"
|
||||
|
||||
Reference in New Issue
Block a user