libuuid: Add missing config checks (#3657)

Fixes compilation on some platforms such as Android on Windows
pull/3681/head
Jérôme Leclercq 8 months ago committed by GitHub
parent 1708ce5787
commit 6b49d04b51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      packages/l/libuuid/xmake.lua

@ -11,20 +11,36 @@ package("libuuid")
on_install("linux", "macosx", "bsd", "android", "iphoneos", "wasm", "cross", function(package)
io.writefile("xmake.lua", [[
includes("check_cfuncs.lua")
includes("@builtin/check")
add_rules("mode.debug", "mode.release")
target("uuid")
set_kind("$(kind)")
add_files("*.c|test_*.c")
add_headerfiles("*.h", {prefixdir = "uuid"})
add_rules("utils.install.pkgconfig_importfiles", {filename = "uuid.pc"})
check_cfuncs("HAVE_USLEEP", "usleep", {includes = "unistd.h"})
check_cincludes("HAVE_DLFCN_H", "dlfcn.h")
check_cincludes("HAVE_FCNTL_H", "fcntl.h")
check_cincludes("HAVE_INTTYPES_H", "inttypes.h")
check_cincludes("HAVE_LIMITS_H", "limits.h")
check_cincludes("HAVE_MEMORY_H", "memory.h")
check_cincludes("HAVE_NETINET_IN_H", "netinet/in.h")
check_cincludes("HAVE_STDINT_H", "stdint.h")
check_cincludes("HAVE_STDLIB_H", "stdlib.h")
check_cincludes("HAVE_STRING_H", "string.h")
check_cincludes("HAVE_STRINGS_H", "strings.h")
check_cincludes("HAVE_SYS_FILE_H", "sys/file.h")
check_cincludes("HAVE_SYS_IOCTL_H", "sys/ioctl.h")
check_cincludes("HAVE_SYS_SOCKET_H", "sys/socket.h")
check_cincludes("HAVE_SYS_STAT_H", "sys/stat.h")
check_cincludes("HAVE_SYS_TIME_H", "sys/time.h")
check_cincludes("HAVE_SYS_TYPES_H", "sys/types.h")
check_cfuncs("HAVE_FTRUNCATE", "ftruncate", {includes = "unistd.h"})
check_cfuncs("HAVE_GETTIMEOFDAY", "gettimeofday", {includes = "sys/time.h"})
check_cfuncs("HAVE_MEMSET", "memset", {includes = "string.h"})
check_cfuncs("HAVE_SOCKET", "socket", {includes = "sys/socket.h"})
check_cfuncs("HAVE_STRTOUL", "strtoul", {includes = "stdlib.h"})
check_cfuncs("HAVE_SRANDOM", "srandom", {includes = "stdlib.h"})
check_cfuncs("HAVE_STRTOUL", "strtoul", {includes = "stdlib.h"})
check_cfuncs("HAVE_USLEEP", "usleep", {includes = "unistd.h"})
]])
local configs = {}
if package:config("shared") then

Loading…
Cancel
Save