Browse Source

Update library naming for RISC-V and MIPS64 support

hl_urbicide
Alibek Omarov 3 years ago
parent
commit
d7123abd50
  1. 33
      cmake/LibraryNaming.cmake
  2. 31
      scripts/waifulib/library_naming.py

33
cmake/LibraryNaming.cmake

@ -1,6 +1,7 @@
include(CheckSymbolExists) include(CheckSymbolExists)
# generated(see comments in public/build.h) # generated(see comments in public/build.h)
# cat build.h | grep '^#undef XASH' | awk '{ print "check_symbol_exists(" $2 " \"build.h\" " $2 ")" }'
set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/") set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/")
check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT) check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT)
check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64) check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64)
@ -16,9 +17,11 @@ check_symbol_exists(XASH_ARMv7 "build.h" XASH_ARMv7)
check_symbol_exists(XASH_ARMv8 "build.h" XASH_ARMv8) check_symbol_exists(XASH_ARMv8 "build.h" XASH_ARMv8)
check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN) check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN)
check_symbol_exists(XASH_BSD "build.h" XASH_BSD) check_symbol_exists(XASH_BSD "build.h" XASH_BSD)
check_symbol_exists(XASH_DOS4GW "build.h" XASH_DOS4GW)
check_symbol_exists(XASH_E2K "build.h" XASH_E2K) check_symbol_exists(XASH_E2K "build.h" XASH_E2K)
check_symbol_exists(XASH_EMSCRIPTEN "build.h" XASH_EMSCRIPTEN) check_symbol_exists(XASH_EMSCRIPTEN "build.h" XASH_EMSCRIPTEN)
check_symbol_exists(XASH_FREEBSD "build.h" XASH_FREEBSD) check_symbol_exists(XASH_FREEBSD "build.h" XASH_FREEBSD)
check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU)
check_symbol_exists(XASH_IOS "build.h" XASH_IOS) check_symbol_exists(XASH_IOS "build.h" XASH_IOS)
check_symbol_exists(XASH_JS "build.h" XASH_JS) check_symbol_exists(XASH_JS "build.h" XASH_JS)
check_symbol_exists(XASH_LINUX "build.h" XASH_LINUX) check_symbol_exists(XASH_LINUX "build.h" XASH_LINUX)
@ -29,7 +32,11 @@ check_symbol_exists(XASH_MOBILE_PLATFORM "build.h" XASH_MOBILE_PLATFORM)
check_symbol_exists(XASH_MSVC "build.h" XASH_MSVC) check_symbol_exists(XASH_MSVC "build.h" XASH_MSVC)
check_symbol_exists(XASH_NETBSD "build.h" XASH_NETBSD) check_symbol_exists(XASH_NETBSD "build.h" XASH_NETBSD)
check_symbol_exists(XASH_OPENBSD "build.h" XASH_OPENBSD) check_symbol_exists(XASH_OPENBSD "build.h" XASH_OPENBSD)
check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU) check_symbol_exists(XASH_POSIX "build.h" XASH_POSIX)
check_symbol_exists(XASH_RISCV "build.h" XASH_RISCV)
check_symbol_exists(XASH_RISCV_DOUBLEFP "build.h" XASH_RISCV_DOUBLEFP)
check_symbol_exists(XASH_RISCV_SINGLEFP "build.h" XASH_RISCV_SINGLEFP)
check_symbol_exists(XASH_RISCV_SOFTFP "build.h" XASH_RISCV_SOFTFP)
check_symbol_exists(XASH_WIN32 "build.h" XASH_WIN32) check_symbol_exists(XASH_WIN32 "build.h" XASH_WIN32)
check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64) check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64)
check_symbol_exists(XASH_X86 "build.h" XASH_X86) check_symbol_exists(XASH_X86 "build.h" XASH_X86)
@ -81,10 +88,28 @@ elseif(XASH_ARM)
else() else()
set(BUILDARCH "${BUILDARCH}l") set(BUILDARCH "${BUILDARCH}l")
endif() endif()
elseif(XASH_MIPS AND XASH_BIG_ENDIAN) elseif(XASH_MIPS)
set(BUILDARCH "mips") set(BUILDARCH "mips")
elseif(XASH_MIPS AND XASH_LITTLE_ENDIAN) if(XASH_64BIT)
set(BUILDARCH "mipsel") set(BUILDARCH "${BUILDARCH}64")
endif()
if(XASH_LITTLE_ENDIAN)
set(BUILDARCH "${BUILDARCH}el")
endif()
elseif(XASH_RISCV)
set(BUILDARCH "riscv")
if(XASH_64BIT)
set(BUILDARCH "${BUILDARCH}64")
else()
set(BUILDARCH "${BUILDARCH}32")
endif()
if(XASH_RISCV_DOUBLEFP)
set(BUILDARCH "${BUILDARCH}d")
elseif(XASH_RISCV_SINGLEFP)
set(BUILDARCH "${BUILDARCH}f")
endif()
elseif(XASH_JS) elseif(XASH_JS)
set(BUILDARCH "javascript") set(BUILDARCH "javascript")
elseif(XASH_E2K) elseif(XASH_E2K)

