From dc2ada43230564f65b4d3e77d40cd6a2957854e6 Mon Sep 17 00:00:00 2001 From: Carsten Schoenert Date: Thu, 22 Jan 2015 22:44:47 +0100 Subject: [PATCH] adding check for ctags We need ctags to run the make target 'update-map-file' so we better give a warning out if ctags wasn't found. --- Makefile.am | 7 +++++++ configure.ac | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/Makefile.am b/Makefile.am index b31074a9..58bea4d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,6 +87,13 @@ libcoap_@LIBCOAP_API_VERSION@_la_LDFLAGS = -version-info $(LT_LIBCOAP_CURRENT):$ ## Helper target to generate the symbol table needed by libtool update-map-file: + @if [ "$(CTAGS_PROG)" = "" ]; then \ + echo ;\ + echo "There was no ctags program found by the configure script!" ;\ + echo "ctags is needed for running this target! Please note the warning about the missed ctags program of the configure script." ;\ + echo ;\ + exit 1;\ + fi ( echo "VER_$(LIBCOAP_API_VERSION) {" ; \ echo "global:" ; \ ctags -f - --c-kinds=p $(libcoap_include_HEADERS) | awk '/^coap_/ { print " " $$1 ";" }' | sort ; \ diff --git a/configure.ac b/configure.ac index 97f3d9e2..23ee168b 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,15 @@ AC_SUBST(LIBCOAP_API_VERSION) # 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 \