@@ -194,10 +194,6 @@ conf_data.set_quoted('LIBDIR', lib_dir)
194
194
conf_data.set_quoted(' ROOTHINTS' , root_hints)
195
195
conf_data.set_quoted(' LIBEXT' , libext)
196
196
conf_data.set_quoted(' OPERATING_SYSTEM' , host_machine .system())
197
- conf_data.set_quoted(' libzscanner_SONAME' ,
198
- libzscanner.get_pkgconfig_variable(' libdir' ) / libzscanner.get_pkgconfig_variable(' soname' ))
199
- conf_data.set_quoted(' libknot_SONAME' ,
200
- libknot.get_pkgconfig_variable(' libdir' ) / libknot.get_pkgconfig_variable(' soname' ))
201
197
conf_data.set(' ENABLE_LIBSYSTEMD' , libsystemd.found().to_int())
202
198
conf_data.set(' ENABLE_SENDMMSG' , sendmmsg.to_int())
203
199
conf_data.set(' ENABLE_XDP' , xdp.to_int())
@@ -211,6 +207,20 @@ else
211
207
conf_data.set(' DBG_ASSERTION_FORK' , ' (5 * 60 * 1000) /* five minutes */' )
212
208
endif
213
209
210
+ # Getting *runtime* path to knot-dns libs is surprisingly difficult.
211
+ # Partially it's because meson isn't meant for general-purpose programming.
212
+ foreach libname, lib : { ' libknot' : libknot, ' libzscanner' : libzscanner }
213
+ l = lib.get_pkgconfig_variable(' libdir' )
214
+ p = lib.get_pkgconfig_variable(' prefix' )
215
+ ep = lib.get_pkgconfig_variable(' exec_prefix' )
216
+ if ep != p
217
+ p_len = run_command (' sh' , ' -c' , ' echo "' + p + ' " | wc -c' , check : true ).stdout().to_int()
218
+ assert (l.startswith(p))
219
+ l = ep / l.substring(p_len)
220
+ endif
221
+ conf_data.set_quoted(libname + ' _SONAME' , l / lib.get_pkgconfig_variable(' soname' ))
222
+ endforeach
223
+
214
224
kresconfig = configure_file (
215
225
output : ' kresconfig.h' ,
216
226
configuration : conf_data,
0 commit comments