about summary refs log tree commit homepage
path: root/configure.ac
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-03-15 16:29:57 -0700
committerEric Wong <normalperson@yhbt.net>2012-03-15 23:47:20 +0000
commit4684050a21fb7a1ac27becf3936373c48024d7cb (patch)
tree283d73f9d07e88b328d49efa19a4b9a442fa2c46 /configure.ac
parente612507a5b407fe176adcea1d8b3ad6695a7de3f (diff)
downloadcmogstored-4684050a21fb7a1ac27becf3936373c48024d7cb.tar.gz
We don't want a redundant CPP macro for HAVE_SETPROCTITLE,
so we'll just bundle setproctitle (and anything else we'll need)
into a noinst library.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 50910b5..bbf202c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,5 +45,17 @@ dnl gnulib doesn't actually define SOCK_NONBLOCK/SOCK_CLOEXEC, and
 dnl even if it did, emulation wouldn't be thread-safe
 AC_CHECK_FUNCS([accept4])
 
+AC_SUBST(NOSTD_CFLAGS)
+
+# This works for all platforms we care about:
+# GNU/Linux, FreeBSD, Debian GNU/kFreeBSD
+AC_CHECK_FUNCS([setproctitle], [NOSTD_CFLAGS=-DHAVE_SETPROCTITLE=1],
+[
+case $build_os in
+*linux*) ;;
+*) NOSTD_CFLAGS=-DSETPROCTITLE_NOOP;;
+esac
+])
+
 AC_CONFIG_FILES([Makefile lib/Makefile])
 AC_OUTPUT