1.\" $OpenBSD: check-lib-depends.1,v 1.4 2019/12/23 02:09:46 kmos 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: December 23 2019 $ 18.Dt CHECK-LIB-DEPENDS 1 19.Os 20.Sh NAME 21.Nm check-lib-depends 22.Nd scan port for shared libraries 23.Sh SYNOPSIS 24.Nm check-lib-depends 25.Op Fl fimoqx 26.Op Fl B Ar destdir 27.Op Fl d Ar pkgrepo 28.Op Fl D Ar directory 29.Op Fl F Ar missing 30.Op Fl O Ar dest 31.Op Fl S Ar VAR Ns = Ns Ar value 32.Op Fl s Ar source 33.Op Ar package ... 34.Sh DESCRIPTION 35.Nm 36scans a port or package for shared libraries, and verify that all of them 37are properly recorded. 38.Pp 39.Nm 40can either scan files from a built port after the 41.Ar fake stage 42from the 43.Ev WRKINST 44directory, or look directly inside a 45.Ar package . 46.Pp 47Likewise, it can also verify dependencies of installed packages, 48or figure them out directly from the port directory. 49.Pp 50.Nm 51actually consists of two distinct stages: 52.Bl -bullet 53.It 54scan all binaries inside a package to extract libraries and rpaths, 55using 56.Xr objdump 1 57or 58.Xr ldd 1 . 59.It 60compare those libraries against the port's registered dependencies 61and report problems. 62.El 63.Pp 64The options are as follows: 65.Bl -tag -width keyword 66.It Fl B Ar destdir 67Scan files under 68.Ar destdir . 69.It Fl d Ar pkgrepo 70Look for all needed packages under directory 71.Ar pkgrepo . 72.It Fl D Ar directory 73Create debug log files under 74.Ar directory 75that show in more details the run of 76.Xr objdump 1 . 77.It Fl f 78Give full reports of every file that requires a missing library. 79.It Fl F Ar missing 80Works in tandem with 81.Fl S . 82Allow backsubstituting even if the 83.Ar missing 84library 85is actually not part of the actual 86.Ev WANTLIB 87of the package. 88Mostly used to waive the presence of 89.Ar pthread , 90a mandatory dependency of C++ libraries on some architectures. 91.It Fl i 92Read packing-list from standard input. 93.It Fl m 94Always show progress-meter, even if not run from terminal. 95.It Fl o 96Scan binaries using 97.Xr ldd 1 , 98which also works for old a.out binaries, instead of 99.Xr objdump 1 , 100which only works for 101.Xr elf 5 102binaries. 103.It Fl O Ar dest 104Save result of first stage in file 105.Ar dest . 106.It Fl q 107Be quiet, do not emit 108.Sq Extra: 109wantlibs unless there's also an actual problem. 110.It Fl S Ar var Ns = Ns Ar value 111recognize list of libraries listed in a variable, and replace said list 112with variable value. 113For instance, 114.Fl S Ar COMPILER_LIBCXX Ns = Ns Ar stdc++ 115will replace 116.Sq stdc++ 117with 118.Sq ${COMPILER_LIBCXX} 119in 120.Ev WANTLIB 121lists for compatibility with both clang and gcc. 122Order matters. 123The first 124.Fl S 125option will be handled first. 126.It Fl s Ar src 127Don't scan, directly read result of first stage from file 128.Ar src . 129.It Fl x 130Don't show progress-meter, even if run from terminal. 131.El 132.Pp 133If no 134.Ar package 135is given, and the 136.Fl i 137option is used, 138.Nm 139will retrieve the packing-list from stdin, and scan the package according 140to other options. 141.Sh SEE ALSO 142.Xr ldd 1 , 143.Xr objdump 1 , 144.Xr bsd.port.mk 5 , 145.Xr elf 5 146.Sh BUGS 147Currently, 148.Nm 149doesn't handle libraries living in subdirectories of 150.Sq ${LOCALBASE} 151correctly. 152