# compat3x

This FreeBSD port packages five prebuilt i386 libraries from the FreeBSD 3.5.1
release: `libc.so.3`, `libm.so.2`, `libg++.so.4`, `libstdc++.so.2`, and
`libgnuregex.so.2`. It reconstructs the split `bin` distribution in order and
extracts only those files. `distinfo` records SHA-256 checksums and sizes for all
111 chunks; the source chunks were also checked against the release's original
`CHECKSUM.MD5` before generating it.

With the default prefix, libraries install to:

| Architecture | Directory |
| --- | --- |
| amd64 | `/usr/local/lib32/compat/compat3x` |
| i386 | `/usr/local/lib/compat/compat3x` |

The dedicated directory avoids file conflicts with other compatibility packages.
The port registers it with the appropriate runtime-linker cache. Explicitly
select it in a legacy application's library search path when other packages
provide libraries with the same names.

From this repository's root, with a Ports tree installed at `/usr/ports`:

```sh
make -C port/misc/compat3x PORTSDIR=/usr/ports package
```

To install it, run as root:

```sh
make -C port/misc/compat3x PORTSDIR=/usr/ports install
```

For Applix on amd64, replace the manually extracted base-library directory in
its launch environment with this port's directory. For example, when the old
XFree86 `libX11.so.6` remains in `/usr/local/lib32/compat/applix`:

```sh
export LD_32_LIBRARY_PATH=/usr/local/lib32/compat/compat3x:/usr/local/lib32/compat/applix:/usr/local/lib32/compat:/usr/local/applixware/axdata/axshlib
export LD_32_PRELOAD=/usr/local/lib/libc3-shim-02.so
```

XFree86, the Applix application files, modern lib32 support, and shim 02 remain
separate. This port supplies library files; it does not restore obsolete kernel
interfaces or translate changed data layouts.

Checksum verification, staging, `check-plist`, `stage-qa`, and package creation
passed on FreeBSD 15.0 amd64 using cached release chunks. The installed Ports
tree required `ALLOW_UNSUPPORTED_SYSTEM=yes` for that test. The i386 install
path was checked through Makefile evaluation; an i386 package build and a live
Applix run using the package have not been tested.
