Skip to content

dnsdist: meson enables libedit support even when disabled #15516

@edmonds

Description

@edmonds

Short description

When I have the libedit development files (headers, pkg-config file, etc.) installed, but I configure dnsdist with meson [...] -Dlibedit=disabled, I still see meson searching for libedit and enabling libedit support:

[...]
Run-time dependency libedit found: YES 3.1
[...]
  Edit
    libedit support                                        : YES

Environment

Steps to reproduce

  1. Install the libedit-dev package.
  2. Run meson setup build -Dlibedit=disabled from the pdns/dnsdistdist directory.

Expected behaviour

meson prints:

[...]
Dependency libedit skipped: feature libedit disabled
[...]
  Edit
    libedit support                                        : NO
[...]
  User defined options
    libedit                                                : disabled

Actual behaviour

meson prints:

[...]
Run-time dependency libedit found: YES 3.1
[...]
  Edit
    libedit support                                        : YES
[...]
  User defined options
    libedit                                                : disabled

Other information

This patch seems to fix it:

diff --git a/pdns/dnsdistdist/meson/libedit/meson.build b/pdns/dnsdistdist/meson/libedit/meson.build
index 55c2e2988..0d50a87f1 100644
--- a/pdns/dnsdistdist/meson/libedit/meson.build
+++ b/pdns/dnsdistdist/meson/libedit/meson.build
@@ -1,8 +1,10 @@
 opt_libedit = get_option('libedit')
-dep_libedit = dependency('libedit', required: false)
+dep_libedit = dependency('libedit', required: opt_libedit)

-if not dep_libedit.found()
-  dep_libedit = cxx.find_library('edit', required: opt_libedit)
+if opt_libedit.allowed()
+  if not dep_libedit.found()
+    dep_libedit = cxx.find_library('edit', required: opt_libedit)
+  endif
 endif

 conf.set('HAVE_LIBEDIT', dep_libedit.found(), description: 'libedit support')

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions