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-args <perl-dir> <mingw-top> <mingw-gcc-lib>
16 # Directory where a (cygwin-free) perl binary resides.
19 # Top of the MinGW32 compiler directory
22 # The gcc-lib directory of the mingw tree you want to
23 # include with the binary dist.
24 export gcc_lib=$mingw_top/$3
27 # The mingw include, lib, and bin directories.
29 export mingw_include=$mingw_top/include
30 export mingw_lib=$mingw_top/lib
31 export mingw_bin=$mingw_top/bin
34 if [ ! -d bin/i386-unknown-mingw32 ] ; then
35 echo "Doesn't look as if I'm in the toplevel directory of a mingw tree"
36 echo "Usage: cd ghc-<version> ; ../distrib/prep-bin-dist-mingw"
40 echo "Removing configure script files...not needed"
41 rm -f config.guess config.sub configure configure.ac mkdirhier
42 rm -f Makefile-bin.in Makefile.in aclocal.m4 install-sh
46 mv bin/i386-unknown-mingw32/* bin/
47 rmdir bin/i386-unknown-mingw32
51 mv lib/i386-unknown-mingw32/* .
52 rmdir lib/i386-unknown-mingw32
54 # mv ghc-asm.prl ghc-asm
55 # mv ghc-split.prl ghc-split
57 echo "create gcc-lib/"
59 # A bunch of stuff gets lumped into gcc-lib:
61 # - the gcc-lib/ + gcc-lib/include of the gcc you
62 # intend to ship (normally located as
63 # lib/gcc-lib/mingw/<gcc version>/ in your mingw tree.)
64 # - the contents of mingw/lib/
65 # - ld.exe, as.exe, dlltool.exe, dllwrap.exe from mingw/bin
68 cp $gcc_lib/* gcc-lib/
69 cp $gcc_lib/include/ gcc-lib/
70 cp $mingw_lib/* gcc-lib/
71 cp $mingw_bin/as.exe gcc-lib/
72 cp $mingw_bin/ld.exe gcc-lib/
73 # Note: later versions of dlltool.exe depend on a bfd helper DLL.
74 cp $mingw_bin/dllwrap.exe gcc-lib/
75 cp $mingw_bin/dlltool.exe gcc-lib/
78 echo "extra header files inside of include/"
80 # contains mingw/include
82 cp -Rf $mingw_include/* include/mingw
85 # g++-3/ subdir causes problems with installer tool (+ being a
86 # troublesome character); leave out for now.
87 # rm -rf include/mingw/g++-3/ || echo "g++-3/ not there"
88 rm -rf include/mingw/c++ || echo "c++/ not there"
91 cp ${mingw_bin}/gcc.exe .
93 echo "copy in perl too"
94 cp ${perl_dir}/perl.exe .
95 cp ${perl_dir}/perl56.dll .
97 # For reasons unknown, duplicate copies of misc package files in share/
98 # (leave them be for now.)
100 echo "formatting documentation"
103 cp ../ghc/docs/users_guide/users_guide.pdf doc/ || echo "No User Guide PDF doc found"
104 cp ../hslibs/doc/hslibs.pdf doc/ || echo "No HSLIBS PDF doc found"