Error building hmake-3.00 in RH Linux with ghc-5.02.2

On Mon, Jan 21, 2002 at 11:57:04AM +0000, Malcolm Wallace wrote:
hmake-3.00 ---------- We are pleased to announce the release of version 3.00 of 'hmake', the Haskell program compilation manager.
Compiling hmake-3.00 with ghc-5.02.2 in my RedHat Linux 7.2 box gives me the following errors. $ ./configure --prefix=/usr --mandir=/usr/share/man/man1 --buildwith=ghc --buildopts=-O [...] $ make 'OPT=-O2 -march=i386 -mcpu=i686' [...] sh /home/romildo/rpmbuild/BUILD/hmake-3.00/targets/ix86-Linux/hmake3.config hmake-config: Warning: Config file not found: '/home/romildo/rpmbuild/BUILD/hmake-3.00/lib/ix86-Linux/hmakerc' hmake-config: Starting new config from scratch. Fail: Can't find ghc includes at /imports Fail: Can't find ghc includes at /imports hmake-config: compiler not known: 'ghc' make[1]: *** [config] Error 2 make[1]: Leaving directory `/home/romildo/rpmbuild/BUILD/hmake-3.00/src/hmake' make: *** [targets/ix86-Linux/hmake-ghc] Error 2 Any clues? Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br

Compiling hmake-3.00 with ghc-5.02.2 in my RedHat Linux 7.2 box gives me the following errors.
$ ./configure --prefix=/usr --mandir=/usr/share/man/man1 --buildwith=ghc --buildopts=-O [...]
$ make 'OPT=-O2 -march=i386 -mcpu=i686' [...] sh /home/romildo/rpmbuild/BUILD/hmake-3.00/targets/ix86-Linux/hmake3.config hmake-config: Warning: Config file not found: '/home/romildo/rpmbuild/BUILD/hmake-3.00/lib/ix86-Linux/hmakerc' hmake-config: Starting new config from scratch. Fail: Can't find ghc includes at /imports Fail: Can't find ghc includes at /imports hmake-config: compiler not known: 'ghc' make[1]: *** [config] Error 2
It looks like there is some trouble detecting the import directories for your installation of ghc. What version of ghc do you have? What is the full path to ghc's driver script? And does the driver script contain a line like this: libdir='/usr/local/lib/ghc-5.00.1' Regards, Malcolm

On Mon, Jan 21, 2002 at 06:44:34PM +0000, Malcolm Wallace wrote:
Compiling hmake-3.00 with ghc-5.02.2 in my RedHat Linux 7.2 box gives me the following errors.
$ ./configure --prefix=/usr --mandir=/usr/share/man/man1 --buildwith=ghc --buildopts=-O [...]
$ make 'OPT=-O2 -march=i386 -mcpu=i686' [...] sh /home/romildo/rpmbuild/BUILD/hmake-3.00/targets/ix86-Linux/hmake3.config hmake-config: Warning: Config file not found: '/home/romildo/rpmbuild/BUILD/hmake-3.00/lib/ix86-Linux/hmakerc' hmake-config: Starting new config from scratch. Fail: Can't find ghc includes at /imports Fail: Can't find ghc includes at /imports hmake-config: compiler not known: 'ghc' make[1]: *** [config] Error 2
It looks like there is some trouble detecting the import directories for your installation of ghc. What version of ghc do you have? What is the full path to ghc's driver script? And does the driver script contain a line like this:
libdir='/usr/local/lib/ghc-5.00.1'
I have ghc-5.02.2 installed from the RPM packages by Manuel M. T. Chakravarty, available at ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-5.02.2-1.i386.rpm I do not know exactly what is the ghc driver script, but none of the files from the package has a line matching the regular expression "libdir.*=", except the file /usr/bin/ghcprof, which I believe is not being used. There is a /usr/bin/ghc Bourne shell script: #!/bin/sh GHCBIN="/usr/lib/ghc-5.02.2/ghc-5.02.2"; TOPDIROPT="-B/usr/lib/ghc-5.02.2"; # Mini-driver for GHC exec $GHCBIN $TOPDIROPT ${1+"$@"} I hope this help diagnosing the problem. Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br

There is a /usr/bin/ghc Bourne shell script:
#!/bin/sh GHCBIN=3D"/usr/lib/ghc-5.02.2/ghc-5.02.2"; TOPDIROPT=3D"-B/usr/lib/ghc-5.02.2"; # Mini-driver for GHC exec $GHCBIN $TOPDIROPT ${1+"$@"}
Thank you. It would seem that this shell script is very different in RPM-versions of ghc than the standard tar distributions. In particular, the regular expression 'libdir=.*' (which was supplied to me by the GHC team as a foolproof way of recognising import directories) is completely absent. Here is a small patch to try to use the TOPDIROPT variable if the libdir test fails. Can you let me know whether it works please? Regards, Malcolm =================================================================== diff -u -r1.7 src/hmake/MkConfig.hs --- src/hmake/MkConfig.hs 2002/01/21 11:25:47 1.7 +++ src/hmake/MkConfig.hs 2002/01/21 21:58:42 @@ -165,6 +165,10 @@ else do dir <- runAndReadStdout ("grep '^libdir=' "++fullpath++" | head -1 | " ++ "sed 's/^libdir=.\\(.*\\)./\\1/'") + dir <- if null dir then + runAndReadStdout ("grep '^TOPDIROPT=' "++fullpath + ++" | sed 's/^TOPDIROPT=.-B\\(.*\\).;/\\1/'") + else return dir let incdir1 = dir++"/imports" ok <- doesDirectoryExist incdir1 if ok

On Mon, Jan 21, 2002 at 10:06:05PM +0000, Malcolm Wallace wrote:
There is a /usr/bin/ghc Bourne shell script:
#!/bin/sh GHCBIN=3D"/usr/lib/ghc-5.02.2/ghc-5.02.2"; TOPDIROPT=3D"-B/usr/lib/ghc-5.02.2"; # Mini-driver for GHC exec $GHCBIN $TOPDIROPT ${1+"$@"}
Thank you. It would seem that this shell script is very different in RPM-versions of ghc than the standard tar distributions. In particular, the regular expression 'libdir=.*' (which was supplied to me by the GHC team as a foolproof way of recognising import directories) is completely absent.
Here is a small patch to try to use the TOPDIROPT variable if the libdir test fails. Can you let me know whether it works please?
It works. Thanks. Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br
participants (2)
-
José Romildo Malaquias
-
Malcolm Wallace