[oe-commits] Ulf Samuelsson : Add ac HOST_PKG_CONFIG to use host tools instead of target tools

git version control git at git.openembedded.org
Wed Aug 19 10:21:13 UTC 2009


Module: openembedded.git
Branch: ulf/linux-2.6.30.2
Commit: 90408d793bf87c1cffc3a18b55afe6274aaf4d7b
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=90408d793bf87c1cffc3a18b55afe6274aaf4d7b

Author: Ulf Samuelsson <ulf.samuelsson at atmel.com>
Date:   Wed Aug 19 07:51:32 2009 +0200

Add ac HOST_PKG_CONFIG to use host tools instead of target tools

---

 recipes/gcalctool/gcalctool_5.27.5.bb              |   21 ++++-
 .../gcalctool-5.27.5-host-pkg-config.patch         |  106 ++++++++++++++++++++
 .../gcalctool/gcalctool_5.27.5/makefile-fix.diff   |   18 ++++
 3 files changed, 142 insertions(+), 3 deletions(-)

diff --git a/recipes/gcalctool/gcalctool_5.27.5.bb b/recipes/gcalctool/gcalctool_5.27.5.bb
index e0b3d72..6fbdbb4 100644
--- a/recipes/gcalctool/gcalctool_5.27.5.bb
+++ b/recipes/gcalctool/gcalctool_5.27.5.bb
@@ -2,13 +2,28 @@ LICENSE = "GPL"
 SECTION = "x11"
 DEPENDS = "gtk+"
 DESCRIPTION = "gcalctool is a powerful calculator"
-PR = "r0"
-
-SRC_URI = "file://makefile-fix.diff;patch=1"
+PR = "r1"
 
 inherit gnome
 
+DEPENDS = "gnome-common gtk+ libgnomeui"
+
+SRC_URI += " \
+	file://gcalctool-5.27.5-host-pkg-config.patch;patch=1 \
+	"
+
+do_configure() {
+	sed -i 's:-I$(includedir)::g' src/Makefile.am
+	PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig \
+	HOST_PKG_CONFIG=/usr/bin/pkg-config \
+	oe_runconf
+}
+
 do_configure_prepend() {
 	sed -i 's:-I$(includedir)::g' src/Makefile.am
 }
 
