Error installing Haskell X11 package

by hitesh on 2008-9-25

Recently I was having trouble installing the Haskell X11 package on OSX Leopard. Running configure generated an error.

bash-3.2$ runhaskell Setup.hs configure
Warning: defaultUserHooks in Setup script is deprecated.
Configuring X11-1.4.3...
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 how to run the C preprocessor... gcc -E
checking for X... no
configure: error: X11 libraries not found, so X11 package cannot be built
See `config.log' for more details.

Of course I had X11 libraries. In fact, I had them from both Leopard and MacPorts. I had them all over the place, but cabal wasn't finding them.

bash-3.2$ locate libX11.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.dylib
/Previous Systems.localized/2008-07-15_1549/Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib/libX11.dylib
/Previous Systems.localized/2008-07-15_1549/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.dylib
/Previous Systems.localized/2008-07-15_1549/usr/X11R6/lib/libX11.dylib
/opt/local/lib/libX11.dylib
/opt/local/var/macports/software/xorg-libX11/1.1.3_0/opt/local/lib/libX11.dylib
/usr/X11/lib/libX11.dylib

I tried adding extra-lib-dirs: /usr/X11/lib to X11.cabal, but it didn't fix the error. I upgraded Cabal to version 1.4.0.2, but that didn't work either. What did finally work was setting LDFLAGS.

bash-3.2$ export LDFLAGS=-L/usr/X11/lib
bash-3.2$ runhaskell Setup.hs configure
Warning: defaultUserHooks in Setup script is deprecated.
Configuring X11-1.4.3...
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 how to run the C preprocessor... gcc -E
checking for X... libraries , headers
checking for gethostbyname... yes
...

Tags: haskell, osx

Comments

blog comments powered by Disqus