# New Ticket Created by Bernhard Schmalhofer # Please include the string: [perl #38670] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38670 >
This was posted in p6i by Steve Peters, [EMAIL PROTECTED]: Thanks to the work that's already been done, it was very easy to get NetBSD up and running. The attached patch is all that's needed to add NetBSD support to Parrot.
--- /dev/null 2006-03-01 20:37:19.000000000 -0600 +++ config/init/hints/netbsd.pm 2006-03-01 20:15:46.000000000 -0600 +# Copyright: 2006 The Perl Foundation. All Rights Reserved. +# $Id$ + +package init::hints::netbsd; + +use strict; + +sub runstep +{ + my ($self, $conf) = @_; + + my $ccflags = $conf->data->get('ccflags'); + if ($ccflags !~ /-pthread/) { + $ccflags .= ' -pthread'; + } + $conf->data->set(ccflags => $ccflags); + + my $libs = $conf->data->get('libs'); + if ($libs !~ /-lpthread/) { + $libs .= ' -lpthread'; + } + $conf->data->set(libs => $libs); +} + +1; --- /dev/null 2006-03-01 20:37:19.000000000 -0600 +++ config/gen/platform/netbsd/math.c 2006-03-01 20:15:46.000000000 -0600 @@ -0,0 +1,44 @@ +/* + * math stuff + */ + +/* + * force atan2() to use IEEE behavior + */ + +#include <math.h> + +_LIB_VERSION_TYPE _LIB_VERSION = _IEEE_; + +/* + * return true if the Numval has a negative sign + */ +#if DOUBLE_SIZE == 2 * INT_SIZE +int +Parrot_signbit(double x) +{ + union { + double d; + int i[2]; + } u; + u.d = x; +#if PARROT_BIGENDIAN + return u.i[0] < 0; +#else + return u.i[1] < 0; +#endif +} +#endif + +#if NUMVAL_SIZE == 12 && DOUBLE_SIZE == 3 * INT_SIZE && PARROT_LITTLE_ENDIAN +int +Parrot_signbit_l(long double x) +{ + union { + long double d; + int i[3]; + } u; + u.d = x; + return u.i[2] < 0; +} +#endif