Author Topic: HOWTO: MUTE compilieren  (Read 5047 times)

0 Members and 1 Guest are viewing this topic.

Offline Markus

  • Administrator
  • Elite
  • *****
  • Posts: 5740
  • Karma: +25/-8
    • View Profile
    • http://www.planetpeer.de
HOWTO: MUTE compilieren
« on: June 25, 2004, 07:34:55 PM »
Die folgende Anleitung habe ich im Mutehash-Board entdeckt und fand sie einfach zu interessant, um sie dort unbeachtet vergammeln zu lassen ;-)

Ich bin sicher, dass es ausser mir auch noch andere versucht haben, aber erstmal kläglich gescheitert sind. Was hat es für Vorteile, MUTE selber zu compilieren? Ganz einfach: Man kann sich stets mit der aktuellsten CVS-Version versorgen und hat somit immer einen brandaktuellen Build.

So, genug geredet, hier nun die Anleitung:

Quote

Many people have asked for help in figuring out how to recompile MUTE on their Windows system. Several have innocently asked for VC++ project files, etc. but it ain't gonna happen. MUTE was written to be portable and platform-independent, so it uses the gcc compiler and a portable GUI system named wxWindows. Rebuilding is done with a bunch of scripts and interlocking Makefiles, and requires a pile of *NIX tools for managing libraries and stuff. Forget it.

    Instead of using VC++, you'll need to install some pseudo-*NIX tools on your Windows box, and recompile it in a fake *NIX command window. After several hours of teeth-gnashing I've finally got it working on my XP system, and have pared the steps required down to this bare minimum quick & dirty Windows guide. I'm assuming that like 99.9% of the Windows programming community, you don't have any of this stuff yet and don't know much about it. If you've already got some of this going, you'll hopefully be able to figure out how to adapt the following for your needs. Here goes:

    1. Download MSYS-1.0.9.exe and MinGW-3.1.0-1.exe from http://www.mingw.org/download.shtml

    2. Install MSYS by running MSYS-1.0.9.exe and accepting the defaults (it will be installed in C:\msys\1.0)

    3. The installer automatically runs a shell script in a DOS window. Answer:
    Do you wish to continue with the post install? y
    Do you have MinGW installed? n
    ENTER
    ENTER
    ENTER

    4. Install MinGW by running MinGW-3.1.0-1.exe and accepting the defaults (it will be installed in C:\MinGW)


    5. Go to C:\msys\1.0\etc and rename "fstab.sample" to "fstab". If you didn't install MinGW in C:\MinGW you'll need to edit fstab to change the default path.

    6. Download wxMSW-2.4.2-setup.zip from http://www.wxwindows.org/dl_msw2.htm and unzip it into a temp directory.

    7. Install WxWindows by running setup.exe in the temp directory. I changed the default install dir to put it into c:\wxWin.

    8. Download extra.zip from ftp://biolpc22.york.ac.uk/pub/ports/mingw32/extra.zip and unzip it into a temp directory.

    9. Copy the files bison.exe, bison.hairy, bison.simple, and flex.exe into C:\msys\1.0\bin. I know, I know, but I didn't feel like figuring out how to change the default search path setting to find them somewhere else.

    10. Go to the Windows Control Panel and run the System panel. Go to the Advanced tab and click on Environment Variables at the bottom. Add three new environment variables: BISON_SIMPLE=C:\msys\1.0\bin\bison.simple, BISON_HAIRY=C:\msys\1.0\bin\bison.hairy, and WXWIN=C:\wxWin.

    11. Open an MSYS shell window by clicking on the new desktop icon or the menu option under MinGW.

    12. Enter these commands to build the wxWindows binaries:
    cd $WXWIN
    mkdir build-release
    cd build-release
    ../configure --with-msw --enable-optimise (takes a little while)
    make (takes a big while)
    make install
    make clean

    13. Copy the files libwx_msw-2.4.dll and wxmsw242.dll from C:\msys\1.0\local\lib to C:\msys\1.0\bin. Again, I know it's sloppy, but I tried setting an LD_PATH variable and couldn't get it to work, so screw it. This works.

    14. Now for a little test to see if everything's installed OK so far. Enter the following commands in the MSYS window:
    cd samples/minimal
    make
    ./minimal.exe
    This compiles and runs a little "Welcome to wxWindows!" demo program. If it doesn't compile or run cleanly, you're SOL. Good luck figuring it out, 'cause I don't have a clue and debugging someone else's setup via email is futile. But there's really no point in going any further until you can get it working somehow.

    15. Copy everything in C:\msys\1.0\local\include\wx to C:\msys\1.0\local\lib\wx\include\msw-2.4\wx, including all the subdirectories. I don't know why I had to do this, but apparently the MUTE makefile ends up looking for the wxWindows headers in a different place than they were actually installed to up above. Again, this is bad and sloppy and all, but there's no way I'm going to mess with the MUTE makefile system to try and "fix" it. I want the official MUTE sources to build as-is, untouched, and this was the easiest way to make it work.

    16. Now you're (finally) ready to start playing with the MUTE sources. Go to http://mute-net.sourceforge.net/ and download the UNIX source. This will give you a file like MUTE_fileSharing-0.2.2_UnixSource.tar.gz; save or copy it into the C:\msys\1.0\home\YourUserName directory.

    17. Enter the following commands into the MSYS window:
    cd ~
    gunzip MUTE_fileSharing-0.2.2_UnixSource.tar.gz
    tar -xf MUTE_fileSharing-0.2.2_UnixSource.tar
    cd MUTE_fileSharing-0.2.2_UnixSource
    cd MUTE
    sh configure (I thought "./configure" should work, but it doesn't, so...)

    18. The MUTE configure script will run and ask a couple of questions:
    select platform> 6 (Windows with MinGW)
    Enter full path to wx-config script> /usr/local/bin/wx-config

    19. Now the moment of truth: your first MUTE build. Enter these MSYS commands:
    cd ..
    sh runToBuild
    Answer 1 to build the GUI version, and watch it go. The first time you run this, it will build all the minorGems utility libraries; these will show quite a few (minor) warnings, but there shouldn't be any failures. It will then build the app, and finish with a couple of final warnings about missing directories. We're apparently not set up correctly for it to automatically build the distribution release files. And the resulting program file doesn't seem to have an icon. But who cares; the app built! Yay! And there was much rejoicing. If not, see #14 above.

    20. You should find your freshly-built app in the daintily-titled C:\msys\1.0\home\YourUserName\MUTE_fileSharing-0.2.2-rc2_UnixSource\MUTE\otherApps\fileSharing\userInterface\wxWindows directory, right where you'd first think to look for it. You can either copy it to your normal MUTE execution directory for testing, or copy your normal execution directory's contents to this one (including the .dll files and subdirectories) to let it run from here. I generally leave my MSYS window set to the ~/MUTE_fileSharing-0.2.2-rc2_UnixSource directory and just use it to do "sh runToBuild" commands. I leave a normal Windows directory window set to where the app gets built, and run it from there.

    Anyway, I hope this gets some people going. I'm off to do some mods.


Cheers,
Markus