3 # Running 'binary-dist' gives us a tree which
4 # isn't quite right for the purposes of creating
5 # a mingw/win32 install tree. This script rejigs
10 # foo$ cd <top of fptools build tree>
11 # foo$ make binary-dist Project=Ghc
12 # foo$ cd ghc-<version>
13 # foo$ ../distrib/prep-bin-dist-mingw
15 #export gcc_lib=c:/ghc/ghc-5.02.2/gcc-lib
17 export old_ghc_top=c:/lang/ghc-5.04.1
18 export mingw_top=c:/lang/MinGW32
20 #Directory where a (cygwin-free) perl binary resides.
21 # export perl_dir=c:/ghc/ghc-5.04
22 export perl_dir=$old_ghc_top
24 # The gcc-lib directory of the mingw tree you want to
25 # include with the binary dist.
26 # export gcc_lib=f:/mingw/lib/gcc-lib/mingw32/2.95.3-6/
27 export gcc_lib=$mingw_top/lib/gcc-lib/mingw32/2.95.3-8
30 # The mingw include, lib, and bin directories.
32 export mingw_include=$mingw_top/include
33 export mingw_lib=$mingw_top/lib
34 export mingw_bin=$mingw_top/bin
37 if ! [ -d bin/i386-unknown-mingw32 ] ; then
38 echo "Doesn't look as if I'm in the toplevel directory of a mingw tree"
39 echo "Usage: cd ghc-<version> ; ../distrib/prep-bin-dist-mingw"
43 echo "Removing configure script files...not needed"
44 rm -f config.guess config.sub configure configure.ac mkdirhier
45 rm -f Makefile-bin.in Makefile.in aclocal.m4 install-sh
49 mv bin/i386-unknown-mingw32/* bin/
50 rmdir bin/i386-unknown-mingw32
54 mv lib/i386-unknown-mingw32/* .
55 rmdir lib/i386-unknown-mingw32
57 mv ghc-asm.prl ghc-asm
58 mv ghc-split.prl ghc-split
60 echo "create gcc-lib/"
62 # A bunch of stuff gets lumped into gcc-lib:
64 # - the gcc-lib/ + gcc-lib/include of the gcc you
65 # intend to ship (normally located as
66 # lib/gcc-lib/mingw/<gcc version>/ in your mingw tree.)
67 # - the contents of mingw/lib/
68 # - ld.exe, as.exe, dlltool.exe, dllwrap.exe from mingw/bin
71 cp $gcc_lib/* gcc-lib/
72 cp $gcc_lib/include/* gcc-lib/
73 cp $mingw_lib/* gcc-lib/
74 cp $mingw_bin/as.exe gcc-lib/
75 cp $mingw_bin/ld.exe gcc-lib/
76 # Note: later versions of dlltool.exe depend on a bfd helper DLL.
77 cp $mingw_bin/dllwrap.exe gcc-lib/
78 cp $mingw_bin/dlltool.exe gcc-lib/
81 echo "extra header files inside of include/"
83 # contains mingw/include
85 cp -Rf $mingw_include/* include/mingw
87 # g++-3/ subdir causes problems with installer tool (+ being a
88 # troublesome character); leave out for now.
89 #rm -rf include/mingw/g++-3/ || echo "g++-3/ not there"
90 rm -rf include/mingw/c++ || echo "c++/ not there"
93 # cp ${mingw_bin}/gcc.exe .
94 cp ${mingw_bin}/gcc-2.exe gcc.exe
96 echo "copy in perl too"
97 cp ${perl_dir}/perl.exe .
98 cp ${perl_dir}/perl56.dll .
100 # For reasons unknown, duplicate copies of misc package files in share/
101 # (leave them be for now.)
103 echo "formatting documentation"
106 cp ../ghc/docs/users_guide/users_guide.pdf doc/ || echo "No User Guide PDF doc found"
107 cp ../hslibs/doc/hslibs.pdf doc/ || echo "No HSLIBS PDF doc found"