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
* Volker Stolz
(Perhaps it's better to let the user supply the correct CFLAGS for threads?)
Yes! PTHREAD_LIBS do not only differ on different OS, but also on FreeBSD-stable (-pthread) and FreeBSD-current (-lc_r). Regards, Olli -- Oliver Braun -- obraun @ { unsane.org | FreeBSD.org | haskell.org }
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
-#ifndef __SYMBIAN32__ +#if !defined(__SYMBIAN32__) && !defined(__FreeBSD__) # include #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>],
Just a note: The real fix is to write test which involves a test compilation + linking on the *host* system. Dispatching on a platform ID is basically a hack and even if it's done, the *target* platform should be taken into account, not the host platform. Cheers, S.
On Wed, Aug 27, 2003 at 11:21:26AM +0200, Volker Stolz wrote:
The first patch to prelude.h avoids loads of gratuitious warnings about using malloc.h (which is deprecated).
Thanks -- I've applied a variant of this.
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 don't know much about this, but on a quick look around it seems that this situation is a real mess. I've changed configure.in to use the ACX_PTHREAD macro (from the GNU Autoconf Macro Archive). I see it prefers -kthread on FreeBSD, and hope that's OK. It is also ignorant of -lc_r. In any case, you can override it by setting PTHREAD_LIBS or PTHREAD_CFLAGS in the environment of configure. I've updated the tarball.
participants (5)
-
dons@cse.unsw.edu.au -
Oliver Braun -
Ross Paterson -
Sven Panne -
Volker Stolz