It appears that building GHC requires Happy. It appears that building Happy requires GHC. How does one bootstrap this thing ? Versions : ghc-5.02.3 happy-1.13 [hogsett@linuxfs1 ghc-5.02.3]$ ./configure --prefix=/csl creating cache ./config.cache ... ... ... checking for happy... no checking for version of happy... grep: ./happy/mk/version.mk: No such file or directory configure: error: Happy version 1.9 or later is required to compile GHC. hmm... Ok. [hogsett@linuxfs1 ghc-5.02.3]$ ln -s ../happy-1.13 happy [hogsett@linuxfs1 ghc-5.02.3]$ rm config.cache [hogsett@linuxfs1 ghc-5.02.3]$ ./configure --prefix=/csl creating cache ./config.cache ... ... ... checking for happy... /home/hogsett/ghc/ghc-5.02.3/happy/src/happy-inplace checking for version of happy... grep: ./happy/mk/version.mk: No such file or directory configure: error: Happy version 1.9 or later is required to compile GHC. hmm... Ok. [hogsett@linuxfs1 ghc-5.02.3]$ cd ../happy-1.13/ [hogsett@linuxfs1 happy-1.13]$ ./configure --prefix=/csl creating cache ./config.cache ... ... ... checking for __gmpz_fdiv_qr in -lgmp3... no hmm... that finished... let's try to build this beast [hogsett@linuxfs1 happy-1.13]$ make make -C glafp-utils -r ... ... ... ... ------------------------------------------------------------------------ ==fptools== make boot -wr; in /home/hogsett/ghc/happy-1.13/happy/src ------------------------------------------------------------------------ if [ -d ../../ghc ]; then \ (cd ../../ghc/utils/unlit && make boot); \ (cd ../../ghc/includes && make boot); \ (cd ../../ghc/driver && make boot); \ fi M -optdep-f -optdep.depend -osuf o -ldl -cpp -fglasgow-exts -package lang -O -O AbsSyn.lhs First.lhs GenUtils.lhs GetOpt.lhs Grammar.lhs Info.lhs LALR.lhs Lexer.lhs Main.lhs ParseMonad.lhs Parser.hs ProduceCode.lhs Set.lhs Target.lhs Version.hs make[2]: M: Command not found make[2]: [depend] Error 127 (ignored) ------------------------------------------------------------------------ ==fptools== make boot -wr; in /home/hogsett/ghc/happy-1.13/happy/templates ------------------------------------------------------------------------ M -optdep-f -optdep.depend -osuf o -ldl GenericTemplate.hs make[2]: M: Command not found make[2]: [depend] Error 127 (ignored) ------------------------------------------------------------------------ make INSTALLING=0 BIN_DIST=0 --no-print-directory -r all ldl -cpp -fglasgow-exts -package lang -O -O -c AbsSyn.lhs -o AbsSyn.o make[3]: ldl: Command not found make[3]: [AbsSyn.o] Error 127 (ignored) ( followed by lots of make[3]: ldl: Command not found ) but it seems to have finished Back to ghc [hogsett@linuxfs1 ghc-5.02.3]$ ./configure loading cache ./config.cache checking for happy... /home/hogsett/ghc/ghc-5.02.3/happy/src/happy-inplace checking for version of happy... grep: ./happy/mk/version.mk: No such file or directory configure: error: Happy version 1.9 or later is required to compile GHC. Hmm... [hogsett@linuxfs1 ghc-5.02.3]$ cd ./happy/mk/ [hogsett@linuxfs1 mk]$ ls -l version.mk ls: version.mk: No such file or directory [hogsett@linuxfs1 mk]$ hmm... [hogsett@linuxfs1 mk]$ echo "ProjectVersion=1.13" > version.mk [hogsett@linuxfs1 mk]$ cd ../../ [hogsett@linuxfs1 ghc-5.02.3]$ !./configure ok that finished [hogsett@linuxfs1 ghc-5.02.3]$ make ... ... ... ------------------------------------------------------------------------ ==fptools== make boot -wr; in /home/hogsett/ghc/ghc-5.02.3/ghc/compiler ------------------------------------------------------------------------ /bin/sh: test: -ge: unary operator expected /bin/sh: test: -lt: unary operator expected Creating main/Config.hs ... done. rm -f prelude/primops.txt gcc -E -I../includes -traditional -x c prelude/primops.txt.pp | /bin/sed -e '/^#/d' > prelude/primops.txt ../utils/genprimopcode/genprimopcode --data-decl < prelude/primops.txt > primop-data-decl.hs-incl /bin/sh: ../utils/genprimopcode/genprimopcode: No such file or directory make[2]: *** [primop-data-decl.hs-incl] Error 126 make[1]: *** [boot] Error 1 make[1]: Leaving directory `/home/hogsett/ghc/ghc-5.02.3/ghc' make: *** [all] Error 1 Darn! How do I build this ! - Mike Hogsett
This is a very useful hack to bootstrap GHC, at least for minor versions... If you have the autoconf utility avalaible on your box: -which autoconf -type autoconf ( under bash shell ) try as follow: 1) Remove configure file ( rm configure) 2)Open the file fptools/aclocal.m4
dnl dnl Check for Happy and version. dnl AC_DEFUN(AC_HAPPY, [AC_PATH_PROG(HappyCmd,happy) AC_CACHE_CHECK([for version of happy], ac_cv_happy_version, [if test x"$HappyCmd" != x; then ac_cv_happy_version="`$HappyCmd -v | changequote(, )dnl grep 'Happy Version' | sed -e 's/Happy Version \([^ ]*\).*/\1/g'`" ; changequote([, ])dnl else ac_cv_happy_version=""; fi; if expr "$ac_cv_happy_version" "<" 1.4 > /dev/null 2>&1; then echo echo "Happy version 1.4 or later is required to compile GHC." exit 1 <====== THIS LINE ==============> fi; ])
2)Delete the line "exit 1".... 3) run autoconf ( autoconf ) under fptools ================================= Otherwise, if you don't have autoconf avalaible, you can just edit the configure script by hand... Search for the string "Happy" and delete the "exit 1" ... ================================ Once you have bootstraped ghc, you will be able to build Happy... Mike Hogsett wrote:
participants (2)
-
Mike Hogsett -
Rafael MartÃnez Torres