mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-17 21:39:04 +03:00
We need ctags to run the make target 'update-map-file' so we better give a warning out if ctags wasn't found.
131 lines
5.2 KiB
Plaintext
131 lines
5.2 KiB
Plaintext
# configure.ac for the libcoap package
|
|
#
|
|
# Copyright (C) 2010-2015 Olaf Bergmann <bergmann@tzi.org>
|
|
# (C) 2015 Carsten Schoenert <c.schoenert@t-online.de>
|
|
#
|
|
# Please run 'autogen.sh' to let autoconf produce a configure script.
|
|
|
|
# Define the libcoap software version here. Note! The libtool versions are
|
|
# defined later.
|
|
m4_define([libcoap_major_version], [4])
|
|
m4_define([libcoap_minor_version], [1])
|
|
m4_define([libcoap_micro_version], [2])
|
|
|
|
m4_define([libcoap_version],[libcoap_major_version.libcoap_minor_version.libcoap_micro_version])
|
|
|
|
AC_INIT([libcoap], [libcoap_version], [libcoap-developers@lists.sourceforge.net], [libcoap], [http://libcoap.sourceforge.net/])
|
|
AC_PREREQ([2.59])
|
|
AM_INIT_AUTOMAKE([1.10 -Wall no-define])
|
|
|
|
# Generate one configuration header file for building the library itself with
|
|
# an autogenerated template. We need later a second one (include/libcoap.h)
|
|
# that will be installed alongside the library.
|
|
AC_CONFIG_HEADERS([coap_config.h])
|
|
|
|
AC_PROG_CC
|
|
AM_PROG_AR
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
LT_INIT([disable-static])
|
|
|
|
# Setting the libtool versioning
|
|
###################################################################################
|
|
# #
|
|
# To set the version of the library, libtool provides the -version-info #
|
|
# parameter, which accepts three numbers, separated by colons, that are called #
|
|
# respectively, current, revision and age. Both their name and their behaviour, #
|
|
# nowadays, have to be considered fully arbitrary, as the explanation provided #
|
|
# in the official documentation is confusing to say the least, and can be, in #
|
|
# some cases, considered completely wrong. #
|
|
# https://autotools.io/libtool/version.html #
|
|
# #
|
|
###################################################################################
|
|
#
|
|
# How to work with the libtool versioning?
|
|
#
|
|
# Follow the followings steps from top to bottom. This means allways start at point 1
|
|
# if you plan to make a release and change the values.
|
|
# Every new library starts with a version 'current' (short 'c') = 0
|
|
# 'revision' (short 'r') = 0
|
|
# 'age' (short 'a') = 0
|
|
#
|
|
# Update the libtool versioning only immediately before a public release of libcoap.
|
|
#
|
|
# 1. If the library source code has changed at all since the last update, then
|
|
# increment revision (c:r:a becomes c:r+1:a).
|
|
# --> Increase the 'LT_LIBCOAP_REVISION' value with *everey* new software release.
|
|
#
|
|
# 2. If any interfaces [exported functions or data] have been added, removed, or
|
|
# changed since the last update, increment current, and set revision to 0
|
|
# (c:r:a becomes c+1:r=0:a).
|
|
# --> Increase the 'LT_LIBCOAP_CURRENT' value whenever as an interface has been added,
|
|
# removed or changed. This implies also a API change! You mostly have to change
|
|
# the 'libcoap_major_version' then too!
|
|
# --> Set 'LT_LIBCOAP_REVISION' to 0.
|
|
#
|
|
# 3. If any interfaces have been added since the last public release, then increment
|
|
# age (c:r:a becomes c:r:a+1). Adding new interfaces will make the library allways
|
|
# backwards compatable.
|
|
# --> Increase the 'LT_LIBCOAP_AGE' value only if the changes made to the ABI are
|
|
# backward compatible.
|
|
#
|
|
# 4. If any interfaces whitin the library have been removed since the last public
|
|
# release, then set age to 0.
|
|
# --> Set 'LT_LIBCOAP_AGE' to 0.
|
|
|
|
LT_LIBCOAP_CURRENT=0
|
|
LT_LIBCOAP_REVISION=0
|
|
LT_LIBCOAP_AGE=0
|
|
LIBCOAP_SO_VERSION=$LT_LIBCOAP_CURRENT.$LT_LIBCOAP_REVISION.$LT_LIBCOAP_AGE
|
|
|
|
# Announce the libtool version
|
|
AC_SUBST(LT_LIBCOAP_CURRENT)
|
|
AC_SUBST(LT_LIBCOAP_REVISION)
|
|
AC_SUBST(LT_LIBCOAP_AGE)
|
|
AC_SUBST(LIBCOAP_SO_VERSION)
|
|
|
|
# Defining the API Version
|
|
LIBCOAP_API_VERSION=1.0
|
|
AC_SUBST(LIBCOAP_API_VERSION)
|
|
|
|
# Check for needed additional programs
|
|
# FIXME! Switch to configure section?
|
|
AC_PATH_PROG(DOXYGEN, doxygen, [:])
|
|
|
|
# Check for ctags
|
|
AC_ARG_VAR([CTAGS_PROG],[the 'ctag' program to use for make target 'update-map-file'])
|
|
AC_PATH_PROG([CTAGS_PROG],[ctags],[])
|
|
if test "x$CTAGS_PROG" = "x"; then
|
|
AC_MSG_NOTICE([==> Note: 'ctags' command not found!])
|
|
AC_MSG_WARN([==> Without ctags you will be unable to run the target 'update-map-file'!])
|
|
AC_MSG_WARN([==> This is no problem if you just want to build the library libcoap.])
|
|
fi
|
|
|
|
# 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 syslog.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])
|
|
|
|
# Override the various template files, currently just makefiles.
|
|
AC_CONFIG_FILES([
|
|
Makefile
|
|
libcoap-$LIBCOAP_API_VERSION.pc:libcoap-$LIBCOAP_API_VERSION.pc.in
|
|
])
|
|
|
|
AC_OUTPUT
|
|
|
|
AC_MSG_RESULT([
|
|
libcoap configuration summary:
|
|
libcoap package version : "$PACKAGE_VERSION"
|
|
libcoap library version : "$LIBCOAP_SO_VERSION"
|
|
libcoap API version : "$LIBCOAP_API_VERSION"
|
|
]);
|