summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2024-04-08 16:59:38 +0200
committerAndrei Pavel <andrei@isc.org>2024-04-17 13:53:39 +0200
commit0f71c39365ddcce631332f75ad606f45d346633b (patch)
treecb4ee702c83ba39fdd41ef7443567d33b6c6e5b5 /src
parent[#3133] Updated code and tests (diff)
downloadkea-0f71c39365ddcce631332f75ad606f45d346633b.tar.xz
kea-0f71c39365ddcce631332f75ad606f45d346633b.zip
[#1743] fix circular dependency in src/lib/log
Fixes the problem where to generate log_messages.(cc|h), you need kea-msg-compiler, but to compile kea-msg-compiler you need log_messages.(cc|h). This halted compilation even when building from scratch. Simply only regenerate log_messages.(cc|h) only if kea-msg-compiler exists. It will not regenerate the files on first pass, but one can explicitly call `make messages -C src/lib/log` afterwards to regenerate the files.
Diffstat (limited to 'src')
-rw-r--r--src/lib/log/Makefile.am12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/log/Makefile.am b/src/lib/log/Makefile.am
index 78a7ffa743..54e3589815 100644
--- a/src/lib/log/Makefile.am
+++ b/src/lib/log/Makefile.am
@@ -104,11 +104,19 @@ if GENERATE_MESSAGES
messages: log_messages.cc log_messages.h logimpl_messages.cc logimpl_messages.h
@echo Message files regenerated
+# If bootstrapping, do not generate log messages because there is nothing to generate them with.
+# A second make command or an explicit "make messages" command should do the job.
log_messages.cc log_messages.h: log_messages.mes
- $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/lib/log/log_messages.mes
+ @if test -f $(top_builddir)/src/lib/log/compiler/kea-msg-compiler; then \
+ $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/lib/log/log_messages.mes; \
+ fi
+# If bootstrapping, do not generate log messages because there is nothing to generate them with.
+# A second make command or an explicit "make messages" command should do the job.
logimpl_messages.cc logimpl_messages.h: logimpl_messages.mes
- $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/lib/log/logimpl_messages.mes
+ @if test -f $(top_builddir)/src/lib/log/compiler/kea-msg-compiler; then \
+ $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/lib/log/logimpl_messages.mes; \
+ fi
else