-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
105 lines (90 loc) · 3.85 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
AC_PREREQ([2.69])
AC_INIT([mcrx],[1],[[email protected]],[mcrx],[http://github.com/GrumpyOldTroll/libmcrx])
AC_CONFIG_SRCDIR([src/libmcrx.c])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_LIBOBJ_DIR([portable])
AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Werror -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
AM_MAINTAINER_MODE
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
LT_INIT([disable-static pic-only])
AC_PREFIX_DEFAULT([/usr])
# Checks for programs.
AC_PROG_SED
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([bzero memmove memset socket strerror strtol])
AC_ARG_ENABLE([logging],
AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
disable_logging=yes, [])
AS_IF([test "x$disable_logging" = "xyes"], [
AC_DEFINE(DISABLE_LOGGING, [1], [System logging.])
])
AC_PATH_PROG([CPPLINT], [cpplint], [true])
AS_IF([test "x$CPPLINT" = xtrue],
[AC_MSG_WARN([We recommend cpplint for developing this package.
Get it from 'pip install cpplint' or https://github.com/cpplint/cpplint])])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
[], [disable_debug=yes])
AS_IF([test "x$disable_debug" = "xyes"], [
AC_DEFINE(DISABLE_DEBUG, [1], [Debug messages.])
])
#AC_CHECK_HEADER([event.h],
# [AC_DEFINE([HAVE_EVENT_H], [1], [Define to 1 if you have <event.h>.])],
# [AC_MSG_ERROR([could not include <event.h>. You need to install libevent-dev or build from https://github.com/libevent/libevent.git and set C_INCLUDE_PATH and LIBRARY_PATH])])
#
#AC_CHECK_LIB([event],[event_base_new],
# [AC_DEFINE([HAVE_EVENT_LIB], [1], [Define to 1 if you have libevent])],
# [AC_MSG_ERROR([could not invoke event_base_new with -levent, you need to install libevent-dev or build from https://github.com/libevent/libevent.git and set C_INCLUDE_PATH and LIBRARY_PATH])])
#
#AC_CHECK_HEADER([dns_sd.h],
# [AC_DEFINE([HAVE_DNSSD_H], [1], [Define to 1 if you have <dns_sd.h>.])],
# [AC_MSG_ERROR([could not include <dns_sd.h>. You need to install libavahi-compat-libdnssd-dev or build from https://github.com/IETF-Hackathon/mDNSResponder.git (mDNSPosix) and set C_INCLUDE_PATH and LIBRARY_PATH])])
# commenting for mac. it's not libdns_sd, it's part of system libraries,
# so there needs to be a mac/other special case.
#AC_CHECK_LIB([dns_sd],[DNSServiceRegister],
# [AC_DEFINE([HAVE_DNSSD_LIB], [1], [Define to 1 if you have libdns_sd])],
# [AC_MSG_ERROR([could not load libdns_sd.so. You need to install mdnsd or build from https://github.com/IETF-Hackathon/mDNSResponder.git (mDNSPosix) and set C_INCLUDE_PATH and LIBRARY_PATH])])
my_CFLAGS="-pedantic -Wall -Wextra \
-Wmissing-declarations -Wmissing-prototypes \
-Wnested-externs -Wsign-compare \
-Wstrict-prototypes -Wshadow \
-Wformat-security"
AC_SUBST([my_CFLAGS])
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
=====
prefix: ${prefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
includedir: ${includedir}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
logging: ${enable_logging}
debug: ${enable_debug}
])