Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added patching of hints/netbsd.sh file for all perls.

  • Loading branch information...
commit 435296d955ec88a13b30663e9fa3c3a71ce466df 1 parent 4029c7f
@bingos authored
Showing with 219 additions and 1 deletion.
  1. +1 −1  dist.ini
  2. +218 −0 lib/Devel/PatchPerl.pm
View
2  dist.ini
@@ -1,5 +1,5 @@
name = Devel-PatchPerl
-version = 0.10
+version = 0.12
author = Chris Williams <chris@bingosnet.co.uk>
license = Perl_5
copyright_holder = Chris Williams and Marcus Holland-Moritz
View
218 lib/Devel/PatchPerl.pm
@@ -100,6 +100,14 @@ my @patch = (
[ \&_patch_makedepend_lc ],
],
},
+ {
+ perl => [
+ qr/.*/,
+ ],
+ subs => [
+ [ \&_patch_nbsd_hints ],
+ ],
+ },
);
sub patch_source {
@@ -258,6 +266,216 @@ sub _patch_makedepend_lc
END
}
+sub _patch_nbsd_hints {
+return unless $^O eq 'netbsd';
+chmod 0755, 'hints/netbsd.sh' or die "$!\n";
+open my $fh, '>', 'hints/netbsd.sh' or die "$\n";
+print $fh <<BADGER;
+# hints/netbsd.sh
+case "\$archname" in
+'')
+ archname=`uname -m`-\${osname}
+ ;;
+esac
+
+case "\$osvers" in
+0.9|0.8*)
+ usedl="\$undef"
+ ;;
+*)
+ case `uname -m` in
+ pmax)
+ # NetBSD 1.3 and 1.3.1 on pmax shipped an `old' ld.so,
+ # which will not work.
+ case "\$osvers" in
+ 1.3|1.3.1)
+ d_dlopen=\$undef
+ ;;
+ esac
+ ;;
+ esac
+ if test -f /usr/libexec/ld.elf_so; then
+ # ELF
+ d_dlopen=\$define
+ d_dlerror=\$define
+ cccdlflags="-DPIC -fPIC \$cccdlflags"
+ lddlflags="--whole-archive -shared \$lddlflags"
+ rpathflag="-Wl,-rpath,"
+ case "\$osvers" in
+ 1.[0-5]*)
+ ccdlflags="-Wl,-whole-archive -lgcc \
+ -Wl,-no-whole-archive -Wl,-E \$ccdlflags"
+ ;;
+ *)
+ ccdlflags="-Wl,-E \$ccdlflags"
+ ;;
+ esac
+ elif test -f /usr/libexec/ld.so; then
+ # a.out
+ d_dlopen=\$define
+ d_dlerror=\$define
+ cccdlflags="-DPIC -fPIC \$cccdlflags"
+ lddlflags="-Bshareable \$lddlflags"
+ rpathflag="-R"
+ else
+ d_dlopen=\$undef
+ rpathflag=
+ fi
+ ;;
+esac
+
+case "\$osvers" in
+0.9*|1.[012]*|1.3|1.3.1)
+ d_setregid="\$undef"
+ d_setreuid="\$undef"
+ ;;
+esac
+case "\$osvers" in
+0.9*|1.*|2.*|3.*|4.*|5.*)
+ d_getprotoent_r="\$undef"
+ d_getprotobyname_r="\$undef"
+ d_getprotobynumber_r="\$undef"
+ d_setprotoent_r="\$undef"
+ d_endprotoent_r="\$undef"
+ d_getservent_r="\$undef"
+ d_getservbyname_r="\$undef"
+ d_getservbyport_r="\$undef"
+ d_setservent_r="\$undef"
+ d_endservent_r="\$undef"
+ d_getprotoent_r_proto="0"
+ d_getprotobyname_r_proto="0"
+ d_getprotobynumber_r_proto="0"
+ d_setprotoent_r_proto="0"
+ d_endprotoent_r_proto="0"
+ d_getservent_r_proto="0"
+ d_getservbyname_r_proto="0"
+ d_getservbyport_r_proto="0"
+ d_setservent_r_proto="0"
+ d_endservent_r_proto="0"
+ ;;
+esac
+
+# These are obsolete in any netbsd.
+d_setrgid="\$undef"
+d_setruid="\$undef"
+
+# there's no problem with vfork.
+usevfork=true
+
+# This is there but in machine/ieeefp_h.
+ieeefp_h="define"
+
+# This script UU/usethreads.cbu will get 'called-back' by Configure
+# after it has prompted the user for whether to use threads.
+cat > UU/usethreads.cbu <<'EOCBU'
+case "\$usethreads" in
+\$define|true|[yY]*)
+ lpthread=
+ for xxx in pthread; do
+ for yyy in \$loclibpth \$plibpth \$glibpth dummy; do
+ zzz=\$yyy/lib\$xxx.a
+ if test -f "\$zzz"; then
+ lpthread=\$xxx
+ break;
+ fi
+ zzz=\$yyy/lib\$xxx.so
+ if test -f "\$zzz"; then
+ lpthread=\$xxx
+ break;
+ fi
+ zzz=`ls \$yyy/lib\$xxx.so.* 2>/dev/null`
+ if test "X\$zzz" != X; then
+ lpthread=\$xxx
+ break;
+ fi
+ done
+ if test "X\$lpthread" != X; then
+ break;
+ fi
+ done
+ if test "X\$lpthread" != X; then
+ # Add -lpthread.
+ libswanted="\$libswanted \$lpthread"
+ # There is no libc_r as of NetBSD 1.5.2, so no c -> c_r.
+ # This will be revisited when NetBSD gains a native pthreads
+ # implementation.
+ else
+ echo "\$0: No POSIX threads library (-lpthread) found. " \
+ "You may want to install GNU pth. Aborting." >&4
+ exit 1
+ fi
+ unset lpthread
+
+ # several reentrant functions are embeded in libc, but haven't
+ # been added to the header files yet. Let's hold off on using
+ # them until they are a valid part of the API
+ case "\$osvers" in
+ [012].*|3.[0-1])
+ d_getprotobyname_r=\$undef
+ d_getprotobynumber_r=\$undef
+ d_getprotoent_r=\$undef
+ d_getservbyname_r=\$undef
+ d_getservbyport_r=\$undef
+ d_getservent_r=\$undef
+ d_setprotoent_r=\$undef
+ d_setservent_r=\$undef
+ d_endprotoent_r=\$undef
+ d_endservent_r=\$undef ;;
+ esac
+ ;;
+
+esac
+EOCBU
+
+# Set sensible defaults for NetBSD: look for local software in
+# /usr/pkg (NetBSD Packages Collection) and in /usr/local.
+#
+loclibpth="/usr/pkg/lib /usr/local/lib"
+locincpth="/usr/pkg/include /usr/local/include"
+case "\$rpathflag" in
+'')
+ ldflags=
+ ;;
+*)
+ ldflags=
+ for yyy in \$loclibpth; do
+ ldflags="\$ldflags \$rpathflag\$yyy"
+ done
+ ;;
+esac
+
+case `uname -m` in
+alpha)
+ echo 'int main() {}' > try.c
+ gcc=`\${cc:-cc} -v -c try.c 2>&1|grep 'gcc version egcs-2'`
+ case "\$gcc" in
+ '' | "gcc version egcs-2.95."[3-9]*) ;; # 2.95.3 or better okay
+ *) cat >&4 <<EOF
+***
+*** Your gcc (\$gcc) is known to be
+*** too buggy on netbsd/alpha to compile Perl with optimization.
+*** It is suggested you install the lang/gcc package which should
+*** have at least gcc 2.95.3 which should work okay: use for example
+*** Configure -Dcc=/usr/pkg/gcc-2.95.3/bin/cc. You could also
+*** Configure -Doptimize=-O0 to compile Perl without any optimization
+*** but that is not recommended.
+***
+EOF
+ exit 1
+ ;;
+ esac
+ rm -f try.*
+ ;;
+esac
+
+# NetBSD/sparc 1.5.3/1.6.1 dumps core in the semid_ds test of Configure.
+case `uname -m` in
+sparc) d_semctl_semid_ds=undef ;;
+esac
+BADGER
+close $fh;
+}
+
sub _patch
{
my($patch) = @_;
Please sign in to comment.
Something went wrong with that request. Please try again.