DTLS support: export and use related flags to main Makefile

To be able to use the collected CFLAGS and LIBS variables in the main
Makefile substitute DTLS_CFLAGS and DTLS_LIBS with the found values from
previous made checks and exporting them to autoconfigure.
Also define the found development crypto library into the configuration
header file 'coap_config.h.

We may need to add the flags also to examples/Makefiles.am too.
This commit is contained in:
Carsten Schoenert committed 2017-06-30 20:45:10 +02:00
1 parent 9b2505772e
commit 7286a52474
2 files changed
+17 -1

No files matched your search

+2 -1
View File
@@ -27,7 +27,7 @@ EXTRA_DIST = \
tests/test_uri.h \
tests/test_wellknown.h
AM_CFLAGS = -I$(top_builddir)/include/coap -I$(top_srcdir)/include/coap $(WARNING_CFLAGS) -std=c99
AM_CFLAGS = -I$(top_builddir)/include/coap -I$(top_srcdir)/include/coap $(WARNING_CFLAGS) $(DTLS_CFLAGS) -std=c99
SUBDIRS = . $(DOC_DIR) tests examples
@@ -107,6 +107,7 @@ libcoap_include_HEADERS = \
libcoap_@LIBCOAP_API_VERSION@_la_LDFLAGS = \
-version-info $(LT_LIBCOAP_CURRENT):$(LT_LIBCOAP_REVISION):$(LT_LIBCOAP_AGE) \
@libcoap_SYMBOLS@ \
$(DTLS_LIBS) \
-pie
## Collect symbols here we want to ignore while building the helper files
+15
View File
@@ -363,6 +363,21 @@ if test "x$build_dtls" = "xyes"; then
Install at least on of the package(s) containing the development files for GnuTLS (>= $gnutls_version_required) or OpenSSL(>= $openssl_version_required)
or disable the DTLS support using '--disable-dtls'.])
fi
# Saving the DTLS related Compiler flags.
if test "x$with_gnutls" = "xyes" -o "x$with_gnutls_auto" = "xyes"; then
DTLS_CFLAGS="$GnuTLS_CFLAGS"
DTLS_LIBS="$GnuTLS_LIBS"
AC_DEFINE(HAVE_LIBGNUTLS, [1], [Define if the system has libgnutls28])
fi
if test "x$with_openssl" = "xyes" -o "x$with_openssl_auto" = "xyes"; then
DTLS_CFLAGS="$OpenSSL_CFLAGS"
DTLS_LIBS="$OpenSSL_LIBS"
AC_DEFINE(HAVE_OPENSSL, [1], [Define if the system has libssl1.1])
fi
AC_SUBST(DTLS_CFLAGS)
AC_SUBST(DTLS_LIBS)
fi
# configure options