From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkvff-0005hr-IX for qemu-devel@nongnu.org; Sun, 24 Jul 2011 06:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qkvfe-00063b-F6 for qemu-devel@nongnu.org; Sun, 24 Jul 2011 06:12:27 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:55767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkvfe-00063U-41 for qemu-devel@nongnu.org; Sun, 24 Jul 2011 06:12:26 -0400 Message-ID: <4E2BEFFF.5050000@web.de> Date: Sun, 24 Jul 2011 12:12:15 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH] mingw32: Only link against libiberty if required List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel From: Jan Kiszka Not all (didn't find any) mingw32 cross-toolchains ship a binutils-devel package, thus lack libiberty.a. According to 08f3896a, -liberty is only needed for getopt when building for 64 bit. Test for the availability of a getopt implementation and only pull in libiberty when linking without it failed. Signed-off-by: Jan Kiszka --- configure | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 6911c3b..42effb9 100755 --- a/configure +++ b/configure @@ -481,7 +481,16 @@ if test "$mingw32" = "yes" ; then QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" - LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS" + # check need for -liberty (getopt on w64) + cat > $TMPC << EOF +#include +int main(void) { return getopt(0, NULL, NULL); } +EOF + if compile_prog "" "" ; then + LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" + else + LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS" + fi prefix="c:/Program Files/Qemu" mandir="\${prefix}" datadir="\${prefix}" -- 1.7.3.4