Minor BSD fixes for Hugs Aug03

Donald Bruce Stewart dons@cse.unsw.edu.au
Wed, 27 Aug 2003 21:26:06 +1000


Hey.

For prelude.h adding:

    !defined(__NetBSD__) && !defined(__OpenBSD__)

is fine.

For the configure.in, it is correct to use:

    *-*-freebsd*|*-*-openbsd*)
        LIBS="$LIBS -pthread"

But I think NetBSD takes -lpthread. At least it does on my
m68k-apple-netbsd box.

vs:
> 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

> --- 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))

> --- 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>],