Browse Source

[build] collect Sun-specific headers and funcs

master
Glenn Strauss 4 months ago
parent
commit
448621e026
  1. 12
      SConstruct
  2. 14
      configure.ac
  3. 8
      src/CMakeLists.txt
  4. 8
      src/meson.build

12
SConstruct

@ -370,15 +370,12 @@ if 1:
'linux/random.h',
'malloc.h',
'poll.h',
'port.h',
'pwd.h',
'stdint.h',
'stdlib.h',
'string.h',
'strings.h',
'sys/devpoll.h',
'sys/epoll.h',
'sys/filio.h',
'sys/inotify.h',
'sys/loadavg.h',
'sys/poll.h',
@ -431,7 +428,6 @@ if 1:
'mmap',
'pipe2',
'poll',
'port_create',
'pread',
'preadv',
'pwrite',
@ -451,7 +447,13 @@ if 1:
autoconf.haveFunc('getentropy', 'sys/random.h')
autoconf.haveFunc('getrandom', 'linux/random.h')
if re.compile("sunos|solaris").search(env['PLATFORM']):
autoconf.haveCHeader('priv.h')
autoconf.haveCHeaders([
'port.h',
'priv.h',
'sys/devpoll.h',
'sys/filio.h',
])
autoconf.haveFunc('port_create', 'port.h')
autoconf.haveFunc('setpflags', 'priv.h')
autoconf.haveTypes(Split('pid_t size_t off_t'))

14
configure.ac

