Skip to content

Commit

Permalink
Simplify generation of pkgconfig file
Browse files Browse the repository at this point in the history
Use meson's pkgconfig module to generate the pkg-config file, rather
than using old-school autotools patterns.
  • Loading branch information
hadess authored and jbkempf committed May 27, 2022
1 parent 4c1c177 commit 560f5b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
11 changes: 0 additions & 11 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
10 changes: 0 additions & 10 deletions src/microdns.pc.in

This file was deleted.

0 comments on commit 560f5b0

Please sign in to comment.