-
Notifications
You must be signed in to change notification settings - Fork 16
/
configure.ac
117 lines (97 loc) · 2.88 KB
/
configure.ac
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# craftd configure.ac
AC_PREREQ([2.64])
AC_INIT([craftd], [0.2-pre], [[email protected]])
AC_CONFIG_AUX_DIR([build/auto/configaux])
AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects dist-bzip2])
AC_CONFIG_MACRO_DIR([build/auto/m4])
# Don't look for C++ or Fortran compilers
m4_undefine([AC_PROG_CXX])
m4_defun([AC_PROG_CXX],[])
m4_undefine([AC_PROG_F77])
m4_defun([AC_PROG_F77],[])
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_USE_SYSTEM_EXTENSIONS
LT_PREREQ([2.2])
AM_PROG_LIBTOOL
AC_LTDL_DLLIB
AC_SUBST(LIBTOOL_DEPS)
LT_INIT([dlopen])
AC_CONFIG_HEADERS([include/craftd/config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
include/Makefile
third-party/Makefile
plugins/Makefile
plugins/survival/mapgen/noise/Makefile
])
AC_CONFIG_SRCDIR([src/craftd.c])
# Checks for libraries.
AC_CHECK_LIB([ltdl], [lt_dlopen])
AX_LIB_SOCKET_NSL
AX_CHECK_ZLIB
AX_PTHREAD([], AC_MSG_ERROR([pthreads is required]))
AX_PATH_LIB_PCRE
PKG_CHECK_MODULES([libevent2_pthreads], [libevent_pthreads >= 2.0.9],
, ,
AC_MSG_ERROR([System libevent2_pthreads not found. Install it and check the
PKG_CONFIG_PATH env var. ]))
PKG_CHECK_MODULES([libconfig], [libconfig >= 1.3],
, ,
AC_MSG_ERROR([System libconfig not found. Install it and check the
PKG_CONFIG_PATH env var.]))
# Jansson removed from core. Add --with-json logic later.
# PKG_CHECK_MODULES([jansson], [jansson >= 2.0],
# , ,
# AC_MSG_ERROR([System jansson not found. Install it and check the PKG_CONFIG_PATH
# env var. ]))
# Establish default CFLAGS and pthread portability
AX_CFLAGS_WARN_ALL
CC="$PTHREAD_CC"
PTHREAD_LIBS="$PTHREAD_LIBS"
PTHREAD_CFLAGS="$PTHREAD_CFLAGS"
# Force pthread for everything?
#LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS -Wno-unused-label"
#CC="$PTHREAD_CC"
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h \
sys/socket.h unistd.h endian.h sys/endian.h ltdl.h])
AC_C_INLINE
case $ac_cv_c_inline in
yes) json_inline=inline;;
no) json_inline=;;
*) json_inline=$ac_cv_c_inline;;
esac
AC_SUBST([json_inline])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_UINT64_T
AC_TYPE_UINT32_T
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
AC_TYPE_SIZE_T
AC_TYPE_INTPTR_T
AC_CHECK_SIZEOF([intptr_t])
AC_CHECK_SIZEOF([fp], [], [typedef void (*fp)();])
AC_C_BIGENDIAN
AC_CHECK_DECLS([be64toh,htobe64], [], [],
[#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
])
AC_CHECK_MEMBERS([struct sigaction.sa_handler], [], [],
[#include <signal.h>
])
AC_CHECK_TYPES([pthread_spinlock_t], [], [], [[#include <pthread.h>]])
# Check if we need to reorder float and double types
AX_C_FLOAT_WORDS_BIGENDIAN
AC_OUTPUT