@ -99,15 +99,12 @@ AC_CHECK_HEADERS([\
inttypes.h \
malloc.h \
poll.h \
port.h \
pwd.h \
stdlib.h \
stdint.h \
strings.h \
sys/devpoll.h \
sys/epoll.h \
sys/event.h \
sys/filio.h \
sys/inotify.h \
sys/loadavg.h \
sys/mman.h \
@ -1451,7 +1448,6 @@ AC_CHECK_FUNCS([\
mmap \
pipe2 \
poll \
port_create \
pread \
preadv \
pwrite \
@ -1470,8 +1466,16 @@ AC_CHECK_FUNCS([\
])
AC_CHECK_HEADERS([sys/random.h], [AC_CHECK_FUNCS([getentropy])])
AC_CHECK_HEADERS([linux/random.h], [AC_CHECK_FUNCS([getrandom])])
case "$host_os" in
*sunos*|*solaris* ) AC_CHECK_HEADERS([priv.h], [AC_CHECK_FUNCS([setpflags])]) ;;
*sunos*|*solaris* )
AC_CHECK_HEADERS([priv.h], [AC_CHECK_FUNCS([setpflags])])
AC_CHECK_HEADERS([port.h], [AC_CHECK_FUNCS([port_create])])
AC_CHECK_HEADERS([\
sys/devpoll.h \
sys/filio.h \
])
;;
* ) ;;
esac

8
src/CMakeLists.txt

@ -107,12 +107,10 @@ if(WITH_WEBDAV_LOCKS)
set(WITH_UUID 1)
endif()
check_include_files(sys/devpoll.h HAVE_SYS_DEVPOLL_H)
check_include_files(sys/epoll.h HAVE_SYS_EPOLL_H)
set(CMAKE_REQUIRED_FLAGS "-include sys/types.h")
check_include_files(sys/event.h HAVE_SYS_EVENT_H)
set(CMAKE_REQUIRED_FLAGS)
check_include_files(sys/filio.h HAVE_SYS_FILIO_H)
check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H)
check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
set(CMAKE_REQUIRED_FLAGS "-include sys/time.h")
@ -135,7 +133,6 @@ check_include_files(getopt.h HAVE_GETOPT_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(malloc.h HAVE_MALLOC_H)
check_include_files(poll.h HAVE_POLL_H)
check_include_files(port.h HAVE_PORT_H)
check_include_files(pwd.h HAVE_PWD_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
@ -178,7 +175,11 @@ check_function_exists(timegm HAVE_TIMEGM)
set(CMAKE_EXTRA_INCLUDE_FILES)
if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
check_include_files(port.h HAVE_PORT_H)
check_include_files(priv.h HAVE_PRIV_H)
check_include_files(sys/devpoll.h HAVE_SYS_DEVPOLL_H)
check_include_files(sys/filio.h HAVE_SYS_FILIO_H)
check_function_exists(port_create HAVE_PORT_CREATE)
check_function_exists(setpflags HAVE_SETPFLAGS)
endif()
@ -208,7 +209,6 @@ check_function_exists(mkostemp HAVE_MKOSTEMP)
check_function_exists(mmap HAVE_MMAP)
check_function_exists(pipe2 HAVE_PIPE2)
check_function_exists(poll HAVE_POLL)
check_function_exists(port_create HAVE_PORT_CREATE)
check_function_exists(pread HAVE_PREAD)
check_function_exists(preadv HAVE_PREADV)
check_function_exists(pwrite HAVE_PWRITE)

8
src/meson.build

@ -34,10 +34,8 @@ endif
conf_data = configuration_data()
conf_data.set('HAVE_SYS_DEVPOLL_H', compiler.has_header('sys/devpoll.h'))
conf_data.set('HAVE_SYS_EPOLL_H', compiler.has_header('sys/epoll.h'))
conf_data.set('HAVE_SYS_EVENT_H', compiler.has_header('sys/event.h'))
conf_data.set('HAVE_SYS_FILIO_H', compiler.has_header('sys/filio.h'))
conf_data.set('HAVE_SYS_INOTIFY_H', compiler.has_header('sys/inotify.h'))
conf_data.set('HAVE_SYS_LOADAVG_H', compiler.has_header('sys/loadavg.h'))
conf_data.set('HAVE_SYS_MMAN_H', compiler.has_header('sys/mman.h'))
@ -59,7 +57,6 @@ conf_data.set('HAVE_GETOPT_H', compiler.has_header('getopt.h'))
conf_data.set('HAVE_INTTYPES_H', compiler.has_header('inttypes.h'))
conf_data.set('HAVE_MALLOC_H', compiler.has_header('malloc.h'))
conf_data.set('HAVE_POLL_H', compiler.has_header('poll.h'))
conf_data.set('HAVE_PORT_H', compiler.has_header('port.h'))
conf_data.set('HAVE_PWD_H', compiler.has_header('pwd.h'))
conf_data.set('HAVE_STDINT_H', compiler.has_header('stdint.h'))
conf_data.set('HAVE_STDLIB_H', compiler.has_header('stdlib.h'))
@ -121,7 +118,11 @@ if conf_data.get('HAVE_LINUX_RANDOM_H')
endif
if target_machine.system() == 'sunos'
conf_data.set('HAVE_PORT_H', compiler.has_header('port.h'))
conf_data.set('HAVE_PRIV_H', compiler.has_header('priv.h'))
conf_data.set('HAVE_SYS_DEVPOLL_H', compiler.has_header('sys/devpoll.h'))
conf_data.set('HAVE_SYS_FILIO_H', compiler.has_header('sys/filio.h'))
conf_data.set('HAVE_PORT_CREATE', compiler.has_function('port_create', args: defs))
conf_data.set('HAVE_SETPFLAGS', compiler.has_function('setpflags', args: defs))
endif
@ -151,7 +152,6 @@ conf_data.set('HAVE_MKOSTEMP', compiler.has_function('mkostemp', args: defs))
conf_data.set('HAVE_MMAP', compiler.has_function('mmap', args: defs))
conf_data.set('HAVE_PIPE2', compiler.has_function('pipe2', args: defs))
conf_data.set('HAVE_POLL', compiler.has_function('poll', args: defs))
conf_data.set('HAVE_PORT_CREATE', compiler.has_function('port_create', args: defs))
conf_data.set('HAVE_PREAD', compiler.has_function('pread', args: defs))
conf_data.set('HAVE_PREADV', compiler.has_function('preadv', args: defs))
conf_data.set('HAVE_PWRITE', compiler.has_function('pwrite', args: defs))

Loading…
Cancel
Save