I ran into minor problems compiling GHC 3.01 on my up-to-date Debian
Linux machine. I'm pretty sure that the problem is that I'm using
Libc 6 (GNU libc 2).
Basically, several BSD extensions (in particular, the types caddr_t
and u_long, and the tm_zone and tm_gmtoff members of struct tm) are
not available when _POSIX_SOURCE is defined; I also had to define
_BSD_SOURCE to include them. (One problem is that configure tests for
feature availability with no _*_SOURCE defines; defining _POSIX_SOURCE
then disables features that configure detected as present.)
Here's the patch I made:
--- stgdefs.h~ Sun Oct 5 13:34:00 1997
+++ stgdefs.h Sun May 10 15:52:25 1998
@@ -53,10 +53,12 @@
#ifdef NON_POSIX_SOURCE
#undef _POSIX_SOURCE
#undef _POSIX_C_SOURCE
+#define _BSD_SOURCE
#else
# ifndef aix_TARGET_OS
/* already defined on aix */
#define _POSIX_SOURCE 1
+#define _BSD_SOURCE 1
# endif
#ifndef irix_TARGET_OS
#define _POSIX_C_SOURCE 199301L
While this works for me, I wouldn't suggest that you apply it blindly;
I don't know if it might break other places. Ideally, it would be
conditioned on having GNU libc 2.0 (Linux libc 6); I don't know how to
check for that here.
Random information about my system:
Linux gemini 2.0.29 #4 Thu Oct 23 00:34:55 PDT 1997 i686 unknown
gcc version 2.7.2.3
Let me know if you have any questions, or want me to test patches.
Carl Witty
[EMAIL PROTECTED]