Skip to content

Home News Screenshots Wiki Themes Bugtracker Members Logos Search
  You are not logged in Link icon Log in Link icon Join
You are here: Home » PicoGUI Wiki » BuildingWithMinGW » wikipage_view

Log in
 
BuildingAndConfiguring »

BuildingWithMinGW

If for some diabolic reason you want to run PicoGUI in the Defenestrated OS from the Evil Empire, you will need to do some additional incantations.

Note: Technically you're building with both MinGW and Cygwin, since pgserver still depends on POSIX functions. Once pgserver's Windows OS module is fixed and the new build system is written, only MinGW and Python should be necessary.

  • The binary used in the screenshot and available for download was made from PicoGUI 0.45 sources, but with some patches to include/picogui/network.h and os/posix.c. Those patches have been committed to the Subversion repository, so you'll have to at least use a pgserver package from there.
  • First, you will need Cygwin - just run their setup proggie, it downloads everything you need. The build system depends on having a proper unixish environment, and since pgserver's win32 support is bit-rotten, so does it. When selecting packages, you need to make sure you have gcc-mingw, the mingw runtime, nasm, and the tools mentioned above - autoconf, automake, make.
  • The build system still brokenly assumes that /bin/sh is bash. If you don't care about your cygwin installation's purity, a quick mv /bin/bash /bin/sh will fix it.
  • After that, you need SDL - you can probably get away with fetching their mingw binaries and dev package, but this is untested, I recommend you build from source. You will find instructions in their FAQ. (I could repeat them here but this would make this page too big.)

    If you want you can install the DirectX and OpenGL headers/libs mentioned in the SDL FAQ, but you won't really need it since PicoGUI won't use them (building the SDLGL video driver isn't covered by this page, as I couldn't get it to compile).

  • Now unpack the PicoGUI source and enter the pgserver directory.
    • Copy /usr/local/lib/SDL.dll to the pgserver source directory. This is a quirk of mingw/cygwin; when you finish you will need SDL.dll either in your DLL path or in the same dir as pgserver.exe.
    • Run ./autogen.sh even if you don't seem to need it. The configure script shipped with the tarball doesn't like the shipped install-sh for some reason. You will see some errors but you can ignore them.
    • Now run libtoolize. It will ask about overwriting some files; this is ok.
    • Run configure. Check carefully if the SDL test failed. If it did, either your SDL install is borked, or you forgot to copy SDL.dll (a symlink is not ok), or you don't have mingw.
    • Sorry, no menuconfig. Run make config by hand. Do not answer Windows on the very first question - we will pretend we're a posix system for the time being. Also, do not enable problematic stuff; the only video and input drivers you want are SDL (except of course that you may enable the screenshot and null drivers if you wish). Make sure the "Trace location of fatal signals" debugging option is disabled, as it is Linux-only.
    • Re-run configure so that it updates the makefiles for your configuration.
    • Hand-edit the Makefile and comment out the line that re-runs configure (search for recheck). For some reason this line goes in an infinite loop. Commenting it out means you'll have to remember to re-run configure if you make any changes to the configuration (by re-running make config or editing profile.user).
    • run make.
    • The link will fail: copy and paste the command line it tried to use to link pgserver.exe, and tack "SDL.dll" onto the end. It should link successfully now.
    • Tada, you should have a pgserver binary. You should be able to use the Python client library. Compiling the C client lib isn't covered here.