From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGsNC-0003eA-4Y for qemu-devel@nongnu.org; Wed, 17 Jun 2009 06:28:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGsN7-0003ax-SE for qemu-devel@nongnu.org; Wed, 17 Jun 2009 06:28:05 -0400 Received: from [199.232.76.173] (port=48415 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGsN7-0003as-L6 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 06:28:01 -0400 Received: from mx1.redhat.com ([66.187.233.31]:50373) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGsN7-0006lt-4D for qemu-devel@nongnu.org; Wed, 17 Jun 2009 06:28:01 -0400 Date: Wed, 17 Jun 2009 11:27:54 +0100 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [PATCH] Fix SDL configuration for mingw32 cross compilation. Message-ID: <20090617102754.GB31299@redhat.com> References: <1244880087-5277-1-git-send-email-weil@mail.berlios.de> <4A34271B.8080207@us.ibm.com> <4A350288.5090804@mail.berlios.de> <4A35AFD2.5060909@us.ibm.com> <20090616152830.GJ29040@shareable.org> <4A37C8F9.5050906@mail.berlios.de> <20090616181456.GE11893@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090616181456.GE11893@shareable.org> Reply-To: "Daniel P. Berrange" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: QEMU Developers 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 :|