From 560f5b07b9b581af5f9f7ce1eb7eef87ebc5134d Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 21 Mar 2022 12:01:06 +0100 Subject: [PATCH] Simplify generation of pkgconfig file Use meson's pkgconfig module to generate the pkg-config file, rather than using old-school autotools patterns. --- meson.build | 11 ----------- src/meson.build | 9 +++++++++ src/microdns.pc.in | 10 ---------- 3 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 src/microdns.pc.in diff --git a/meson.build b/meson.build index 5434ac6..e688af5 100644 --- a/meson.build +++ b/meson.build @@ -182,17 +182,6 @@ pkg_cdata.set('exec_prefix', '${prefix}') pkg_cdata.set('libdir', '${prefix}/@0@'.format(get_option('libdir'))) pkg_cdata.set('includedir', '${prefix}/@0@'.format(get_option('includedir'))) pkg_cdata.set('VERSION', mdns_version) -pkg_cdata.set('LIBSOCKET', host_system == 'windows' ? '-lws2_32 -liphlpapi': '') - -pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir')) - -configure_file( - input: 'src/microdns.pc.in', - output: 'microdns.pc', - configuration: pkg_cdata, - install_dir: pkg_install_dir, - install: true, -) mdns_dep = declare_dependency(link_with : libmicrodns, include_directories : incdirs, diff --git a/src/meson.build b/src/meson.build index 4b2a92c..5d9a34f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -19,3 +19,12 @@ libmicrodns = library('microdns', libmicrodns_sources, soversion: mdns_soversion, version: mdns_soname_version, ) + +pkgconf = import('pkgconfig') +pkgconf.generate(libraries: libmicrodns, + version: mdns_version, + name: 'microDNS', + description: 'mDNS simple implementation', + filebase: 'microdns', + requires: deps, +) diff --git a/src/microdns.pc.in b/src/microdns.pc.in deleted file mode 100644 index 26137f6..0000000 --- a/src/microdns.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: microDNS -Description: mDNS simple implementation -Version: @VERSION@ -Libs: -L${libdir} -lmicrodns @LIBSOCKET@ -Cflags: -I${includedir}