-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.in
94 lines (75 loc) · 2.59 KB
/
configure.in
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 2010--2013 Olaf Bergmann <[email protected]>
#
# This file is part of the CoAP library libcoap. Please see
# README for terms of use.
AC_PREREQ([2.65])
AC_INIT([libcoap], [4.0.3])
AC_CONFIG_SRCDIR([coap.h])
# First check for Contiki build to quit configure before any other test
AC_ARG_WITH(contiki,
[AS_HELP_STRING([--with-contiki],[build libcoap for the Contiki OS])],
[cp -p Makefile.contiki Makefile
cp -p config.h.contiki config.h
AC_MSG_NOTICE([Contiki build prepared])
exit 0],
[])
# Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_RANLIB
AC_PATH_PROG(DOXYGEN, doxygen, [:])
AC_PATH_PROG(ETAGS, etags, [/bin/false])
AC_C_BIGENDIAN
# Checks for libraries.
AC_CHECK_LIB([coap], [coap_new_pdu])
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([socket], [socket])
# configuration options that may change compile flags
AC_ARG_WITH(debug,
[AS_HELP_STRING([--without-debug],[disable all debug output and assertions])],
[CPPFLAGS="${CPPFLAGS} -DNDEBUG"],
[])
AC_ARG_WITH(async,
[AS_HELP_STRING([--without-async],[disable handling of asynchronous transactions and observe])],
[CPPFLAGS="${CPPFLAGS} -DWITHOUT_ASYNC"],
[])
AC_ARG_WITH(block,
[AS_HELP_STRING([--without-block],[disable block transfer])],
[CPPFLAGS="${CPPFLAGS} -DWITHOUT_BLOCK"],
[])
AC_ARG_WITH(observe,
[AS_HELP_STRING([--without-observe],[disable resource observation])],
[CPPFLAGS="${CPPFLAGS} -DWITHOUT_OBSERVE"],
[])
AC_ARG_WITH(query-filter,
[AS_HELP_STRING([--without-query-filter],[disable support for filters on /.well-known/core])],
[CPPFLAGS="${CPPFLAGS} -DWITHOUT_QUERY_FILTER"],
[])
AC_ARG_WITH(tests,
[AS_HELP_STRING([--with-tests],[enable unit tests (requires cunit)])],
[TESTS="tests"],
[])
AC_ARG_WITH(shared,
[AS_HELP_STRING([--with-shared],[build shared library])],
[BUILD_SO="BUILD_SO=1"],
[])
# Checks for header files.
AC_CHECK_HEADERS([assert.h arpa/inet.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h time.h unistd.h sys/unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo strnlen])
AC_SUBST(TESTS)
AC_SUBST(BUILD_SO)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/Doxyfile
examples/Makefile
tests/Makefile])
AC_OUTPUT