From patchwork Sun Sep 11 18:25:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 114242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AACCCB7266 for ; Mon, 12 Sep 2011 04:26:37 +1000 (EST) Received: from localhost ([::1]:40947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2oji-0004Ti-Sr for incoming@patchwork.ozlabs.org; Sun, 11 Sep 2011 14:26:34 -0400 Received: from eggs.gnu.org ([140.186.70.92]:55344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2ojc-0004Tc-V6 for qemu-devel@nongnu.org; Sun, 11 Sep 2011 14:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R2ojb-0002gJ-S0 for qemu-devel@nongnu.org; Sun, 11 Sep 2011 14:26:28 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:33231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2ojb-0002g9-My for qemu-devel@nongnu.org; Sun, 11 Sep 2011 14:26:27 -0400 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id 57CE87282F90; Sun, 11 Sep 2011 20:26:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TLJYqXZyYtzn; Sun, 11 Sep 2011 20:26:24 +0200 (CEST) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id E356F7282F91; Sun, 11 Sep 2011 20:26:24 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Date: Sun, 11 Sep 2011 20:25:53 +0200 Message-Id: <1315765553-7086-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 78.47.199.172 Cc: peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH v2] pkg-config: Add a pkg-config script for cross compilations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This script can be used for cross compilations. I use it on Debian / Ubuntu to provide a cross pkg-config for MinGW (32 and 64 bit), ARM, MIPS and PowerPC. v2: Improvements as suggested by Peter Maydell. Thanks for the review. Signed-off-by: Stefan Weil --- scripts/cross-pkg-config | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) create mode 100755 scripts/cross-pkg-config diff --git a/scripts/cross-pkg-config b/scripts/cross-pkg-config new file mode 100755 index 0000000..8d7fe17 --- /dev/null +++ b/scripts/cross-pkg-config @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# pkg-config for cross compilations + +# Copyright (C) 2011 Stefan Weil + +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the file COPYING in the top-level directory. + +# This script provides a cross pkg-config for QEMU cross compilations. +# It will use the standard pkg-config with special options for the +# cross environment which is assumed to be in /usr/{cross-prefix}. + +# Installation (Debian and similar distributions): +# Simply copy or link it to /usr/bin/{cross-prefix}-pkg-config. + +# Examples (Debian, Ubuntu): +# /usr/bin/amd64-mingw32msvc-pkg-config +# /usr/bin/i586-mingw32msvc-pkg-config +# /usr/bin/arm-linux-gnueabi-pkg-config +# /usr/bin/mipsel-linux-gnu-pkg-config + +basename=`basename "$0"` +prefix="/usr/${basename%-pkg-config}" +export PKG_CONFIG_LIBDIR="$prefix/lib/pkgconfig" +exec pkg-config --define-variable=prefix="$prefix" "$@" + +# end