From ef41ce5d02d64cec0751882ae8fd95f6c32bc018 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Wed, 5 Feb 2014 18:04:31 +0100 Subject: [PATCH] improved install target --- Makefile.in | 13 ++++++++----- configure.in | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index df180f0b..3f4bd969 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # Makefile for libcoap # -# Copyright (C) 2010--2013 Olaf Bergmann +# Copyright (C) 2010--2014 Olaf Bergmann # # This file is part of the CoAP library libcoap. Please see # README for terms of use. @@ -108,11 +108,14 @@ dist: $(FILES) $(SUBDIRS) tar czf $(package).tar.gz $(DISTDIR) install: - mkdir -p $(includerootdir)/coap - mkdir -p $(librootdir) - cp -r $(HEADERS) $(includerootdir)/coap/ + test -d $(includerootdir)/libcoap || mkdir -p $(includerootdir)/libcoap + test -d $(librootdir) || mkdir -p $(librootdir) + cp -r $(HEADERS) $(includerootdir)/libcoap/ cp $(LIB) $(librootdir)/ - cp $(LIBSO) $(librootdir)/ +ifdef BUILD_SO + cp $(LIBSO) $(librootdir)/$(LIBSO).@LIBSO_VERSION@ + test -h $(librootdir)/$(LIBSO) || ln -s $(librootdir)/$(LIBSO).@LIBSO_VERSION@ $(librootdir)/$(LIBSO) +endif TAGS: $(ETAGS) -o $@.new $(SOURCES) diff --git a/configure.in b/configure.in index 77f6c8f3..edf763d5 100644 --- a/configure.in +++ b/configure.in @@ -67,7 +67,7 @@ AC_ARG_WITH(tests, AC_ARG_WITH(shared, [AS_HELP_STRING([--with-shared],[build shared library])], - [BUILD_SO="BUILD_SO=1"], + [BUILD_SO="BUILD_SO=1" LIBSO_VERSION=AC_PACKAGE_VERSION], []) # disambiguate between autoconf generated setups and contiki / lwip setups @@ -87,6 +87,7 @@ AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo strnlen]) AC_SUBST(TESTS) AC_SUBST(BUILD_SO) +AC_SUBST(LIBSO_VERSION) AC_CONFIG_HEADERS([config.h])