do not edit — generated by btf.
git.druid.rocksindexdruid520portsports/languages/perl5/add.sh

ports/languages/perl5/add.sh


set -e
 
git clone https://github.com/Perl/perl5.git
cd perl5
# -Dccflags/-Dcppflags explicitly: perl's own Configure has its own
# elaborate -D<var>=<value> mechanism for build settings, and doesn't
# reliably inherit CFLAGS/CPPFLAGS from the environment the way autoconf
# does - one of Configure's many internal feature-detection probes
# (compiling its own try.c) was failing to find even <stdio.h> without
# this, the same class of gap already hit in gperf's own "lib"
# subdirectory and flex's own separate build-compiler check.
# -D_GNU_SOURCE: perl's own Configure detects (and then calls) several
# GNU-extension libc functions (eaccess among them) that musl only
# declares under _GNU_SOURCE - a very common, well-known musl
# compatibility need for software originally written/tested against
# glibc, which exposes far more of these by default.
# strip any static/PIE-forcing flags from a global build-flags policy
# (-static-pie, -static, -fno-pie, -no-pie) before configuring: perl's
# own build needs to dlopen() its XS extension modules even while
# building itself (pod/buildtoc needs a working Cwd, for example), and a
# statically-linked perl can never do that ("Dynamic loading not
# supported"). hit for real under a system-wide -fPIC -static-pie
# policy: perl failed mid-build on its own Cwd.so, and the resulting
# static perl binary that WAS produced couldn't even run mp itself
# afterward (mp.pl needs FindBin -> Cwd), needing hand recovery from a
# separate, untouched dynamic perl.
perl_cflags="$(printf '%s' "$CFLAGS" | sed -E 's/-static-pie|-static\b|-fno-pie|-no-pie//g')"
perl_ldflags="$(printf '%s' "$LDFLAGS" | sed -E 's/-static-pie|-static\b|-fno-pie|-no-pie//g')"
./Configure -des -Dusedevel -Dprefix=$MP_PREFIX/perl5-git -Dccflags="$perl_cflags -D_GNU_SOURCE" -Dcppflags="$CPPFLAGS -D_GNU_SOURCE" -Dldflags="$perl_ldflags"
make
make install
mkdir -p $MP_PREFIX/bin
ln -sf $(ls $MP_PREFIX/perl5-git/bin/perl5.*) $MP_PREFIX/bin/perl
ln -sf $(ls $MP_PREFIX/perl5-git/bin/perldoc5.*) $MP_PREFIX/bin/perldoc
ln -sf $(ls $MP_PREFIX/perl5-git/bin/cpan5.*) $MP_PREFIX/bin/cpan
make clean || true
powered by btf.