Bootstrapping for Leopard

Matthias Kilian kili at outback.escape.de
Wed Jan 30 14:59:56 EST 2008


On Wed, Jan 30, 2008 at 08:13:01PM +1100, Manuel M T Chakravarty wrote:
[Philip K.F. Hölzenspies:]
> >make hc-file-bundle
> >
> >Making the hc-file-bundle target failed, because not all rts/*.cmm had
> >rts/*.hc counterparts after the build. The make fails because of this
> >fragment from the Makefile (part of the hc-file-bundle target,  
> >starting from
> >line 513):
> >
> >for f in `$(FIND) ghc-$(ProjectVersion)/compiler
> >ghc-$(ProjectVersion)/rts -name "*.cmm" -follow -print` ""; do \
> > if test "x$$f" !=3D "x"; then \
> >   echo `echo "$$f" | sed 's/cmm$$/hc/g' ` >> hc-files-to-go ; \
> > fi; \
> >done;

This is strange. I've all kinds of trouble getting hc-bootstrapping back
(for OpenBSD, but also in general), and I didn't see *that* problem.

> >checking for path to top of build tree... ./configure: line 2651: - 
> >v0: command
> >not found
> >./configure: line 2655: utils/pwd/pwd: No such file or directory
> >configure: error: cannot determine current directory
[...]
> This is due to a change of the configure stage that AFAIK was made to  
> easy building on windows.  Instead, of using shell commands/scripts  
> (as GHC did previously) to obtain some configuration information (here  
> the file path at which the top of the GHC build tree is located), the  
> build system now uses small Haskell programs/scripts.  This makes the  
> build more portable ** if there is already a Haskell compiler on the  
> system **.

But it just doesn't make sense at all. You need a good set of shell
commands at all, since they're used by configure as well as in
Makefiles. I really can't believe that simple stuff like this doesn't
work on windos:

--- aclocal.m4.orig	Mon Dec 10 19:11:31 2007
+++ aclocal.m4	Sun Jan 20 17:10:07 2008
@@ -1098,20 +1098,14 @@ AC_REQUIRE([AC_PROG_CC])
 AC_DEFUN([FP_FIND_ROOT],[
 AC_MSG_CHECKING(for path to top of build tree)
 
-dnl This would be
-dnl     make -C utils/pwd clean && make -C utils/pwd
-dnl except we don't want to have to know what make is called. Sigh.
-if test ! -f utils/pwd/pwd && test ! -f utils/pwd/pwd.exe; then
-  cd utils/pwd
-  rm -f *.o
-  rm -f *.hi
-  rm -f pwd
-  rm -f pwd.exe
-  $WithGhc -v0 --make pwd -o pwd
-  cd ../..
-fi
-
-hardtop=`utils/pwd/pwd forwardslash`
+case $HostPlatform in
+*cygwin32|*mingw32)
+	hardtop=`pwd | tr \\ /`
+	;;
+*)
+	hardtop=`pwd`
+	;;
+esac
 
 if ! test -d "$hardtop"; then
   AC_MSG_ERROR([cannot determine current directory])


ifBuildable.hs is similar; it can be replaced by a shell script or even
done within libraries/Makefile using very basic shell commands.

> The only solution that I see is to replace the Haskell scripts by  
> vanilla shell scripts in HC bundles.  Even if that causes problems on  
> windows (without cygwin), it would make HC bundles viable on Unix  
> systems again.

How is ghc currently built on windows without something like cygwin?
>From the source distribution, the only way to build ghc seems to
be via configure and (GNU) make. So there must be some shell
environment available.

Or am I missing something really crucial here?

Ciao,
	Kili


More information about the Glasgow-haskell-users mailing list