2.
You don't have access to a
FreeBSD system. In that case, you should get the extra files you need from various ftp sites. Information on where to look for the various files is appended below. For now, let's assume you know where to get the files.
Retrieve the following files (from _one_ ftp site to avoid any version mismatches), and install them under
/emul/freebsd (i.e.
foo/bar is installed as
/emul/freebsd/foo/bar):
ldconfig and
ldd don't necessarily need to be under
/emul/freebsd, you can install them elsewhere in the system too. Just make sure they don't conflict with their
NetBSD counterparts. A good idea would be to install them in
/usr/local/bin as
ldconfig-freebsd and
ldd-freebsd.
Run the
FreeBSD ldconfig program with directory arguments in which the
FreeBSD runtime linker should look for shared libs.
/usr/lib are standard, you could run like the following:
me@netbsd% mkdir -p /emul/freebsd/var/run
me@netbsd% touch /emul/freebsd/var/run/ld.so.hints
me@netbsd% ldconfig-freebsd /usr/X11R6/lib /usr/local/lib
Note that argument directories of ldconfig are mapped to
/emul/freebsd/XXXX by
NetBSD's compat code, and should exist as such on your system. Make sure
/emul/freebsd/var/run/ld.so.hints is existing when you run
FreeBSD's ldconfig, if not, you may lose
NetBSD's
/var/run/ld.so.hints.
FreeBSD ldconfig should be statically linked, so it doesn't need any shared libraries by itself. It will create the file
/emul/freebsd/var/run/ld.so.hints. You should rerun the
FreeBSD version of the ldconfig program each time you add a new shared library.
You should now be set up for
FreeBSD binaries which only need a shared libc. You can test this by running the
FreeBSD ldd on itself. Suppose that you have it installed as
ldd-freebsd, it should produce something like:
me@netbsd% ldd-freebsd `which ldd-freebsd`
/usr/local/bin/ldd-freebsd: -lc.2 => /usr/lib/libc.so.2.1 (0x1001a000)
This being done, you are ready to install new
FreeBSD binaries. Whenever you install a new
FreeBSD program, you should check if it needs shared libraries, and if so, whether you have them installed in the
/emul/freebsd tree. To do this, you run the
FreeBSD version
ldd on the new program, and watch its output.
ldd (see also the manual page for
ldd(1)) will print a list of shared libraries that the program depends on, in the form -l<majorname> => <fullname>.
If it prints “not found” instead of <fullname> it means that you need an extra library. Which library this is, is shown in <majorname>, which will be of the form XXXX.<N> You will need to find a libXXXX.so.<N>.<mm> on a
FreeBSD ftp site, and install it on your system. The XXXX (name) and <N> (major revision number) should match; the minor number(s) <mm> are less important, though it is advised to take the most recent version.