option(BUILD_SHARED_LIBS "Default to building shared libraries" ON)
option(BUILD_STATIC_LIBS "Default to building static libraries" ON)
-if (BUILD_SHARED_LIBS)
- add_definitions(-D JSON_C_DLL)
-endif()
-
# Generate a release merge and test it to verify the correctness of republishing the package.
ADD_CUSTOM_TARGET(distcheck
COMMAND make package_source
option(NEWLOCALE_NEEDS_FREELOCALE "Work around newlocale bugs in old FreeBSD by calling freelocale" OFF)
option(BUILD_APPS "Default to building apps" ON)
-
-if (UNIX OR MINGW OR CYGWIN)
+if (UNIX OR MINGW OR CYGWIN OR AMIGA)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "AmigaOS")
- set(AMIGA 1)
+ set(AMIGA ON)
set(DISABLE_THREAD_LOCAL_STORAGE ON)
set(ENABLE_THREADING OFF)
+ set(BUILD_SHARED_LIBS OFF)
+ set(BUILD_APPS OFF)
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
if ($ENV{CROSS_PFX} STREQUAL "m68k-amigaos")
- set(AMIGA_M68K 1)
+ set(AMIGA_M68K ON)
+ set(BUILD_TESTING OFF)
message(STATUS "Building for Motorola 68k AmigaOS")
+ if (${M68K_CRT} STREQUAL "newlib")
+ set(NEWLIB ON)
+ elseif(${M68K_CRT} STREQUAL "clib2")
+ set(CLIB2 ON)
+ elseif(${M68K_CRT} STREQUAL "nix20")
+ set(NIX20 ON)
+ elseif(${M68K_CRT} STREQUAL "nix13")
+ set(NIX13 ON)
+ else()
+ set(NEWLIB ON)
+ endif()
elseif ($ENV{CROSS_PFX} STREQUAL "ppc-amigaos")
- set(AMIGA_PPC 1)
+ set(AMIGA_PPC ON)
message(STATUS "Building for PowerPC AmigaOS")
else()
message(FATAL_ERROR "Unsupported AmigaOS target")
message(STATUS "Building for ${CMAKE_SYSTEM_NAME}")
endif()
+if (BUILD_SHARED_LIBS)
+ add_definitions(-D JSON_C_DLL)
+endif()
+
if (UNIX OR AMIGA)
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
endif()
check_include_file("dlfcn.h" HAVE_DLFCN_H)
check_include_file("endian.h" HAVE_ENDIAN_H)
check_include_file("limits.h" HAVE_LIMITS_H)
-if (NOT AMIGA)
+if (NOT AMIGA_M68K)
check_include_file("locale.h" HAVE_LOCALE_H)
endif()
check_include_file("memory.h" HAVE_MEMORY_H)
check_symbol_exists(vasprintf "stdio.h" HAVE_VASPRINTF)
check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
check_symbol_exists(vprintf "stdio.h" HAVE_VPRINTF)
-if (NOT AMIGA)
+if (NOT AMIGA_M68K)
check_symbol_exists(arc4random "stdlib.h" HAVE_ARC4RANDOM)
- if (NOT HAVE_ARC4RANDOM AND DISABLE_EXTRA_LIBS STREQUAL "OFF")
- check_include_file(bsd/stdlib.h HAVE_BSD_STDLIB_H)
- if (HAVE_BSD_STDLIB_H)
- list(APPEND CMAKE_REQUIRED_LIBRARIES "bsd")
- unset(HAVE_ARC4RANDOM CACHE)
- check_symbol_exists(arc4random "bsd/stdlib.h" HAVE_ARC4RANDOM)
- if (NOT HAVE_ARC4RANDOM)
- list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "bsd")
- endif()
+endif()
+if (NOT HAVE_ARC4RANDOM AND DISABLE_EXTRA_LIBS STREQUAL "OFF")
+ check_include_file(bsd/stdlib.h HAVE_BSD_STDLIB_H)
+ if (HAVE_BSD_STDLIB_H)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "bsd")
+ unset(HAVE_ARC4RANDOM CACHE)
+ check_symbol_exists(arc4random "bsd/stdlib.h" HAVE_ARC4RANDOM)
+ if (NOT HAVE_ARC4RANDOM)
+ list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "bsd")
endif()
endif()
endif()
if (HAVE_SYS_RANDOM_H)
check_symbol_exists(getrandom "sys/random.h" HAVE_GETRANDOM)
endif()
-if (HAVE_SYS_RESOURCE_H AND NOT AMIGA)
+if (HAVE_SYS_RESOURCE_H)
check_symbol_exists(getrusage "sys/resource.h" HAVE_GETRUSAGE)
endif()