Minor BSD fixes for Hugs Aug03

Volker Stolz <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
The first patch to prelude.h avoids loads of gratuitious warnings about
using malloc.h (which is deprecated).

The second patch to configure.in caters for FreeBSDs different pthread-flags.
(Perhaps it's better to let the user supply the correct CFLAGS for threads?)

I think both patches apply to OpenBSD and NetBSD as well. 

Regards,
  Volker
(cc: Mr. OpenBSD)
-- 
Volker Stolz * http://www-i2.informatik.rwth-aachen.de/stolz/ * PGP * S/MIME
hugs1 (text/plain, 390 B)
--- prelude.h.orig	Wed Aug 27 10:13:06 2003
+++ prelude.h	Wed Aug 27 10:17:58 2003
@@ -553,7 +553,7 @@
 # define farCalloc(n,s)	farcalloc((unsigned long)n,(unsigned long)s)
 #elif HAVE_VALLOC
 # include <stdlib.h>
-#ifndef __SYMBIAN32__
+#if !defined(__SYMBIAN32__) && !defined(__FreeBSD__)
 # include <malloc.h>
 #endif
 # define farCalloc(n,s)	(Void *)valloc(((unsigned)n)*((unsigned)s))
hugs2 (text/plain, 549 B)
--- configure.in.orig	Wed Aug 27 10:04:54 2003
+++ configure.in	Wed Aug 27 10:10:50 2003
@@ -107,7 +107,16 @@
 AC_ARG_WITH(pthreads,
   AC_HELP_STRING([--with-pthreads],
                  [build Hugs using pthreads C library]),
-  [AC_DEFINE(DONT_PANIC) MTCFLAGS="-D_REENTRANT"; LIBS="$LIBS -lpthread"])
+  [AC_DEFINE(DONT_PANIC) MTCFLAGS="-D_REENTRANT"; 
+case $HostPlatform in
+  *-*-freebsd*)
+    LIBS="$LIBS -pthread"
+    ;;
+  *)
+    LIBS="$LIBS -lpthread"
+    ;;
+esac
+])
 
 AC_ARG_WITH(fptools,
   AC_HELP_STRING([--with-fptools=<dir>],
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.