2 # Process this file with autoconf to produce a configure script.
4 # Copyright (C) 2010--2014 Olaf Bergmann <bergmann@tzi.org>
6 # This file is part of the CoAP library libcoap. Please see
7 # README for terms of use.
10 AC_INIT([libcoap], [4.1.1])
11 AC_CONFIG_SRCDIR([coap.h])
13 # First check for Contiki build to quit configure before any other test
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])
22 # Checks for programs.
26 AC_PATH_PROG(DOXYGEN, doxygen, [:])
27 AC_PATH_PROG(ETAGS, etags, [/bin/false])
31 # Checks for libraries.
32 AC_CHECK_LIB([coap], [coap_new_pdu])
34 AC_SEARCH_LIBS([gethostbyname], [nsl])
35 AC_SEARCH_LIBS([socket], [socket])
37 # configuration options that may change compile flags
39 [AS_HELP_STRING([--without-debug],[disable all debug output and assertions])],
40 [CPPFLAGS="${CPPFLAGS} -DNDEBUG"],
44 [AS_HELP_STRING([--without-async],[disable handling of asynchronous transactions and observe])],
45 [CPPFLAGS="${CPPFLAGS} -DWITHOUT_ASYNC"],
49 [AS_HELP_STRING([--without-block],[disable block transfer])],
50 [CPPFLAGS="${CPPFLAGS} -DWITHOUT_BLOCK"],
54 [AS_HELP_STRING([--without-observe],[disable resource observation])],
55 [CPPFLAGS="${CPPFLAGS} -DWITHOUT_OBSERVE"],
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"],
64 [AS_HELP_STRING([--with-tests],[enable unit tests (requires cunit)])],
69 [AS_HELP_STRING([--with-shared],[build shared library])],
70 [BUILD_SO="BUILD_SO=1"],
73 # disambiguate between autoconf generated setups and contiki / lwip setups
74 # which use explicit config.h.* files
75 CPPFLAGS="${CPPFLAGS} -DWITH_POSIX"
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])
80 # Checks for typedefs, structures, and compiler characteristics.
84 # Checks for library functions.
86 AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo strnlen])
91 AC_CONFIG_HEADERS([config.h])
93 AC_CONFIG_FILES([Makefile