1.\" $OpenBSD: check-lib-depends.1,v 1.6 2024/05/24 11:52:45 op 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: May 24 2024 $ 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 fimqx 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 . 57.It 58compare those libraries against the port's registered dependencies 59and report problems. 60.El 61.Pp 62The options are as follows: 63.Bl -tag -width keyword 64.It Fl B Ar destdir 65Scan files under 66.Ar destdir . 67.It Fl d Ar pkgrepo 68Look for all needed packages under directory 69.Ar pkgrepo . 70.It Fl D Ar directory 71Create debug log files under 72.Ar directory 73that show in more details the run of 74.Xr objdump 1 . 75.It Fl f 76Give full reports of every file that requires a missing library. 77.It Fl F Ar missing 78Works in tandem with 79.Fl S . 80Allow backsubstituting even if the 81.Ar missing 82library 83is actually not part of the actual 84.Ev WANTLIB 85of the package. 86Mostly used to waive the presence of 87.Ar pthread , 88a mandatory dependency of C++ libraries on some architectures. 89.It Fl i 90Read packing-list from standard input. 91.It Fl m 92Always show progress-meter, even if not run from terminal. 93.It Fl O Ar dest 94Save result of first stage in file 95.Ar dest . 96.It Fl q 97Be quiet, do not emit 98.Sq Extra: 99wantlibs unless there's also an actual problem. 100.It Fl S Ar var Ns = Ns Ar value 101Recognize list of libraries listed in a variable, and replace said list 102with variable value. 103For instance, 104.Fl S Ar COMPILER_LIBCXX Ns = Ns Ar stdc++ 105will replace 106.Sq stdc++ 107with 108.Sq ${COMPILER_LIBCXX} 109in 110.Ev WANTLIB 111lists for compatibility with both clang and gcc. 112Order matters. 113The first 114.Fl S 115option will be handled first. 116.It Fl s Ar src 117Don't scan, directly read result of first stage from file 118.Ar src . 119.It Fl x 120Don't show progress-meter, even if run from terminal. 121.El 122.Pp 123If no 124.Ar package 125is given, and the 126.Fl i 127option is used, 128.Nm 129will retrieve the packing-list from stdin, and scan the package according 130to other options. 131.Sh SEE ALSO 132.Xr ldd 1 , 133.Xr objdump 1 , 134.Xr bsd.port.mk 5 , 135.Xr elf 5 136.Sh BUGS 137Currently, 138.Nm 139doesn't handle libraries living in subdirectories of 140.Sq ${LOCALBASE} 141correctly. 142