#5172: unix-compat does not build because of strangeness in GHC's header files.
---------------------------------+------------------------------------------
Reporter: rtvd | Owner:
Type: bug | Status: infoneeded
Priority: normal | Milestone:
Component: Runtime System | Version: 7.0.3
Keywords: unix-compat | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Other
---------------------------------+------------------------------------------
Changes (by simonmar):
* status: new => infoneeded
Old description:
> I have build 7.0.3 from source and then tried building unix-compat
> library.
> The library failed to build because it could not find libutil.h.
>
> Digging a bit deeper I found the following:
>
> unix-compat includes among other things header files from GHC.
>
> ./libraries/unix/include/HsUnixConfig.h has this in it:
>
> /* Define to 1 if you have the <libutil.h> header file. */
> #define HAVE_LIBUTIL_H 0
>
> However, ./libraries/unix/include/HsUnix.h has this:
>
> #ifdef HAVE_LIBUTIL_H
> #include <libutil.h>
> #endif
>
> Naturally, it has tried to include the non-existing libutil.h. Even
> though HAVE_LIBUTIL_H is zero, it is still considered to be defined.
>
> After removing this line:
>
> #define HAVE_LIBUTIL_H 0
>
> unix-compat has been successfully built.
New description:
I have build 7.0.3 from source and then tried building unix-compat
library.
The library failed to build because it could not find libutil.h.
Digging a bit deeper I found the following:
unix-compat includes among other things header files from GHC.
./libraries/unix/include/HsUnixConfig.h has this in it:
{{{
/* Define to 1 if you have the <libutil.h> header file. */
#define HAVE_LIBUTIL_H 0
}}}
However, ./libraries/unix/include/HsUnix.h has this:
{{{
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#endif
}}}
Naturally, it has tried to include the non-existing libutil.h. Even though
HAVE_LIBUTIL_H is zero, it is still considered to be defined.
After removing this line:
{{{
#define HAVE_LIBUTIL_H 0
}}}
unix-compat has been successfully built.
--
Comment:
I don't understand how you ended up with
{{{
#define HAVE_LIBUTIL_H 0
}}}
Normally when a header file does not exist, autoconf generates a line that
looks like
{{{
/* Define to 1 if you have the <wibble.h> header file. */
/* #undef HAVE_WIBBLE_H */
}}}
(I just tested this by adding a new header file test to `configure.ac`, as
you can see).
Where did you get your GHC distribution, and what platform is this?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5172#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs