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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
From a61c6d2cecdd149db767307cd71b736e77913251 Mon Sep 17 00:00:00 2001
From: Diederik de Groot <ddegroot@talon.nl>
Date: Mon, 26 Oct 2020 18:11:16 +0100
Subject: [PATCH] Fix: compilation on FreeBSD
Signed-off-by: Diederik de Groot <ddegroot@talon.nl>
---
autoconf/extra.m4 | 2 +-
configure | 2 +-
src/Makefile.am | 3 +++
src/Makefile.in | 3 +++
src/common.h | 9 +++++++++
src/define.h | 2 --
6 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/autoconf/extra.m4 b/autoconf/extra.m4
index 9a9f2c6a8..abb97e8be 100644
--- autoconf/extra.m4
+++ autoconf/extra.m4
@@ -253,7 +253,7 @@ dnl ])
AC_CHECK_FUNCS([gethostbyname inet_ntoa mkdir])
AC_HEADER_STDC
AC_HEADER_STDBOOL
- AC_CHECK_HEADERS([netinet/in.h fcntl.h sys/signal.h stdio.h errno.h ctype.h assert.h sys/sysinfo.h])
+ AC_CHECK_HEADERS([netinet/in.h fcntl.h signal.h sys/signal.h stdio.h errno.h ctype.h assert.h sys/sysinfo.h])
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
CS_WITH_LIBSSL
diff --git a/configure b/configure
index 38dfabc8e..ba3af8e21 100755
--- configure
+++ configure
@@ -23944,7 +23944,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi
- for ac_header in netinet/in.h fcntl.h sys/signal.h stdio.h errno.h ctype.h assert.h sys/sysinfo.h
+ for ac_header in netinet/in.h fcntl.h signal.h sys/signal.h stdio.h errno.h ctype.h assert.h sys/sysinfo.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/src/Makefile.am b/src/Makefile.am
index 7c305b46c..495a3772a 100644
--- src/Makefile.am
+++ src/Makefile.am
@@ -13,6 +13,9 @@ EXTRA_DIST = sccp_enum.in sccp_config_entries.hh
BUILT_SOURCES = revision.h sccp_enum.h sccp_enum.c
CLEANFILES = revision.h sccp_enum.h sccp_enum.c stamp-g1
.PHONY: force
+
+force:
+
# generated files
revision.gen:
@echo " REV revision.h";
diff --git a/src/Makefile.in b/src/Makefile.in
index d3f42fdbf..0cc248ade 100644
--- src/Makefile.in
+++ src/Makefile.in
@@ -1461,6 +1461,9 @@ uninstall-am: uninstall-csmodLTLIBRARIES
.PRECIOUS: Makefile
.PHONY: force
+
+force:
+
# generated files
revision.gen:
@echo " REV revision.h";
diff --git a/src/common.h b/src/common.h
index 2b70ba3e2..10b5d4943 100644
--- src/common.h
+++ src/common.h
@@ -39,6 +39,15 @@
#if HAVE_STDBOOL_H
#include <stdbool.h>
#endif
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#if HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
#include "define.h"
#include "forward_declarations.h"
diff --git a/src/define.h b/src/define.h
index 6f277ef10..423674fc6 100644
--- src/define.h
+++ src/define.h
@@ -17,8 +17,6 @@
#pragma once
#include "config.h"
-#include <pthread.h>
-
/*!
* \note most of these should be moved to autoconf/asterisk.m4 and be defined in config.h
*/
|