Author: bernhard
Date: Sat Mar  4 02:06:22 2006
New Revision: 11785

Added:
   trunk/config/gen/platform/netbsd/
   trunk/config/gen/platform/netbsd/math.c
   trunk/config/init/hints/netbsd.pm

Log:
#38670: [NEW] Support for NetBSD
Added support for NetBSD.
Thanks to Steve Peters


Added: trunk/config/gen/platform/netbsd/math.c
==============================================================================
--- (empty file)
+++ trunk/config/gen/platform/netbsd/math.c     Sat Mar  4 02:06:22 2006
@@ -0,0 +1,46 @@
+# $Id$
+
+/*
+ * 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

Added: trunk/config/init/hints/netbsd.pm
==============================================================================
--- (empty file)
+++ trunk/config/init/hints/netbsd.pm   Sat Mar  4 02:06:22 2006
@@ -0,0 +1,25 @@
+# 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;

Reply via email to