+do_stage() {
+	autotools_stage_all
+}
+
diff --git a/recipes/gcalctool/gcalctool_5.27.5/gcalctool-5.27.5-host-pkg-config.patch b/recipes/gcalctool/gcalctool_5.27.5/gcalctool-5.27.5-host-pkg-config.patch
new file mode 100644
index 0000000..2bd1845
--- /dev/null
+++ b/recipes/gcalctool/gcalctool_5.27.5/gcalctool-5.27.5-host-pkg-config.patch
@@ -0,0 +1,106 @@
+diff -urN gcalctool-5.27.5-0rig/m4/gnome-doc-utils.m4 gcalctool-5.27.5/m4/gnome-doc-utils.m4
+--- gcalctool-5.27.5-0rig/m4/gnome-doc-utils.m4	2009-05-15 02:09:09.000000000 +0200
++++ gcalctool-5.27.5/m4/gnome-doc-utils.m4	2009-08-16 10:43:06.000000000 +0200
+@@ -40,7 +40,7 @@
+ 
+ ifelse([$1],,[gdu_cv_version_required=0.3.2],[gdu_cv_version_required=$1])
+ 
+-PKG_CHECK_EXISTS([gnome-doc-utils >= $gdu_cv_version_required],
++HOST_PKG_CHECK_EXISTS([gnome-doc-utils >= $gdu_cv_version_required],
+ 	[gdu_cv_have_gdu=yes],[gdu_cv_have_gdu=no])
+ 
+ if test "$gdu_cv_have_gdu" = "yes"; then
+diff -urN gcalctool-5.27.5-0rig/m4/host-pkg.m4 gcalctool-5.27.5/m4/host-pkg.m4
+--- gcalctool-5.27.5-0rig/m4/host-pkg.m4	1970-01-01 01:00:00.000000000 +0100
++++ gcalctool-5.27.5/m4/host-pkg.m4	2009-08-16 11:45:14.000000000 +0200
+@@ -0,0 +1,65 @@
++# pkg.m4 - Macros to locate and utilise host pkg-config.   -*- Autoconf -*-
++# 
++# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
++# Copyright © 2009 ULf Samuelsson <ulf.samuelsson at atmel.com>.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# HOST_PKG_PROG_PKG_CONFIG([MIN-VERSION])
++# ----------------------------------
++AC_DEFUN([HOST_PKG_PROG_PKG_CONFIG],
++[m4_pattern_forbid([^_?HOST_PKG_[A-Z_]+$])
++m4_pattern_allow([^HOST_PKG_CONFIG(_PATH)?$])
++AC_ARG_VAR([HOST_PKG_CONFIG], [path to host-pkg-config utility])dnl
++if test "x$ac_cv_env_HOST_PKG_CONFIG_set" != "xset"; then
++	AC_PATH_TOOL([HOST_PKG_CONFIG], [host-pkg-config])
++fi
++if test -n "$HOST_PKG_CONFIG"; then
++	_host_pkg_min_version=m4_default([$1], [0.9.0])
++	AC_MSG_CHECKING([host-pkg-config is at least version $_host_pkg_min_version])
++	if $HOST_PKG_CONFIG --atleast-pkgconfig-version $_host_pkg_min_version; then
++		AC_MSG_RESULT([yes])
++	else
++		AC_MSG_RESULT([no])
++		HOST_PKG_CONFIG=""
++	fi
++		
++fi[]dnl
++])# HOST_PKG_PROG_PKG_CONFIG
++
++# HOST_PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
++#
++# Check to see whether a particular set of modules exists.  Similar
++# to PKG_CHECK_MODULES(), but does not set variables or print errors.
++#
++#
++# Similar to PKG_CHECK_MODULES, make sure that the first instance of
++# this or PKG_CHECK_MODULES is called, or make sure to call
++# HOST_PKG_CHECK_EXISTS manually
++# --------------------------------------------------------------
++AC_DEFUN([HOST_PKG_CHECK_EXISTS],
++[AC_REQUIRE([HOST_PKG_PROG_PKG_CONFIG])dnl
++if test -n "$HOST_PKG_CONFIG" && \
++    AC_RUN_LOG([$HOST_PKG_CONFIG --exists --print-errors "$1"]); then
++  m4_ifval([$2], [$2], [:])
++m4_ifvaln([$3], [else
++  $3])dnl
++fi])
++
+diff -urN gcalctool-5.27.5-0rig/m4/Makefile.am gcalctool-5.27.5/m4/Makefile.am
+--- gcalctool-5.27.5-0rig/m4/Makefile.am	2009-05-15 02:02:16.000000000 +0200
++++ gcalctool-5.27.5/m4/Makefile.am	2009-08-16 11:32:12.000000000 +0200
+@@ -1,3 +1,4 @@
+-EXTRA_DIST = gnome-doc-utils.m4 \
+-             intltool.m4
++EXTRA_DIST =	host-pkg.m4 \
++		gnome-doc-utils.m4 \
++		intltool.m4
+ 
+diff -urN gcalctool-5.27.5-0rig/m4/Makefile.in gcalctool-5.27.5/m4/Makefile.in
+--- gcalctool-5.27.5-0rig/m4/Makefile.in	2009-08-16 00:33:55.000000000 +0200
++++ gcalctool-5.27.5/m4/Makefile.in	2009-08-16 11:33:01.000000000 +0200
+@@ -219,8 +219,9 @@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-EXTRA_DIST = gnome-doc-utils.m4 \
+-             intltool.m4
++EXTRA_DIST =	host-pkg.m4 \
++		gnome-doc-utils.m4 \
++		intltool.m4
+ 
+ all: all-am
+ 
diff --git a/recipes/gcalctool/gcalctool_5.27.5/makefile-fix.diff b/recipes/gcalctool/gcalctool_5.27.5/makefile-fix.diff
new file mode 100644
index 0000000..48a5462
--- /dev/null
+++ b/recipes/gcalctool/gcalctool_5.27.5/makefile-fix.diff
@@ -0,0 +1,18 @@
+--- gcalctool/Makefile.am~	2005-03-23 16:50:10.000000000 +0000
++++ gcalctool/Makefile.am	2006-03-20 13:59:17.000000000 +0000
+@@ -30,15 +30,8 @@
+ 
+ SCHEMAS_FILE = gcalctool.schemas
+ 
+-### Install the schemas file in /etc if GNOME support is not compiled in,
+-### and do not install the schemas at all
+-if DISABLE_GNOME
+-schemasdir = $(sysconfdir)/gcalctool
+-schemas_DATA = $(SCHEMAS_FILE)
+-else
+ schemadir = $(GCONF_SCHEMA_FILE_DIR)
+ schema_DATA = $(SCHEMAS_FILE)
+-endif
+ 
+ EXTRA_DIST = \
+ 	autogen.sh \





More information about the Openembedded-commits mailing list