From: "Daniel P. Berrange" <berrange@redhat.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Fix SDL configuration for mingw32 cross compilation.
Date: Wed, 17 Jun 2009 11:27:54 +0100 [thread overview]
Message-ID: <20090617102754.GB31299@redhat.com> (raw)
In-Reply-To: <20090616181456.GE11893@shareable.org>
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 :|
prev parent reply other threads:[~2009-06-17 10:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-13 8:01 [Qemu-devel] [PATCH] Fix SDL configuration for mingw32 cross compilation Stefan Weil
2009-06-13 22:24 ` Anthony Liguori
2009-06-14 14:00 ` Stefan Weil
2009-06-15 2:20 ` Anthony Liguori
2009-06-16 15:28 ` Jamie Lokier
2009-06-16 16:31 ` Stefan Weil
2009-06-16 18:14 ` Jamie Lokier
2009-06-17 10:27 ` Daniel P. Berrange [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090617102754.GB31299@redhat.com \
--to=berrange@redhat.com \
--cc=jamie@shareable.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.