[Haskell-cafe] How to install HOpenGL to Windows?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Apr 26 18:11:20 EDT 2009

On Sun, 2009-04-26 at 19:03 +0200, Sven Panne wrote:

> The build process in itself is purely Cabal-based, it is only the 
> configuration above which done via autoconf. So in theory you could write the 
> few output files of the configure run by hand and then use Cabal, without any 
> MinGW/MSYS or cygwin.
> I don't see how Cabal could help here even further, the tests above are quite 
> OpenGL-specific, but I am open for suggestions.

Cabal packages allow some configuration to be done in the Setup.hs
however the Cabal library does not provide much in the way to help you
do the kinds of test that you need to do (esp compared to the large lib
of macros that autoconf provides). What I'd like someone to do is to
investigate what tests we'd need to provide that would allow us to
eliminate which ./configure scripts.


I want an answer like:

        "If we implement these 5 tests then we can cover enough
        functionality to eliminate the ./configure script in these 10
        packages. If we add these 3 extra then we can eliminate a
        further 5 ./configure scripts."

Sven, perhaps you can contribute to this task by noting in slightly more
detail what tests we'd need to do in the Setup.hs to eliminate
the ./configure script for OpenGL and what support you'd want from the
Cabal library to do so. The above bullet points are a good start but we
probably want slightly more detail.

Let me start with some naive suggestions and perhaps you can fill in the

>    * How to link programs using OpenGL

This is because the GL libs are called different names on different
platforms right? But they're consistent within each platform, it's just
Windows vs everyone else isn't it?

How about:

if os(windows)
  extra-libraries: gl32
  extra-libraries: GL

>    * The Haskell types corresponding to the OpenGL types

Does hsc2hs #type not help us with this?

(I would also suggest c2hs but that would be a much bigger change in the

>    * To do the former: How to find the OpenGL C headers

What's needed here? Are they not in standard locations? Cabal has
support for users to specify non-standard locations.

>    * The library calling convention

This is stdcall on Windows and ccall everywhere else right?

How about:

if os(windows)
  cpp-options: -DCALLCONV=stdcall
  cpp-options: -DCALLCONV=ccall

>    * How to load OpenGL extensions

I don't know enough of the details here to comment.


More information about the Haskell-Cafe mailing list