Skip to content

Commit 28156c8

Browse files
hadessjbkempf
authored andcommittedMay 27, 2022
Simplify generation of pkgconfig file
Use meson's pkgconfig module to generate the pkg-config file, rather than using old-school autotools patterns.
1 parent f6ee3b3 commit 28156c8

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed
 

‎meson.build

-11
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,6 @@ pkg_cdata.set('exec_prefix', '${prefix}')
182182
pkg_cdata.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
183183
pkg_cdata.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
184184
pkg_cdata.set('VERSION', mdns_version)
185-
pkg_cdata.set('LIBSOCKET', host_system == 'windows' ? '-lws2_32 -liphlpapi': '')
186-
187-
pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
188-
189-
configure_file(
190-
input: 'src/microdns.pc.in',
191-
output: 'microdns.pc',
192-
configuration: pkg_cdata,
193-
install_dir: pkg_install_dir,
194-
install: true,
195-
)
196185

197186
mdns_dep = declare_dependency(link_with : libmicrodns,
198187
include_directories : incdirs,

‎src/meson.build

+9
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ libmicrodns = library('microdns', libmicrodns_sources,
1919
soversion: mdns_soversion,
2020
version: mdns_soname_version,
2121
)
22+
23+
pkgconf = import('pkgconfig')
24+
pkgconf.generate(libraries: libmicrodns,
25+
version: mdns_version,
26+
name: 'microDNS',
27+
description: 'mDNS simple implementation',
28+
filebase: 'microdns',
29+
requires: deps,
30+
)

‎src/microdns.pc.in

-10
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.