Implementation of connectivity abstraction feature Release v0.3
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / libcoap-4.1.1 / configure.in
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 #
4 # Copyright (C) 2010--2014 Olaf Bergmann <bergmann@tzi.org>
5 #
6 # This file is part of the CoAP library libcoap. Please see
7 # README for terms of use. 
8
9 AC_PREREQ([2.65])
10 AC_INIT([libcoap], [4.1.1])
11 AC_CONFIG_SRCDIR([coap.h])
12
13 # First check for Contiki build to quit configure before any other test
14 AC_ARG_WITH(contiki,
15   [AS_HELP_STRING([--with-contiki],[build libcoap for the Contiki OS])],
16   [cp -p Makefile.contiki Makefile
17    cp -p config.h.contiki config.h
18    AC_MSG_NOTICE([Contiki build prepared])
19    exit 0], 
20   [])
21
22 # Checks for programs.
23 AC_PROG_MAKE_SET
24 AC_PROG_CC
25 AC_PROG_RANLIB
26 AC_PATH_PROG(DOXYGEN, doxygen, [:])
27 AC_PATH_PROG(ETAGS, etags, [/bin/false])
28
29 AC_C_BIGENDIAN
30
31 # Checks for libraries.
32 AC_CHECK_LIB([coap], [coap_new_pdu])
33
34 AC_SEARCH_LIBS([gethostbyname], [nsl])
35 AC_SEARCH_LIBS([socket], [socket])
36
37 # configuration options that may change compile flags 
38 AC_ARG_WITH(debug,
39   [AS_HELP_STRING([--without-debug],[disable all debug output and assertions])],
40   [CPPFLAGS="${CPPFLAGS} -DNDEBUG"], 
41   [])
42
43 AC_ARG_WITH(async,
44   [AS_HELP_STRING([--without-async],[disable handling of asynchronous transactions and observe])],
45   [CPPFLAGS="${CPPFLAGS} -DWITHOUT_ASYNC"], 
46   [])
47
48 AC_ARG_WITH(block,
49   [AS_HELP_STRING([--without-block],[disable block transfer])],
50   [CPPFLAGS="${CPPFLAGS} -DWITHOUT_BLOCK"], 
51   [])
52
53 AC_ARG_WITH(observe,
54   [AS_HELP_STRING([--without-observe],[disable resource observation])],
55   [CPPFLAGS="${CPPFLAGS} -DWITHOUT_OBSERVE"], 
56   [])
57
58 AC_ARG_WITH(query-filter,
59   [AS_HELP_STRING([--without-query-filter],[disable support for filters on /.well-known/core])],
60   [CPPFLAGS="${CPPFLAGS} -DWITHOUT_QUERY_FILTER"], 
61   [])
62
63 AC_ARG_WITH(tests,
64   [AS_HELP_STRING([--with-tests],[enable unit tests (requires cunit)])],        
65   [TESTS="tests"],
66   [])
67
68 AC_ARG_WITH(shared,
69   [AS_HELP_STRING([--with-shared],[build shared library])],     
70   [BUILD_SO="BUILD_SO=1"],
71   [])
72
73 # disambiguate between autoconf generated setups and contiki / lwip setups
74 # which use explicit config.h.* files
75 CPPFLAGS="${CPPFLAGS} -DWITH_POSIX"
76
77 # Checks for header files.
78 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 syslog.h])
79
80 # Checks for typedefs, structures, and compiler characteristics.
81 AC_TYPE_SIZE_T
82 AC_TYPE_SSIZE_T
83
84 # Checks for library functions.
85 AC_FUNC_MALLOC
86 AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo strnlen])
87
88 AC_SUBST(TESTS)
89 AC_SUBST(BUILD_SO)
90
91 AC_CONFIG_HEADERS([config.h])
92
93 AC_CONFIG_FILES([Makefile
94                  doc/Makefile
95                  doc/Doxyfile
96                  examples/Makefile
97                  tests/Makefile])
98 AC_OUTPUT
99