1.\"	$OpenBSD: port-resolve-lib-helper.1,v 1.1 2018/07/09 14:53:30 espie Exp $
2.\"
3.\" Copyright (c) 2010 Marc Espie <espie@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 9 2018 $
18.Dt PORT-RESOLVE-LIB-HELPER 1
19.Os
20.Sh NAME
21.Nm port-resolve-lib-helper
22.Nd resolve library specs during ports build
23.Sh SYNOPSIS
24.Nm
25.Op Fl needed
26.Op Fl silent
27.Ar spec ...
28.Sh DESCRIPTION
29.Nm
30resolve library specs against a list of installed libraries.
31.Nm
32takes a list of file names with full path on stdin,
33and matches each library
34.Ar spec
35against those libraries,
36using
37.Xr library-specs 7
38conventions.
39.Pp
40In particular,
41.Ev X11BASE
42and
43.Ev LOCALBASE
44are used to locate X11 libraries and port libraries.
45.Pp
46.Nm
47will print the best libraries found in a format suitable for
48.Cm @wantlib
49.Po
50see
51.Xr pkg_create 1
52.Pc .
53.Pp
54Each
55.Ar spec
56not found will result in an error message and exit code.
57.Pp
58If the option
59.Fl silent
60is used, nothing will be displayed.
61.Pp
62The option
63.Fl needed
64is used to sort out
65.Ev LIB_DEPENDS :
66.Nm
67will succeed if at least one of the libraries matches against a shared
68library passed on the command line.
69.Pp
70This is a helper script used by
71.Xr bsd.port.mk 5
72to complete all wantlib information for
73.Xr pkg_create 1
74and other tools.
75