summaryrefslogtreecommitdiff
path: root/net-mgmt/icinga/files/patch-configure.in
blob: 18f07d91a7699efa3f2a05e7a363780182206bc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- configure.in.orig	2014-03-13 11:46:50.000000000 +0100
+++ configure.in	2014-03-13 21:46:18.329313645 +0100
@@ -6,7 +6,6 @@ define([AC_CACHE_SAVE],)
 
 AC_INIT(base/icinga.c)
 AC_CONFIG_HEADER(include/config.h)
-AC_PREFIX_DEFAULT(/usr/local/icinga)
 
 PKG_NAME=icinga-core
 PKG_VERSION="1.11.0"
@@ -144,6 +143,15 @@ AC_TRY_COMPILE([#include <stdlib.h>
 dnl Test for pthreads support - taken from ICU FreeBSD Port configure script
 THREADLIBS=""
 have_pthreads="no"
+have_thr="no"
+ 
+dnl Prefer libthr(3) over libpthread(3) due to serious process hanging issues
+AC_CHECK_LIB(thr,pthread_create)
+if test $ac_cv_lib_thr_pthread_create = yes; then
+	THREADLIBS="-lthr"
+	have_pthreads="yes"
+	have_thr="yes"
+else
 
 dnl FreeBSD: Try ports/linuxthreads first - Mammad Zadeh <mammad@yahoo-inc.com>
 dnl FreeBSD -pthread check - Jonathan McDowell <noodles@earth.li>
@@ -205,6 +213,7 @@ dnl all other thread tests fail, try BSD
 if test $have_pthreads = "no"; then
 	AC_PTHREAD_FREEBSD
 fi
+fi
 
 AC_SUBST(THREADLIBS)
 
@@ -223,7 +232,6 @@ AC_DEFINE_UNQUOTED(DEFAULT_ICINGA_USER,"
 AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_USER,"$icinga_user",[user name to run nagios])
 AC_DEFINE_UNQUOTED(DEFAULT_ICINGA_GROUP,"$icinga_grp",[group name to run nagios])
 AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_GROUP,"$icinga_grp",[group name to run nagios])
-INSTALL_OPTS="-o $icinga_user -g $icinga_grp"
 AC_SUBST(INSTALL_OPTS)
 
 AC_ARG_WITH(command_user,AC_HELP_STRING([--with-command-user=<user>],[sets user name for command access]),command_user=$withval,command_user=$icinga_user)
@@ -495,7 +503,7 @@ dnl Location of the embedded perl p1.pl
 P1FILELOC=no
 AC_ARG_WITH(p1-file-dir,AC_HELP_STRING([--with-p1-file-dir=<path>],[sets path to embedded perl p1.pl directory]),P1FILELOC=$withval,P1FILELOC=no)
 if test x$P1FILELOC = xno; then
-        P1FILELOC="$libdir"
+        P1FILELOC="$bindir"
 fi
 AC_SUBST(P1FILELOC)
 
@@ -1126,6 +1134,9 @@ if test x$USEPERL = xyes; then
 
 	AC_DEFINE_UNQUOTED(EMBEDDEDPERL,,[Is embedded Perl being compiled in?])
 	PERLLIBS="`perl -MExtUtils::Embed -e ldopts`"
+	if test x$have_thr = xyes; then
+		PERLLIBS="`echo $PERLLIBS | sed 's#pthread #lthr #'`"
+	fi
 	PERLDIR="`perl -MConfig -e 'print $Config{installsitearch}'`"
 	CFLAGS="${CFLAGS} `perl -MExtUtils::Embed -e ccopts`"
 	USEPERL=yes