summaryrefslogtreecommitdiff
path: root/source3/aclocal.m4
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-05-05 05:39:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:16:46 -0500
commit584ac985ec203f171367dec336ab8c828e31a442 (patch)
tree13855f12705ff0c8b7c9b48888bd873c45f64aed /source3/aclocal.m4
parent78359305491f869af13622153bdf21cdb0cc2459 (diff)
downloadsamba-584ac985ec203f171367dec336ab8c828e31a442.tar.gz
samba-584ac985ec203f171367dec336ab8c828e31a442.tar.bz2
samba-584ac985ec203f171367dec336ab8c828e31a442.zip
r15448: New autoconf macro to test for sysconf variables.
(This used to be commit a19d4f2bb4aa94ab40e371efbad9f17e38e3bbc4)
Diffstat (limited to 'source3/aclocal.m4')
-rw-r--r--source3/aclocal.m418
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4
index 91611233ca..67b7017a91 100644
--- a/source3/aclocal.m4
+++ b/source3/aclocal.m4
@@ -770,3 +770,21 @@ AC_DEFUN( [AC_TRY_RUN_STRICT],
old_LDFLAGS="";
export LDFLAGS;
])
+
+dnl SMB_CHECK_SYSCONF(varname)
+dnl Tests whether the sysconf(3) variable "varname" is available.
+AC_DEFUN([SMB_CHECK_SYSCONF],
+[
+ AC_CACHE_CHECK([for sysconf($1)],
+ samba_cv_SYSCONF$1,
+ [
+ AC_TRY_LINK([#include <unistd.h>],
+ [ return sysconf($1) == -1 ? 1 : 0; ],
+ [ samba_cv_SYSCONF$1=yes ],
+ [ samba_cv_SYSCONF$1=no ])
+ ])
+
+ if test x"$samba_cv_SYSCONF$1" = x"yes" ; then
+ AC_DEFINE(SYSCONF$1, 1, [Whether sysconf($1) is available])
+ fi
+])