qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] pkg-config: Add a pkg-config script for cross c


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] pkg-config: Add a pkg-config script for cross compilations
Date: Sun, 11 Sep 2011 18:31:15 +0100

On 11 September 2011 16:55, Stefan Weil <address@hidden> wrote:
> --- /dev/null
> +++ b/scripts/cross-pkg-config
> @@ -0,0 +1,22 @@
> +#!/bin/sh

Missing "-e"

> +
> +# 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}.

Missing copyright and license.

> +basename=`basename $0`

Insufficient quoting (gives wrong answer if the script is in a
path with a space in and is executed via $PATH or an absolute path).

> +prefix=/usr/`echo $basename|sed s/-pkg-config//`

You can do this with shell substring manipulation.

> +PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig

Missing quoting.

> +export PKG_CONFIG_LIBDIR

Posix allows export name=value so you can combine this with the above.

> +exec pkg-config --define-variable=prefix=$prefix $@

Missing quoting.

Try:
basename="$(basename "$0")"
prefix="/usr/${basename%-pkg-config}"
export PKG_CONFIG_LIBDIR="$prefix/lib/pkgconfig"
exec pkg-config --define-variable=prefix="$prefix" "$@"

-- PMM



reply via email to

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