Hi!

I'd like to ask you to help me to compile OpenGL haskell binding with jhc.

Currently I have installed jhc 0.6. (I'm on Arch Linux x86 32 bit)

Here is the first issue:
jhc -v -f cpp --build-hl OpenGL.cabal
jhc -v -f cpp --build-hl OpenGL.cabal
jhc 0.6.0 (0.6.0-0)
Creating library from description file: "OpenGL.cabal"
Reading: "OpenGL.cabal"
Loading libraries: ["base","haskell98"]
Library: base-1.0        </usr/share/jhc-0.5/base-1.0.hl>
Library: haskell98-1.0   </usr/share/jhc-0.5/haskell98-1.0.hl>
Graphics.Rendering.OpenGL [./Graphics/Rendering/OpenGL.hs]
Graphics.Rendering.OpenGL.GL [./Graphics/Rendering/OpenGL/GL.hs]
Graphics.Rendering.OpenGL.GL.Antialiasing [./Graphics/Rendering/OpenGL/GL/Antialiasing.hs]
./Graphics/Rendering/OpenGL/GL/BasicTypes.hs:24: error: HsOpenGLConfig.h: No such file or directory
cpp exited abnormally

It seemed that i have to specify the inlcude dir. With include dir passing here is the second error:

jhc -v -f cpp -I include --build-hl OpenGL.cabal
jhc -v -f cpp -I include --build-hl OpenGL.cabal
jhc 0.6.0 (0.6.0-0)
Creating library from description file: "OpenGL.cabal"
Reading: "OpenGL.cabal"
Loading libraries: ["base","haskell98"]
Library: base-1.0        </usr/share/jhc-0.5/base-1.0.hl>
Library: haskell98-1.0   </usr/share/jhc-0.5/haskell98-1.0.hl>
Graphics.Rendering.OpenGL [./Graphics/Rendering/OpenGL.hs]
Graphics.Rendering.OpenGL.GL [./Graphics/Rendering/OpenGL/GL.hs]
Graphics.Rendering.OpenGL.GL.Antialiasing [./Graphics/Rendering/OpenGL/GL/Antialiasing.hs]
include/HsOpenGLConfig.h:1:1: Parse error

I've checked what is the cpp's output and it still contains preprocessor macros. e.g.: #line ....

Any idea?

Here is the alternative way what i was tried:

cabal --jhc install opengl
Resolving dependencies...                      
Configuring OpenGL-2.2.1.1...                  
checking for gcc... gcc                        
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes            
checking whether we are cross compiling... no           
checking for suffix of executables...                   
checking for suffix of object files... o                
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes                  
checking for gcc option to accept ISO C89... none needed
checking for Windows environment... no                  
checking how to run the C preprocessor... gcc -E        
checking for X... libraries , headers                   
checking for gethostbyname... yes                       
checking for connect... yes                             
checking for remove... yes                              
checking for shmat... yes                               
checking for IceConnectionNumber in -lICE... yes        
checking build system type... i686-pc-linux-gnu         
checking host system type... i686-pc-linux-gnu          
checking target system type... i686-pc-linux-gnu        
checking for atan... no                                 
checking for atan in -lm... yes                         
checking for GL library... -lGL -lm                     
checking for GLU library... -lGLU -lGL -lm              
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E                          
checking for ANSI C header files... yes                     
checking for sys/types.h... yes                             
checking for sys/stat.h... yes                              
checking for stdlib.h... yes                                
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking OpenGL/gl.h usability... no
checking OpenGL/gl.h presence... no
checking for OpenGL/gl.h... no
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking OpenGL/glu.h usability... no
checking OpenGL/glu.h presence... no
checking for OpenGL/glu.h... no
checking Haskell type for GLboolean... Word8
checking Haskell type for GLbyte... Int8
checking Haskell type for GLubyte... Word8
checking Haskell type for GLshort... Int16
checking Haskell type for GLushort... Word16
checking Haskell type for GLint... Int32
checking Haskell type for GLuint... Word32
checking Haskell type for GLsizei... Int32
checking Haskell type for GLenum... Word32
checking Haskell type for GLbitfield... Word32
checking Haskell type for GLfloat... Float
checking Haskell type for GLclampf... Float
checking Haskell type for GLdouble... Double
checking Haskell type for GLclampd... Double
checking Haskell type for GLchar... Int8
checking Haskell type for GLintptr... Int32
checking Haskell type for GLsizeiptr... Int32
configure: creating ./config.status
config.status: creating config.mk
config.status: creating OpenGL.buildinfo
config.status: creating include/HsOpenGLConfig.h
config.status: creating include/HsOpenGL.h
config.status: include/HsOpenGL.h is unchanged
Preprocessing library OpenGL-2.2.1.1...
Building OpenGL-2.2.1.1...
./Graphics/Rendering/OpenGL/GL/BasicTypes.hs:24: error: HsOpenGLConfig.h: No such file or directory
cpp exited abnormally
cabal: Error: some packages failed to install:
OpenGL-2.2.1.1 failed during the building phase. The exception was:
exit: ExitFailure 1