From aac0f06f3d548cf02107687d637c25e54b186b68 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Wed, 27 Sep 2017 18:34:23 +0300 Subject: [PATCH] Better checking for shm_open() during configure. --- auto/shmem | 22 +++++++++++++++------- auto/time | 2 -- configure | 2 ++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/auto/shmem b/auto/shmem index 86962ec7..3eae6936 100644 --- a/auto/shmem +++ b/auto/shmem @@ -3,19 +3,13 @@ # Copyright (C) NGINX, Inc. -# Linux, FreeBSD, MacOSX +# FreeBSD, Solaris, MacOSX nxt_feature="shm_open()" nxt_feature_name=NXT_HAVE_SHM_OPEN nxt_feature_run=yes nxt_feature_incs= nxt_feature_libs= - -if [ "$NXT_SYSTEM" = "Linux" ]; then - nxt_feature_libs=-lrt - NXT_LIBRT=-lrt -fi - nxt_feature_test="#include #include #include @@ -37,6 +31,20 @@ nxt_feature_test="#include . auto/feature +if [ $nxt_found = no ]; then + + # Linux and NetBSD 7.0 shm_open() are in librt. + + nxt_feature="shm_open() in librt" + nxt_feature_libs="-lrt" + . auto/feature + + if [ $nxt_found = yes ]; then + NXT_LIBRT=$nxt_feature_libs + fi +fi + + # Linux nxt_feature="memfd_create()" diff --git a/auto/time b/auto/time index 712a4297..7663e62f 100644 --- a/auto/time +++ b/auto/time @@ -6,8 +6,6 @@ # Linux 2.6.32 CLOCK_REALTIME_COARSE. # Linux clock_gettime() is in librt. -NXT_LIBRT= - nxt_feature="Linux clock_gettime(CLOCK_REALTIME_COARSE)" nxt_feature_name=NXT_HAVE_CLOCK_REALTIME_COARSE nxt_feature_run=yes diff --git a/configure b/configure index 8e49065d..e9ae6378 100755 --- a/configure +++ b/configure @@ -105,6 +105,8 @@ if [ $NXT_UNIX_DOMAIN = YES ]; then nxt_have=NXT_HAVE_UNIX_DOMAIN . auto/have fi +NXT_LIBRT= + . auto/types . auto/clang . auto/atomic