Commit 4cb8d9ea authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'libedit-deps-fix' into 'master'

Libedit deps fix

Configuration fix
-----------------

Situation:
----------

Currently there are three problems when configuring the sources:

1. When configuring with `--with-libedit=/is/somewhere/else` the header files location is not passed into appropriate translation units and the compilation fails on missing header file `histedit.h`.

2. Compilation fails with `--disable-daemon` and `--enable-utilities` because libedit is pulled by static dependencies of utilities but is not detected in the configuration because of disabled daemon.

3. Sources of  `knotc` are compiled with daemon but the resulting binary is only built(linked) when utilities are also enabled, because utilisties provide necessary static `libknotus.la`.

Solution:
---------

* Add missing `$(libedit_CFLAGS)` into `src/Makefile.am` on relevant places.
* Presence of libedit is checked when configuring with daemon **or** utilities.
* Changes in `src/Makefile.am` so that `libknotus.la` is built when `HAVE_DAEMON` or `HAVE_UTILS`. Utility `knotc` is compiled and built with `knotd`.

See merge request !529
parents 10439f22 242aee01
......@@ -425,8 +425,7 @@ AS_IF([test "$enable_rosedb" = yes], [AC_DEFINE([HAVE_ROSEDB], [1], [Define to 1
AM_CONDITIONAL([HAVE_ROSEDB], [test "$enable_rosedb" = yes])
# libedit
AS_IF([test "$enable_daemon" = "yes"],[
# daemon enabled
AS_IF([test "$enable_daemon" = "yes" -o "$enable_utilities" = "yes"], [
PKG_CHECK_MODULES([libedit], [libedit], [with_libedit=yes], [
with_libedit=no
AC_CHECK_HEADER([histedit.h], [
......@@ -446,8 +445,7 @@ AS_IF([test "$enable_daemon" = "yes"],[
AS_IF([test "$with_libedit" != "yes"], [
AC_MSG_ERROR([libedit not found])
])
],[
# daemon disabled
], [
with_libedit=no
libedit_CFLAGS=
libedit_LIBS=
......
......@@ -194,6 +194,32 @@ libknot_la_CPPFLAGS += \
-I$(srcdir)/contrib/lmdb/
endif
# static: utilities shared
libknotus_la_SOURCES = \
utils/common/exec.c \
utils/common/exec.h \
utils/common/hex.c \
utils/common/hex.h \
utils/common/lookup.c \
utils/common/lookup.h \
utils/common/msg.c \
utils/common/msg.h \
utils/common/netio.c \
utils/common/netio.h \
utils/common/params.c \
utils/common/params.h \
utils/common/resolv.c \
utils/common/resolv.h \
utils/common/sign.c \
utils/common/sign.h \
utils/common/strtonum.h \
utils/common/token.c \
utils/common/token.h
libknotus_la_CPPFLAGS = $(AM_CPPFLAGS) $(libidn_CFLAGS) $(libedit_CFLAGS)
libknotus_la_LDFLAGS = $(AM_LDFLAGS) $(libidn_LIBS)
libknotus_la_LIBADD = libcontrib.la libknot.la
###################
# Knot DNS Daemon #
###################
......@@ -202,7 +228,7 @@ if HAVE_DAEMON
sbin_PROGRAMS = knotc knotd
libexec_PROGRAMS = knot1to2
noinst_LTLIBRARIES += libknotd.la
noinst_LTLIBRARIES += libknotd.la libknotus.la
EXTRA_DIST += \
utils/knot1to2/cf-lex.l \
......@@ -376,6 +402,7 @@ libknotd_la_LIBADD = libknot.la libknot-yparser.la zscanner/libzscanner.la $(lib
knotd_CPPFLAGS = $(AM_CPPFLAGS) $(liburcu_CFLAGS)
knotd_LDADD = libknotd.la $(liburcu_LIBS)
knotc_CPPFLAGS = $(AM_CPPFLAGS) $(libedit_CFLAGS)
knotc_LDADD = libknotd.la libknotus.la $(libedit_LIBS)
knot1to2_LDADD = libcontrib.la
......@@ -437,32 +464,6 @@ knsupdate_SOURCES = \
utils/knsupdate/knsupdate_params.c \
utils/knsupdate/knsupdate_params.h
# static: utilities shared
libknotus_la_SOURCES = \
utils/common/exec.c \
utils/common/exec.h \
utils/common/hex.c \
utils/common/hex.h \
utils/common/lookup.c \
utils/common/lookup.h \
utils/common/msg.c \
utils/common/msg.h \
utils/common/netio.c \
utils/common/netio.h \
utils/common/params.c \
utils/common/params.h \
utils/common/resolv.c \
utils/common/resolv.h \
utils/common/sign.c \
utils/common/sign.h \
utils/common/strtonum.h \
utils/common/token.c \
utils/common/token.h
libknotus_la_CPPFLAGS = $(AM_CPPFLAGS) $(libidn_CFLAGS)
libknotus_la_LDFLAGS = $(AM_LDFLAGS) $(libidn_LIBS)
libknotus_la_LIBADD = libcontrib.la libknot.la
# bin programs
kdig_LDADD = $(libidn_LIBS) libknotus.la
khost_LDADD = $(libidn_LIBS) libknotus.la
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment