Build Perl for Haiku and Finish the libperl Link
You will build Perl from its source tree on Haiku, install it, make the installed interpreter executable, and create the libperl.so link that the port expects. Allow roughly 20 to 40 minutes for a first build, plus time to investigate any failed tests. This guide follows the installed perlhaiku(1) manual from the Debian perl-doc package, version 5.38.2-3.2ubuntu0.6. The manual itself describes Perl 5.10 and later on Haiku, but its concrete library path uses Perl 5.38.2.
The route
Jump straight to the step you need, or tick off Done means at the end.
1. Confirm which instructions you have
Do this on the Haiku system where you intend to build and install Perl. The document available on this Linux machine is reference material, not a Linux build recipe. It is specifically about the Haiku port and records problems seen with Haiku revision 28311.
$ man perlhaiku
$ perl -v
On the reference machine, perl -v reports Perl 5.38.2, and the manual page is generated from Perl's documentation. That tells you the documentation package version, not the version of Perl already installed on your Haiku host. Use the Perl source version you actually downloaded when replacing the version component in the library path later.
Checkpoint
You are working in a Perl source tree on Haiku, and you know the version that tree is intended to build.
2. Configure the source tree
Change to the top level of the Perl source tree and run the standard configuration command from the manual:
$ ./Configure -de
The -d option asks Configure to accept its defaults, while -e enables Configure's automatic answers for the standard setup. The manual gives this exact command and does not document a Haiku-specific alternative here. Read the output as it appears. If Configure stops for a missing tool, an unsupported choice or a path you cannot accept, fix that problem before starting the compiler.
Configuration writes build metadata into the source tree. Keep the tree available until the build and installation have been checked. If you need a different build, use a clean source tree or follow Perl's own source-tree cleaning guidance for that version; this manual does not provide a safe clean-up command.
3. Build Perl
Start the compilation with the ordinary make command:
$ make
Expect compiler output and a long wait on slower Haiku hardware. A successful build returns to the shell without a make error. Do not treat a wall of test output as proof that the build failed: the important distinction is whether make exits successfully and whether the known platform-specific failures are the ones described below.
The installed manual says that Perl cannot currently be compiled with threading support on the Haiku revision it documents. If your configuration attempts to enable threading, stop and resolve that configuration choice rather than assuming the resulting binary is a supported build.
Checkpoint
make has completed, and you have recorded any failed tests or configuration warnings instead of ignoring them.
4. Install the build
Install the compiled Perl using the third command in the documented procedure:
$ make install
This changes the installed Perl tree, so treat it as an administrative operation. It may require permission to write the destination selected by Configure. Use the account and privilege method that is normal for your Haiku installation, and check the destination before granting elevated access. Do not run an unfamiliar command as an administrator merely to hide a path or permission error.
The manual's follow-up commands refer to /boot/common/bin/perl and /boot/common/lib. That is the installation layout this guide is describing. If your Configure run selected another layout, do not silently mix the two layouts: inspect the installed paths and adapt only when the Perl port documentation for your version supports it.
5. Make the interpreter executable
The Haiku instructions explicitly ask you to add execute permission to the installed interpreter:
$ chmod a+x /boot/common/bin/perl
This changes the mode of an installed file. Before running it, verify that the path names the Perl binary you just installed. The command is not a substitute for correcting an installation into the wrong directory. If you later need to undo this exact change, restore the file mode from your recorded pre-installation permissions; the perlhaiku(1) page does not state what those previous permissions should be, so do not guess them.
Now perform a basic check from the installed path:
$ /boot/common/bin/perl -v
The version shown should match the source version you intended to install. The exact banner is version-specific. A missing file, a permission error or a different version means you should stop before creating the library link.
6. Create the libperl link
The installed manual expects the shared library in the common library directory to point into Perl's versioned Haiku core directory. Replace 5.38.2 with your Perl version, then run:
$ cd /boot/common/lib
$ ln -s perl5/5.38.2/BePC-haiku/CORE/libperl.so .
The final dot means the link is created in /boot/common/lib, with the name libperl.so. The architecture directory in the documented example is BePC-haiku; do not change it to a Linux architecture name. If the link already exists, stop and inspect it rather than overwriting it. A pre-existing file or link may belong to another Perl installation.
Verify the link and its target without changing anything:
$ ls -l /boot/common/lib/libperl.so
$ /boot/common/bin/perl -v
The first command should show a symbolic link to the versioned CORE/libperl.so path. The second confirms that the installed interpreter still starts. These checks do not prove that every Perl module works, but they catch a missing executable and the most obvious library-path mistake.
Recovery
If you created this link with the wrong version and it is definitely the link from this procedure, remove that link only, then create the corrected one:
$ rm /boot/common/lib/libperl.so
That removal is irreversible for the directory entry. Do not run it when the path is a regular file or when you have not inspected the existing link.
7. Interpret the known failures
The manual records four Haiku-specific test limitations for revision 28311. Threading is unavailable. Datagram subtests in cpan/Socket/t/socketpair.t fail because Unix datagram sockets are not implemented. A subtest in cpan/Sys-Syslog/t/syslog.t fails because Haiku lacks /dev/log support. The service and UDP tests dist/Net-Ping/t/450_service.t and dist/Net-Ping/t/510_ping_udp.t fail because of network-stack bugs.
These notes are boundaries, not a general waiver for failed tests. A failure outside the listed cases needs investigation before you call the build complete. The page was last updated on 29 October 2008, so its known-problem list is tied to that documentation and Haiku revision. Do not claim that an unlisted failure is harmless merely because the interpreter starts.
Done means
./Configure -de,makeandmake installcompleted in the Haiku source tree./boot/common/bin/perlis executable and reports the intended Perl version./boot/common/lib/libperl.sopoints to the matching versionedBePC-haiku/CORE/libperl.so.- You can distinguish the four documented Haiku limitations from unexpected test failures.
- You recorded the original file mode and inspected the existing library path before making administrative changes.