From ab8df800c556e8c95fc233fcf13eaca31183c6d0 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 4 Apr 2014 11:14:35 +0200 Subject: [PATCH] Step 1: bootstrap: lang/perl5 --- lang/perl5/Makefile | 4 + lang/perl5/distinfo | 1 + lang/perl5/files/minix.sh | 257 ++++++++++++++++++++++++++++++ lang/perl5/hacks.mk | 6 + lang/perl5/patches/patch-zz-minix | 21 +++ 5 files changed, 289 insertions(+) create mode 100644 lang/perl5/files/minix.sh create mode 100644 lang/perl5/patches/patch-zz-minix diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile index 4bff0b692..aa5cfccbf 100644 --- a/lang/perl5/Makefile +++ b/lang/perl5/Makefile @@ -205,6 +205,7 @@ LIBSWANTED.HPUX= cl pthread $$libswanted # see Perl's README.hpux LIBSWANTED.IRIX= m crypt LIBSWANTED.Interix= m dl LIBSWANTED.Linux= m crypt dl nsl +LIBSWANTED.Minix= m crypt c LIBSWANTED.MirBSD= m crypt LIBSWANTED.NetBSD= m crypt LIBSWANTED.OpenBSD= m crypt @@ -224,6 +225,7 @@ SYSLIBPATH.Darwin= /usr/lib SYSLIBPATH.DragonFly= /usr/lib SYSLIBPATH.FreeBSD= /usr/lib SYSLIBPATH.Interix= /usr/lib +SYSLIBPATH.Minix= /usr/lib SYSLIBPATH.MirBSD= /usr/lib SYSLIBPATH.NetBSD= /usr/lib SYSLIBPATH.OpenBSD= /usr/lib @@ -289,6 +291,8 @@ post-extract: ${WRKSRC}/cpan/DB_File/hints/netbsd.pl cp ${FILESDIR}/cpan-DB_File-hints-openbsd.pl \ ${WRKSRC}/cpan/DB_File/hints/openbsd.pl +# MINIX: + cp ${FILESDIR}/minix.sh ${WRKSRC}/hints/minix.sh pre-configure: cd ${WRKSRC} && find `pwd` -name "*.orig" -type f -exec ${RM} -f {} \; diff --git a/lang/perl5/distinfo b/lang/perl5/distinfo index dedbac675..c66546fe3 100644 --- a/lang/perl5/distinfo +++ b/lang/perl5/distinfo @@ -24,3 +24,4 @@ SHA1 (patch-hints_sco.sh) = 8d43cdc0632799e1cdb5dc6fdb968052a9ae4216 SHA1 (patch-hints_solaris__2.sh) = 0e54889648a6f0f2a0232c5e01bef89d245c213d SHA1 (patch-ta) = a9d13eeec22733e4087942f217a0d47a19498a6f SHA1 (patch-ze) = d6fb718a1417e37a7d6bee1ae89fe2beec51c81b +SHA1 (patch-zz-minix) = e324d4a3f6e7bad648b0721093a09e6f047101ca diff --git a/lang/perl5/files/minix.sh b/lang/perl5/files/minix.sh new file mode 100644 index 000000000..ebc1c4949 --- /dev/null +++ b/lang/perl5/files/minix.sh @@ -0,0 +1,257 @@ +# hints/netbsd.sh +# +# Please check with packages@netbsd.org before making modifications +# to this file. + +case "$archname" in +'') + archname=`uname -m`-${osname} + ;; +esac + +# NetBSD keeps dynamic loading dl*() functions in /usr/lib/crt0.o, +# so Configure doesn't find them (unless you abandon the nm scan). +# Also, NetBSD 0.9a was the first release to introduce shared +# libraries. +# +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="-shared $lddlflags" + cat >UU/cc.cbu <<'EOCBU' +# gcc 4.6 doesn't support --whole-archive, but it's required for the +# system gcc to build correctly, so check for it +echo 'int f(void) { return 0; }' >try.c +if ${cc:-cc} $cccdlflags -c try.c -otry.o 2>&1 && + ${cc:-cc} --whole-archive $lddlflags try.o -otry.so 2>&1 ; then + lddlflags="--whole-archive $lddlflags" +fi +rm try.c try.o try.so 2>/dev/null +EOCBU + rpathflag="-Wl,-rpath," + case "$osvers" in + 1.[0-5]*) + # + # Include the whole libgcc.a into the perl executable + # so that certain symbols needed by loadable modules + # built as C++ objects (__eh_alloc, __pure_virtual, + # etc.) will always be defined. + # + 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 + +# netbsd had these but they don't really work as advertised, in the +# versions listed below. if they are defined, then there isn't a +# way to make perl call setuid() or setgid(). if they aren't, then +# ($<, $>) = ($u, $u); will work (same for $(/$)). this is because +# you can not change the real userid of a process under 4.4BSD. +# netbsd fixed this in 1.3.2. +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.*|6.*) + 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" + # MINIX Specific + d_gethostbyname_r="$undef" + d_gethostbyaddr_r="$undef" + d_gethostent_r="$undef" + d_sethostent_r="$undef" + d_endhostent_r="$undef" + d_inetntop="undef" + d_inetpton="undef" + d_ipv6_mreq="undef" + d_ipv6_mreq_source="undef" + d_sockaddr_in6="undef" + d_sin6_scope_id="undef" + d_usethreads="undef" + ;; +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 embedded 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/local, plus the build prefix, which might or might not be +# /usr/pkg. +# +loclibpth="/usr/local/lib ${prefix}/lib" +locincpth="/usr/local/include ${prefix}/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 <