31
scripts/waifulib/library_naming.py

@ -19,6 +19,8 @@ int main(int argc, char** argv)
} }
''' '''
# generated(see comments in public/build.h)
# cat build.h | grep '^#undef XASH' | awk '{ print "'\''" $2 "'\''," }'
DEFINES = [ DEFINES = [
'XASH_64BIT', 'XASH_64BIT',
'XASH_AMD64', 'XASH_AMD64',
@ -34,9 +36,11 @@ DEFINES = [
'XASH_ARMv8', 'XASH_ARMv8',
'XASH_BIG_ENDIAN', 'XASH_BIG_ENDIAN',
'XASH_BSD', 'XASH_BSD',
'XASH_DOS4GW',
'XASH_E2K', 'XASH_E2K',
'XASH_EMSCRIPTEN', 'XASH_EMSCRIPTEN',
'XASH_FREEBSD', 'XASH_FREEBSD',
'XASH_HAIKU',
'XASH_IOS', 'XASH_IOS',
'XASH_JS', 'XASH_JS',
'XASH_LINUX', 'XASH_LINUX',
@ -47,12 +51,14 @@ DEFINES = [
'XASH_MSVC', 'XASH_MSVC',
'XASH_NETBSD', 'XASH_NETBSD',
'XASH_OPENBSD', 'XASH_OPENBSD',
'XASH_HAIKU', 'XASH_POSIX',
'XASH_RISCV',
'XASH_RISCV_DOUBLEFP',
'XASH_RISCV_SINGLEFP',
'XASH_RISCV_SOFTFP',
'XASH_WIN32', 'XASH_WIN32',
'XASH_WIN64', 'XASH_WIN64',
'XASH_X86', 'XASH_X86',
'XASH_DOS4GW',
'XASH_POSIX'
] ]
def configure(conf): def configure(conf):
@ -111,10 +117,23 @@ def configure(conf):
buildarch += "hf" buildarch += "hf"
else: else:
buildarch += "l" buildarch += "l"
elif conf.env.XASH_MIPS and conf.env.XASH_BIG_ENDIAN: elif conf.env.XASH_MIPS:
buildarch = "mips" buildarch = "mips"
elif conf.env.XASH_MIPS and conf.env.XASH_LITTLE_ENDIAN: if conf.env.XASH_64BIT:
buildarch = "mipsel" buildarch += "64"
if conf.env.XASH_LITTLE_ENDIAN:
buildarch += "el"
elif conf.env.XASH_RISCV:
buildarch = "riscv"
if conf.env.XASH_64BIT:
buildarch += "64"
else:
buildarch += "32"
if conf.env.XASH_RISCV_DOUBLEFP:
buildarch += "d"
elif conf.env.XASH_RISCV_SINGLEFP:
buildarch += "f"
elif conf.env.XASH_JS: elif conf.env.XASH_JS:
buildarch = "javascript" buildarch = "javascript"
elif conf.env.XASH_E2K: elif conf.env.XASH_E2K:

Loading…
Cancel
Save