qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix SDL configuration for mingw32 cross compila


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH] Fix SDL configuration for mingw32 cross compilation.
Date: Wed, 17 Jun 2009 11:27:54 +0100
User-agent: Mutt/1.4.1i

On Tue, Jun 16, 2009 at 07:14:56PM +0100, Jamie Lokier wrote:
> > >>>       
> > >> Yes, this annoys me too.  One thing I thought about is that we could 
> > >> record important environment variables for use when re-running make.
> > >> It's not just PATH.  PKG_CONFIG_PATH is also important for running 
> > >> configure.  To properly cross compile, you need to set both.
> > >>     
> > >
> > > You can record PATH and other environment variables picked up at
> > > configure time in the Makefile itself.  Makefile.in:
> > >
> > >    export PATH = @PATH@
> > >
> > > It's not pretty, but it works.
> > >
> > > -- Jamie
> > >
> > >   
> > 
> > Only with autoconf / automake? QEMU does not use them,
> > so there is no Makefile.in.
> > 
> > I'd prefer setting paths for pkg-config and sdl-config via
> > configure options (those are recorded in config-host.mak).
> 
> You can use it with anything which controls the variables like $(CC)
> in Makefiles.  Doesn't have to be Autoconf.
> 
> So you'd either put PATH=... and PKG_CONFIG_PATH=... in
> config-host.mak plus "export PATH PKG_CONFIG_PATH" in the Makefile, or
> you'd put "export PATH=..." and "export PKG_CONFIG_PATH=..." in
> config-host.mak and nothing in the Makefile.
> 
> The main thing is, after recording them, you might have to export PATH
> in Makefile or config-host.mak to have the required effect.  I guess
> PKG_CONFIG_PATH won't need exporting globally; only in commands which
> call pkg-config.

For cross-compiling you shouldn't actually use PKG_CONFIG_PATH. This just
adds extra search locations - so if you didn't have the cross-compiled
pkg config data file present, it'd fallback to giving you the native one
which is not what you want. Instead you should set PKG_CONFIG_LIBDIR to
point to the mingw tree so that you are guarenteed it'll never fallback
to native configs.  

FYI for people using Fedora mingw32  packages, there is a 'mingw32-env'
shell alias which sets this and many other vars:

  ADDR2LINE=/usr/bin/i686-pc-mingw32-addr2line
  AR=/usr/bin/i686-pc-mingw32-ar
  AS=/usr/bin/i686-pc-mingw32-as
  CC=i686-pc-mingw32-gcc
  CPP=/usr/bin/i686-pc-mingw32-cpp
  CXXFILT=/usr/bin/i686-pc-mingw32-c++filt
  DLLTOOL=/usr/bin/i686-pc-mingw32-dlltool
  DLLWRAP=/usr/bin/i686-pc-mingw32-dllwrap
  FREETYPE_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/freetype-config
  GCC=/usr/bin/i686-pc-mingw32-gcc
  GCCBUG=/usr/bin/i686-pc-mingw32-gccbug
  GCOV=/usr/bin/i686-pc-mingw32-gcov
  GPG_ERROR_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/gpg-error-config
  GPROF=/usr/bin/i686-pc-mingw32-gprof
  HOST_CC=gcc
  LD=/usr/bin/i686-pc-mingw32-ld
  LIBGCRYPT_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/libgcrypt-config
  LIBGNUTLS_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/libgnutls-config
  
LIBGNUTLS_EXTRA_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/libgnutls-extra-config
  LIBPNG12_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/libpng12-config
  LIBPNG_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/libpng-config
  NM=/usr/bin/i686-pc-mingw32-nm
  OBJCOPY=/usr/bin/i686-pc-mingw32-objcopy
  OBJDUMP=/usr/bin/i686-pc-mingw32-objdump
  PKG_CONFIG_LIBDIR=/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig
  RANLIB=/usr/bin/i686-pc-mingw32-ranlib
  READELF=/usr/bin/i686-pc-mingw32-readelf
  SIZE=/usr/bin/i686-pc-mingw32-size
  STRINGS=/usr/bin/i686-pc-mingw32-strings
  STRIP=/usr/bin/i686-pc-mingw32-strip
  WINDMC=/usr/bin/i686-pc-mingw32-windmc
  WINDRES=/usr/bin/i686-pc-mingw32-windres
  XML2_CONFIG=/usr/i686-pc-mingw32/sys-root/mingw/bin/xml2-config

Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]