public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-pkg-config
@ 2009-11-23  3:33 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-11-23  3:33 UTC (permalink / raw
  To: gentoo-commits

vapier      09/11/23 03:33:03

  Modified:             cross-pkg-config
  Log:
  cross-pkg-config: unify uClinux-dist and Gentoo
  
  Touchup comments and unify variable handling so it can be used
  transparently in both Gentoo and the uClinux distribution.

Revision  Changes    Path
1.2                  crossdev-wrappers/cross-pkg-config

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?r1=1.1&r2=1.2

Index: cross-pkg-config
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cross-pkg-config	26 Feb 2009 23:19:51 -0000	1.1
+++ cross-pkg-config	23 Nov 2009 03:33:03 -0000	1.2
@@ -1,15 +1,17 @@
 #!/bin/sh
 # Copyright 2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.1 2009/02/26 23:19:51 solar Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.2 2009/11/23 03:33:03 vapier Exp $
 
-# -solar
-# Also uses vapier's code from uclinux-dist 
-
-if [[ "x$ROOT" == "x" ]]; then
-	exit 1
-fi
+#
+# This creates a pkg-config frontend that has the form TARGET-pkg-config
+# as this is the utility that autoconf scripts will automatically search
+# for when cross-compiling for TARGET.  Here we setup the pkg config env
+# paths so that the .pc files that are searched and used come from the
+# staging directory rather than the host system.
+#
 
+#
 # Helper functions.  So very helpful.
 #
 msg_to_stderr() { echo "cross-pkg-config: $*" 1>&2 ; }
@@ -19,11 +21,38 @@
 	exit 1
 }
 
+#
+# Sanity/distro checks
+#
+unset EXTRA_PKG_CONFIG_LIBDIR
+if [ -n "${ROOT}" ] ; then
+	# Gentoo
+	SYSROOT=${ROOT}
+elif [ -n "${STAGEDIR}" ] ; then
+	# uClinux-dist
+	SYSROOT=${STAGEDIR}
+	EXTRA_PKG_CONFIG_LIBDIR=${UCLINUX_PKG_CONFIG_LIBDIR}
+else
+	error "Need \$ROOT or \$STAGEDIR set first"
+fi
+# abort infinite loop due to misconfiguration
+[ "${0##*/}" = "pkg-config" ] && error "aborting infinite loop! (make sure to delete uClinux-dist/tools/pkg-config)"
+
+#
+# Some distributions pollute the pkg-config environment.
+# Time to pull a captain planet on them.
+#
+unset PKG_CONFIG_PATH
+unset PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
+unset PKG_CONFIG_ALLOW_SYSTEM_LIBS
 
-SYSROOT="$ROOT"
+#
+# Set the pkg-config search paths to our staging directory.
+#
 export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig"
-unset PKG_CONFIG_PATH PKG_CONFIG_ALLOW_SYSTEM_CFLAGS PKG_CONFIG_ALLOW_SYSTEM_LIBS
-#export PKG_CONFIG_DEBUG_SPEW="yes" #enable for debug
+if [ -n "${EXTRA_PKG_CONFIG_LIBDIR}" ] ; then
+	EXTRA_CONFIG_LIBDIR="${EXTRA_PKG_CONFIG_LIBDIR}:${PKG_CONFIG_LIBDIR}"
+fi
 
 #
 # Sanity check the output to catch common errors that do not
@@ -37,12 +66,14 @@
 	*" -L/usr/lib64 "*|*" -L/usr/local/lib64 "*|\
 	*" -L /usr/lib64 "*|*" -L /usr/local/lib64 "*)
 		warn "### falling down so here is a dump state ######"
+		export PKG_CONFIG_DEBUG_SPEW="yes"
 		pkg-config --debug "$@" 1>&2
 		warn "### end of dump ###############################"
 		error "host -L paths detected: ${output}"
 		;;
 	*" -I/usr/include"*|*" -I/usr/local/include"*)
 		warn "### falling down so here is a dump state ######"
+		export PKG_CONFIG_DEBUG_SPEW="yes"
 		pkg-config --debug "$@" 1>&2
 		warn "### end of dump ###############################"
 		error "host -I paths detected: ${output}"






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-pkg-config
@ 2009-11-23  3:33 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-11-23  3:33 UTC (permalink / raw
  To: gentoo-commits

vapier      09/11/23 03:33:50

  Modified:             cross-pkg-config
  Log:
  cross-pkg-config: add pkg-config sanity checks

Revision  Changes    Path
1.3                  crossdev-wrappers/cross-pkg-config

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?r1=1.2&r2=1.3

Index: cross-pkg-config
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cross-pkg-config	23 Nov 2009 03:33:03 -0000	1.2
+++ cross-pkg-config	23 Nov 2009 03:33:50 -0000	1.3
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright 2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.2 2009/11/23 03:33:03 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.3 2009/11/23 03:33:50 vapier Exp $
 
 #
 # This creates a pkg-config frontend that has the form TARGET-pkg-config
@@ -24,6 +24,14 @@
 #
 # Sanity/distro checks
 #
+if ver=$(pkg-config --version) ; then
+	if [ ${ver#0.1} != ${ver} ] ; then
+		error pkg-config is too old ... upgrade it
+	fi
+else
+	error unable to find pkg-config in PATH
+fi
+
 unset EXTRA_PKG_CONFIG_LIBDIR
 if [ -n "${ROOT}" ] ; then
 	# Gentoo






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-pkg-config
@ 2009-11-23  3:34 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-11-23  3:34 UTC (permalink / raw
  To: gentoo-commits

vapier      09/11/23 03:34:26

  Modified:             cross-pkg-config
  Log:
  cross-pkg-config: deduce /usr/$CHOST generically from $0

Revision  Changes    Path
1.4                  crossdev-wrappers/cross-pkg-config

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?r1=1.3&r2=1.4

Index: cross-pkg-config
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cross-pkg-config	23 Nov 2009 03:33:50 -0000	1.3
+++ cross-pkg-config	23 Nov 2009 03:34:26 -0000	1.4
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright 2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.3 2009/11/23 03:33:50 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.4 2009/11/23 03:34:26 vapier Exp $
 
 #
 # This creates a pkg-config frontend that has the form TARGET-pkg-config
@@ -41,7 +41,13 @@
 	SYSROOT=${STAGEDIR}
 	EXTRA_PKG_CONFIG_LIBDIR=${UCLINUX_PKG_CONFIG_LIBDIR}
 else
-	error "Need \$ROOT or \$STAGEDIR set first"
+	# /usr/<target>
+	CHOST=${0##*/}
+	CHOST=${CHOST%-pkg-config}
+	SYSROOT="/usr/${CHOST}"
+	if [ -z "${CHOST}" ] || [ ! -d "${SYSROOT}" ] ; then
+		error "Need \$ROOT or \$STAGEDIR set first"
+	fi
 fi
 # abort infinite loop due to misconfiguration
 [ "${0##*/}" = "pkg-config" ] && error "aborting infinite loop! (make sure to delete uClinux-dist/tools/pkg-config)"






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-pkg-config
@ 2009-11-23  3:34 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-11-23  3:34 UTC (permalink / raw
  To: gentoo-commits

vapier      09/11/23 03:34:56

  Modified:             cross-pkg-config
  Log:
  cross-pkg-config: add --cross-pkg-config-install option
  
  This lets people copy the wrapper someplace and then nail down the dirs it
  works with.

Revision  Changes    Path
1.5                  crossdev-wrappers/cross-pkg-config

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?r1=1.4&r2=1.5

Index: cross-pkg-config
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- cross-pkg-config	23 Nov 2009 03:34:26 -0000	1.4
+++ cross-pkg-config	23 Nov 2009 03:34:56 -0000	1.5
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright 2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.4 2009/11/23 03:34:26 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v 1.5 2009/11/23 03:34:56 vapier Exp $
 
 #
 # This creates a pkg-config frontend that has the form TARGET-pkg-config
@@ -32,8 +32,24 @@
 	error unable to find pkg-config in PATH
 fi
 
+if [ "$1" = "--cross-pkg-config-install" ] ; then
+	# --cross-pkg-config-install <sysroot dir> [pkg-config wrapper]
+	pkg_path="$2"
+	pkg_config="${3:-$0}"
+	sed -i.tmp \
+		-e "s:@CROSS_PKG_CONFIG_INSTALLED@:installed:" \
+		-e "s:@CROSS_PKG_CONFIG_PATH@:$pkg_path:" \
+		"$pkg_config"
+	rm -f "$pkg_config".tmp
+	chmod a+rx "$pkg_config"
+	exit 0
+fi
+
 unset EXTRA_PKG_CONFIG_LIBDIR
-if [ -n "${ROOT}" ] ; then
+if [ "@CROSS_PKG_CONFIG_INSTALLED@" = "installed" ] ; then
+	# Manual install
+	SYSROOT="@CROSS_PKG_CONFIG_PATH@"
+elif [ -n "${ROOT}" ] ; then
 	# Gentoo
 	SYSROOT=${ROOT}
 elif [ -n "${STAGEDIR}" ] ; then






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-pkg-config
@ 2010-01-08  7:12 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2010-01-08  7:12 UTC (permalink / raw
  To: gentoo-commits

vapier      10/01/08 07:12:15

  Modified:             cross-pkg-config
  Log:
  cross-pkg-config: fix typo in EXTRA_PKG_CONFIG_LIBDIR handling

Revision  Changes    Path
1.7                  crossdev-wrappers/cross-pkg-config

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?r1=1.6&r2=1.7

Index: cross-pkg-config
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- cross-pkg-config	10 Dec 2009 00:35:44 -0000	1.6
+++ cross-pkg-config	8 Jan 2010 07:12:14 -0000	1.7
@@ -80,7 +80,7 @@
 #
 export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig"
 if [ -n "${EXTRA_PKG_CONFIG_LIBDIR}" ] ; then
-	EXTRA_CONFIG_LIBDIR="${EXTRA_PKG_CONFIG_LIBDIR}:${PKG_CONFIG_LIBDIR}"
+	PKG_CONFIG_LIBDIR="${EXTRA_PKG_CONFIG_LIBDIR}:${PKG_CONFIG_LIBDIR}"
 fi
 
 #






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-pkg-config
@ 2010-01-08  7:16 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2010-01-08  7:16 UTC (permalink / raw
  To: gentoo-commits

vapier      10/01/08 07:16:35

  Modified:             cross-pkg-config
  Log:
  cross-pkg-config: switch version checking to --atleast-pkgconfig-version

Revision  Changes    Path
1.8                  crossdev-wrappers/cross-pkg-config

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.8&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?rev=1.8&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-pkg-config?r1=1.7&r2=1.8

Index: cross-pkg-config
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-pkg-config,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cross-pkg-config	8 Jan 2010 07:12:14 -0000	1.7
+++ cross-pkg-config	8 Jan 2010 07:16:34 -0000	1.8
@@ -23,12 +23,9 @@
 #
 # Sanity/distro checks
 #
-if ver=$(pkg-config --version) ; then
-	if [ ${ver#0.1} != ${ver} ] ; then
-		error pkg-config is too old ... upgrade it
-	fi
-else
-	error unable to find pkg-config in PATH
+MIN_VER="0.20"
+if ! pkg-config --atleast-pkgconfig-version ${MIN_VER} ; then
+	error pkg-config is too old ... upgrade to at least v${MIN_VER}
 fi
 
 if [ "$1" = "--cross-pkg-config-install" ] ; then






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-08  7:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23  3:34 [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-pkg-config Mike Frysinger (vapier)
  -- strict thread matches above, loose matches on Subject: below --
2010-01-08  7:16 Mike Frysinger (vapier)
2010-01-08  7:12 Mike Frysinger (vapier)
2009-11-23  3:34 Mike Frysinger (vapier)
2009-11-23  3:33 Mike Frysinger (vapier)
2009-11-23  3:33 Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox