1#!/bin/sh
2cat <<EOF
3****************************************************************
4Configuring FC15 for cross-compiling multi-threaded 32-bit and
5		 64-bit Windows programs with mingw.
6****************************************************************
7
8This script will configure a fresh Fedora system to compile with
9mingw32 and 64.  It requires:
10
111. Fedora installed and running. Typically you will do this by:
12
13   1a - download the ISO for the 64-bit DVD (not the live media) from:
14        http://fedoraproject.org/en/get-fedora-options#formats
15   1b - Create a new VM using this ISO as the boot. The ISO will
16        install off of its packages on your machine.
17   1c - Run Applications/Other/Users and Groups from the Applications menu.
18   1d - Type user user password.
19   1e - Click your username / Properties / Groups.
20   1f - Add yourself to the wheel group.
21   1g - Type your password again.
22   1h - Close the user manager
23   
24   1i - Start up Terminal; Chose Terminal's 
25        Edit/Profile Preferences/Scrolling and check 'Unlimited' scrollback. 
26   1j - Chose Applications/System Tools/System Settings/Screen.
27        Select brightness 1 hour and Uncheck lock.
28       
29   NOTE: The first time you log in, the system will block the yum 
30   system as it downloads updates. This is annoying.
31
322. This script. Put it in your home directory.
33
343. Root access. This script must be run as root. You can do that 
35   by typing:
36          sudo bash CONFIGURE_FC.sh
37
38press any key to continue...
39EOF
40read
41
42if [ $USER != "root" ]; then
43  echo ERROR: You must run this script as root.
44  exit 1
45fi
46
47if grep 'Fedora.release.' /etc/redhat-release ; then
48  echo Fedora Release detected
49else
50  echo This script is only tested for Fedora Release 18 and should work on F18 or newer.
51  exit 1
52fi
53
54echo Attempting to install both DLL and static version of all mingw libraries
55echo At this point we will keep going even if there is an error...
56INST="autoconf automake gcc gc-c++ "
57for M in mingw32 mingw64 ; do
58  # For these install both DLL and static
59  for lib in zlib gettext boost cairo pixman freetype fontconfig \
60      bzip2 expat pthreads libgnurx libxml2 iconv openssl ; do
61    INST+=" ${M}-${lib} ${M}-${lib}-static"
62  done
63done
64sudo yum -y install $INST
65
66echo
67echo Updating all yum packages. This may take a little while...
68yum -y update
69
70echo ================================================================
71echo ================================================================
72echo
73echo Installation complete!
74echo You should now be able to cross compile the programs.
75echo $ sh bootstrap.sh
76echo $ ./configure
77echo $ make world
78
79