On the way to building Qemu 1.0…

Well one of the fun things is that Qemu now relies on glib.  But in order to build glib it needs pkg-config. And of course you can believe that pkg-config requires glib in order for it to work.  Good lord, nothing like circular dependencies!!!

So what to do?  First things first libffi will be needed to build glib.  It doesn’t seem to have any crazed dependancies so that built ok.  Also something I’ve been missing in a lot of ‘native’ MinGW builds is to add:

–prefix=/mingw

to the configure strings to get things in a location where the system will find them.  For some reason MinGW doesn’t walk /usr/local .. I guess because its not UNIX. With libffi built then you can configure/build glib like this:

export LIBFFI_CFLAGS='-I /mingw/lib/libffi-3.0.10/include'
export LIBFFI_LIBS=-lffi
export lt_cv_deplibs_check_method="pass_all"
export CFLAGS='-O0 -g -pipe -Wall -march=i486 -mms-bitfields -mthreads'
export CPPFLAGS='-DG_ATOMIC_OP_USE_GCC_BUILTINS=1'
export LDFLAGS=”-Wl,--enable-auto-image-base”
./configure --prefix=/mingw --with-pcre=internal --disable-static --disable-gtk-doc --enable-silent-rules

Then it is a simple matter of building out pkg-config then rebuilding glib in a ‘sane’ fashion.  This all comes form the MinGW wiki which has great information on how to do things like bootstrap glib!

And don’t forget to install python! Even Qemu needs it now!

And add it to /etc/profile so it will be in your path…

  export PATH=”.:/usr/local/bin:/mingw/bin:/bin:/c/python27:/c/python27/dlls:$PATH”

6 thoughts on “On the way to building Qemu 1.0…

    • From the path/name it looks like the rpms are supposed to be for windows. But:

      $ rpm -ivh –nodeps –force mingw32-glib2-2.30.2-1.3.noarch.rpm
      warning: mingw32-glib2-2.30.2-1.3.noarch.rpm: V3 DSA signature: NOKEY, key ID 961a365c
      Preparing… ########################################### [100%]
      package mingw32-glib2-2.30.2-1.3 is intended for a linux operating system
      $ uname -rs
      CYGWIN_NT-5.1 1.7.9(0.237/5/3)

  1. Have you tried building qemu under cygwin? It used to be very easy just a half year ago, so I never bothered to build it as a pure windows application. Today I spent two hours trying different configure options and build chains, with no luck.

    • I got one of the RC’s to build but managed to trash my build system while building cross compilers…. I guess I just need to face up to the fact I’ve fucked it up, rm -rf the whole thing and try again……

      Unfortunatly as of late, my interests have started to drift to old SEGA games…. if I were a productive person I’d see about incorporating it into something some how, but as far as I can tell Qemu is only geared to single processor family emulation, a system comprised of two SH2’s two m68k’s and a z80 is…. out of the question.

Leave a Reply to atar Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.