summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/Makefile.autotools.in624
-rw-r--r--package/Makefile.in7
-rw-r--r--package/Makefile.package.in397
-rw-r--r--package/atk/atk.mk50
-rw-r--r--package/autoconf/autoconf-2.65-fix-m4-detection-test-on-dash.patch36
-rw-r--r--package/autoconf/autoconf.mk53
-rw-r--r--package/automake/automake.mk47
-rw-r--r--package/cairo/cairo.mk50
-rw-r--r--package/dbus-glib/dbus-glib.mk52
-rw-r--r--package/dbus/dbus.mk74
-rw-r--r--package/directfb/directfb.mk55
-rw-r--r--package/dnsmasq/dnsmasq.mk2
-rw-r--r--package/docker/docker.mk2
-rw-r--r--package/editors/vim/vim.mk2
-rw-r--r--package/enchant/enchant.mk2
-rw-r--r--package/expat/expat.mk46
-rw-r--r--package/fontconfig/fontconfig.mk49
-rw-r--r--package/freetype/freetype.mk48
-rw-r--r--package/gettext/gettext.mk2
-rw-r--r--package/gob2/gob2.mk46
-rw-r--r--package/gqview/gqview.mk2
-rw-r--r--package/gvfs/gvfs.mk2
-rw-r--r--package/hal/Config.in1
-rw-r--r--package/hal/hal-include-fix.patch35
-rw-r--r--package/hal/hal.mk17
-rw-r--r--package/hal/hal01-configure-buildroot-cross.patch10
-rw-r--r--package/i2c-tools/i2c-tools.mk44
-rw-r--r--package/java/classpath/classpath.mk2
-rw-r--r--package/java/jamvm/jamvm.mk2
-rw-r--r--package/libdaemon/libdaemon.mk2
-rw-r--r--package/libdrm/libdrm.mk2
-rw-r--r--package/libglade/libglade.mk2
-rw-r--r--package/libglib2/libglib2.mk57
-rw-r--r--package/libgtk2/libgtk2.mk57
-rw-r--r--package/libidn/libidn.mk2
-rw-r--r--package/libpng/libpng.mk2
-rw-r--r--package/libsoup/libsoup.mk2
-rw-r--r--package/libtool/libtool.mk51
-rw-r--r--package/libusb/libusb.mk4
-rw-r--r--package/libxml2/libxml2.mk52
-rw-r--r--package/lzo/lzo.mk43
-rw-r--r--package/m4/m4.mk46
-rw-r--r--package/matchbox/matchbox.mk2
-rw-r--r--package/midori/midori.mk2
-rw-r--r--package/mtd/mtd-utils/mtd.mk2
-rw-r--r--package/multimedia/gstreamer/gstreamer.mk2
-rw-r--r--package/multimedia/libmms/libmms.mk2
-rw-r--r--package/multimedia/libogg/libogg.mk2
-rw-r--r--package/multimedia/libtheora/libtheora.mk2
-rw-r--r--package/multimedia/libvorbis/libvorbis.mk3
-rw-r--r--package/multimedia/swfdec/swfdec.mk2
-rw-r--r--package/neon/neon.mk2
-rw-r--r--package/olsr/olsr.mk60
-rw-r--r--package/pango/pango.mk58
-rw-r--r--package/pcmanfm/pcmanfm.mk2
-rw-r--r--package/pixman/pixman.mk44
-rw-r--r--package/pkg-config/pkg-config.mk51
-rw-r--r--package/shared-mime-info/shared-mime-info.mk54
-rw-r--r--package/sylpheed/sylpheed.mk2
-rw-r--r--package/tiff/tiff.mk2
-rw-r--r--package/udev/udev.mk275
-rw-r--r--package/usbutils/usbutils.mk2
-rw-r--r--package/wpa_supplicant/wpa_supplicant.mk2
-rw-r--r--package/x11r7/xfont_font-util/xfont_font-util.mk2
-rw-r--r--package/x11r7/xproto_xproto/xproto_xproto.mk44
-rw-r--r--package/x11r7/xutil_makedepend/xutil_makedepend.mk46
-rw-r--r--package/zlib/zlib.mk93
67 files changed, 1025 insertions, 1814 deletions
diff --git a/package/Makefile.autotools.in b/package/Makefile.autotools.in
index c3257cfbe..09f44b46f 100644
--- a/package/Makefile.autotools.in
+++ b/package/Makefile.autotools.in
@@ -1,348 +1,63 @@
################################################################################
+# Autotools package infrastructure
#
-# Makefile.autotools.in --
+# This file implements an infrastructure that eases development of
+# package .mk files for autotools packages. It should be used for all
+# packages that use the autotools as their build system. Non-autotools
+# packages should use the generic infrastructure in
+# package/Makefile.package.in.
#
-# Implicit and Generated Rules for easily creating autotools-compatible
-# buildroot packages
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
#
-## Example minimal makefile for a package named 'foo'
+# In terms of implementation, this autotools infrastructure requires
+# the .mk file to only specify metadata informations about the
+# package: name, version, download URL, etc.
#
-# | FOO_VERSION = 1.0
-# | FOO_SOURCE = foo-$(FOO_VERSION).tar.gz
-# | FOO_SITE = http://www.libfoo.org/dist
-# | $(eval $(call AUTOTARGETS,package,foo))
+# We still allow the package .mk file to override what the different
+# steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is
+# already defined, it is used as the list of commands to perform to
+# build the package, instead of the default autotools behaviour. The
+# package can also define some post operation hooks.
#
-## The following targets can be called from the shell:
-#
-# foo, foo-source, foo-patch, foo-configure, foo-build, foo-install,
-# foo-install-target, foo-install-staging, foo-uninstall, foo-clean,
-# foo-dirclean
-#
-## The following variables which can be (re)defined in the package makefile:
-#
-# FOO_VERSION [mandatory]
-# version string of the package
-# FOO_SOURCE [default foo-$(FOO_VERSION).tar.gz]
-# file name of the package source
-# FOO_SITE [default sourceforge project "foo"]
-# URL under wich $(FOO_SOURCE) can be found
-# FOO_DEPENDENCIES [default empty]
-# list of (package) targets that must be built before foo
-# FOO_AUTORECONF [YES/NO, default NO]
-# run <autoreconf> before <configure>
-# FOO_AUTORECONF_OPT [default empty]
-# arguments passed to the <autoreconf> script
-# FOO_LIBTOOL_PATCH [YES/NO, default YES]
-# Do you want the standard buildroot patch applied to ltmain.sh? (libtool)
-# FOO_USE_CONFIG_CACHE [YES/NO default $(BR2_CONFIG_CACHE)]
-# Do you wany to use the central configure cache file? See BR2_CONFIG_CACHE.
-# FOO_CONF_ENV [default empty]
-# environment passed to the <configure> script
-# FOO_CONF_OPT [default empty]
-# arguments passed to the <configure> script
-# FOO_MAKE [default $(MAKE)]
-# command to use to execute <make>
-# FOO_MAKE_ENV [default empty]
-# environment passed to all calls to <make> in the package source
-# directory
-# FOO_MAKE_OPT [default empty]
-# arguments passed to <make> while building
-# FOO_INSTALL_STAGING [YES/NO, default NO]
-# install the package to the staging directory
-# FOO_INSTALL_TARGET [YES/NO, default YES]
-# install the package to the target directory
-# FOO_INSTALL_STAGING_OPT [default DESTDIR=$(STAGING_DIR) install]
-# arguments passed to <make> while installing to the staging directory
-# FOO_INSTALL_TARGET_OPT [default DESTDIR=$(TARGET_DIR) install-exec/install-strip]
-# arguments passed to <make> while installing to the target directory
-# FOO_CLEAN_OPT [default clean]
-# arguments passed to <make> while installing to the staging directory
-# FOO_UNINSTALL_STAGING_OPT [default DESTDIR=$(STAGING_DIR) uninstall]
-# arguments passed to <make> while uninstalling from the staging
-# directory
-# FOO_UNINSTALL_TARGET_OPT [default DESTDIR=$(TARGET_DIR) uninstall]
-# arguments passed to <make> while uninstalling from the target
-# directory
-# FOO_SUBDIR [default empty]
-# relative path in the package source from which to run configure and
-# make
-# FOO_DIR_PREFIX [default empty]
-# toplevel relative path to package *.mk file and corresponding patches
-#
-## The following variables contain hook target names
-## by default they do nothing, they can be overriden in package makefiles
-#
-# FOO_HOOK_POST_EXTRACT, FOO_HOOK_POST_CONFIGURE,
-# FOO_HOOK_POST_BUILD, FOO_HOOK_POST_INSTALL
-#
-## The following variables contain targets that can be overriden
-#
-# FOO_TARGET_INSTALL_TARGET FOO_TARGET_INSTALL_STAGING FOO_TARGET_BUILD
-# FOO_TARGET_CONFIGURE FOO_TARGET_PATCH FOO_TARGET_EXTRACT FOO_TARGET_SOURCE
-# FOO_TARGET_UNINSTALL FOO_TARGET_CLEAN FOO_TARGET_DIRCLEAN
-#
-# E.g. if your package has a no <configure> script you can place the following
-# in your package makefile:
-#
-# | $(FOO_TARGET_INSTALL):
-# | touch $@
-#
-## The following variables are defined automatically and can be used in
-## overriden targets:
-#
-# PKG
-# is always the current package name ("foo" in the example)
-# FOO_DIR
-# the directory in which the package source is extracted.
-# the base name will always be foo-$(FOO_VERSION), no matter what the
-# archive name or the directory-in-archive name are.
-# MESSAGE
-# macro that outputs a pretty message to stdout, e.g. use
-# $(call MESSAGE,"Hello World")
-# in a target.
-#
-# Caveats:
-# - the 'eval' line (final line in the example) must be placed
-# after all variable settings, but before all target re-definition
-# (including hooks)
################################################################################
-# UPPERCASE Macro -- transform its argument to uppercase and replace dots and
-# hyphens to underscores
-UPPERCASE = $(shell echo $(1) | tr "a-z.-" "A-Z__")
-
-# Define extrators for different archive suffixes
-INFLATE.bz2 = $(BZCAT)
-INFLATE.gz = $(ZCAT)
-INFLATE.tbz = $(BZCAT)
-INFLATE.tgz = $(ZCAT)
-INFLATE.tar = cat
-
-# MESSAGE Macro -- display a message in bold type
-MESSAGE = @echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(1)$(TERM_RESET)"
-TERM_BOLD := $(shell tput smso)
-TERM_RESET := $(shell tput rmso)
-
################################################################################
-# DOWNLOAD -- Download helper. Will try to download source from:
-# 1) BR2_PRIMARY_SITE if enabled
-# 2) Download site
-# 3) BR2_BACKUP_SITE if enabled
-#
-# Argument 1 is the source location
-# Argument 2 is the source filename
+# AUTOTARGETS_INNER -- defines how the configuration, compilation and
+# installation of an autotools package should be done, implements a
+# few hooks to tune the build process for autotools specifities and
+# calls the generic package infrastructure to generate the necessary
+# make targets
#
-# E.G. use like this:
-# $(call DOWNLOAD,$(FOO_SITE),$(FOO_SOURCE))
-################################################################################
-
-# support make source-check/external-deps
-ifneq ($(SPIDER),)
-DOWNLOAD=$(WGET) -P $(DL_DIR) $(1)/$(2)
-else
-define DOWNLOAD
- $(Q)test -e $(DL_DIR)/$(2) || \
- for site in $(call qstrip,$(BR2_PRIMARY_SITE)) $(1) $(call qstrip,$(BR2_BACKUP_SITE)); \
- do $(WGET) -P $(DL_DIR) $$site/$(2) && exit; done
-endef
-endif
-
-# Utility programs used to build packages
-TAR ?= tar
-#ACLOCAL_STAGING_DIR ?= $(STAGING_DIR)/usr/share/aclocal
-#ACLOCAL ?= aclocal -I $(ACLOCAL_STAGING_DIR)
-#AUTORECONF ?= autoreconf -v -i -f -I $(ACLOCAL_STAGING_DIR)
-# ACLOCAL="$(ACLOCAL)"
-
-# Automatically detect tar --strip-path/components option
-TAR_STRIP_COMPONENTS := $(shell $(TAR) --help | grep strip-path > /dev/null ; if test $$? = 0 ; then echo '--strip-path' ; else echo '--strip-components' ; fi)
-
-################################################################################
-# Implicit targets -- produce a stamp file for each step of a package build
+# argument 1 is the lowercase package name
+# argument 2 is the uppercase package name, including an HOST_ prefix
+# for host packages
+# argument 3 is the uppercase package name, without the HOST_ prefix
+# for host packages
+# argument 4 is the package directory prefix
+# argument 5 is the type (target or host)
################################################################################
-# Retrieve and unpack the archive
-$(BUILD_DIR)/%/.stamp_downloaded:
-# support make source-check/external-deps
-ifeq ($(SPIDER),)
- $(call MESSAGE,"Downloading")
-endif
- $(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE))
- $(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_PATCH)))
-ifeq ($(SPIDER),)
- $(Q)mkdir -p $(@D)
- $(Q)touch $@
-endif
-
-# Retrieve and unpack the archive
-$(BUILD_DIR)/%/.stamp_extracted:
- $(call MESSAGE,"Extracting")
- $(Q)mkdir -p $(@D)
- $(Q)$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
-# some packages have messed up permissions inside
- $(Q)chmod -R ug+rw $(@D)
- $(Q)touch $@
-
-# Fix libtool support if required by the package
-$(BUILD_DIR)/%/.stamp_libtool_patch:
- $(call MESSAGE,"Patching libtool")
-# if the package uses libtool, patch it for cross-compiling in buildroot
- $(Q)if test "$($(PKG)_LIBTOOL_PATCH)" = "YES" -a \
- "$($(PKG)_AUTORECONF)" != "YES"; then \
- for i in `find $(@D) -name ltmain.sh`; do \
- toolchain/patch-kernel.sh $${i%/*} package buildroot-libtool.patch; \
- done \
- fi
- $(Q)touch $@
-
-# Patch
-# XXX: FIXME: This has to be done differently and path-independent, i.e. use
-# XXX: FIXME: the dir-part of the stem as base-dir (instead of hardcoding
-# XXX: FIXME: "package/".
-$(BUILD_DIR)/%/.stamp_patched: NAMEVER = $($(PKG)_NAME)-$($(PKG)_VERSION)
-$(BUILD_DIR)/%/.stamp_patched:
- $(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)")
- $(if $($(PKG)_PATCH),toolchain/patch-kernel.sh $(@D) $(DL_DIR) $($(PKG)_PATCH))
- $(Q)( \
- if test -d $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME); then \
- if test "$(wildcard $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER)*.patch*)"; then \
- toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \
- else \
- toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) $($(PKG)_NAME)\*.patch $($(PKG)_NAME)\*.patch.$(ARCH) || exit 1; \
- if test -d $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER); then \
- toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \
- fi; \
- fi; \
- fi; \
- )
-ifeq ($(BR2_UPDATE_CONFIG),y)
- $(Q)(for file in config.guess config.sub; do \
- for i in $$(find $(@D) -name $$file); do \
- cp package/gnuconfig/$$file $$i; \
- done; \
- done)
-endif
- $(Q)touch $@
-
-# Running autoreconf
-$(BUILD_DIR)/%/.stamp_autoconfigured:
- $(call MESSAGE,"Running autoreconf")
- $(Q)cd $(@D)/$($(PKG)_SUBDIR) && $(AUTORECONF) $($(PKG)_AUTORECONF_OPT)
-# if the package uses libtool, patch it for cross-compiling in buildroot
- $(Q)if test "$($(PKG)_LIBTOOL_PATCH)" = "YES"; then \
- for i in `find $(@D)/$($(PKG)_SUBDIR) -name ltmain.sh`; do \
- toolchain/patch-kernel.sh $${i%/*} package buildroot-libtool.patch; \
- done \
- fi
- $(Q)touch $@
-
-# Configuring
-$(BUILD_DIR)/%/.stamp_configured:
- $(call MESSAGE,"Configuring")
- cd $(@D)/$($(PKG)_SUBDIR) && rm -f config.cache && \
- $(TARGET_CONFIGURE_OPTS) \
- $(TARGET_CONFIGURE_ARGS) \
- $(TARGET_CONFIGURE_ENV) \
- $($(PKG)_CONF_ENV) \
- $(if $(THIS_SRCDIR),$(THIS_SRCDIR)/,./)configure \
- $(if $(filter YES,$($(PKG)_USE_CONFIG_CACHE)),--cache-file="$(BUILD_DIR)/tgt-config.cache",) \
- --target=$(GNU_TARGET_NAME) \
- --host=$(GNU_TARGET_NAME) \
- --build=$(GNU_HOST_NAME) \
- --prefix=/usr \
- --exec-prefix=/usr \
- --sysconfdir=/etc \
- $(DISABLE_DOCUMENTATION) \
- $(DISABLE_NLS) \
- $(DISABLE_LARGEFILE) \
- $(DISABLE_IPV6) \
- $(QUIET) $($(PKG)_CONF_OPT)
- $(Q)touch $@
-
-# Build
-$(BUILD_DIR)/%/.stamp_built:
- $(call MESSAGE,"Building")
- PATH=$(TARGET_PATH) $($(PKG)_MAKE_ENV) $($(PKG)_MAKE) $($(PKG)_MAKE_OPT) -C $(@D)/$($(PKG)_SUBDIR)
- $(Q)touch $@
-
-# Install to staging dir
-$(BUILD_DIR)/%/.stamp_staging_installed:
- $(call MESSAGE,'Installing to host (staging directory)')
- $($(PKG)_MAKE_ENV) $($(PKG)_MAKE) $($(PKG)_INSTALL_STAGING_OPT) -C $(@D)/$($(PKG)_SUBDIR)
-# toolchain/replace.sh $(STAGING_DIR)/usr/lib ".*\.la" "\(['= ]\)/usr" "\\1$(STAGING_DIR)/usr"
- for i in $$(find $(STAGING_DIR)/usr/lib/ -name "*.la"); do \
- cp $$i $$i~; \
- $(SED) "s:\(['= ]\)/usr:\\1$(STAGING_DIR)/usr:g" $$i; \
- done
- touch $@
-
-# Install to target dir
-$(BUILD_DIR)/%/.stamp_target_installed:
- $(call MESSAGE,"Installing to target")
- $($(PKG)_MAKE_ENV) $($(PKG)_MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $($(PKG)_DIR)/$($(PKG)_SUBDIR)
- $(if $(BR2_HAVE_MANPAGES),,for d in man share/man; do \
- rm -rf $(TARGET_DIR)/$$d $(TARGET_DIR)/usr/$$d; \
- done)
- $(if $(BR2_HAVE_INFOPAGES),,for d in info share/info; do \
- rm -rf $(TARGET_DIR)/$$d $(TARGET_DIR)/usr/$$d; \
- done)
- $(if $(BR2_HAVE_DOCUMENTATION),,for d in doc share/doc; do \
- rm -rf $(TARGET_DIR)/$$d $(TARGET_DIR)/usr/$$d; \
- done)
- touch $@
-
-$(BUILD_DIR)/%/.stamp_cleaned:
- $(call MESSAGE,"Cleaning up")
- -$($(PKG)_MAKE_ENV) $($(PKG)_MAKE) $($(PKG)_CLEAN_OPT) -C $(@D)/$($(PKG)_SUBDIR)
- rm -f $(@D)/.stamp_built
-
-$(BUILD_DIR)/%/.stamp_uninstalled:
- $(call MESSAGE,"Uninstalling")
- $($(PKG)_MAKE_ENV) $($(PKG)_MAKE) $($(PKG)_UNINSTALL_STAGING_OPT) -C $(@D)/$($(PKG)_SUBDIR)
- rm -f $(@D)/.stamp_staging_installed
- $($(PKG)_MAKE_ENV) $($(PKG)_MAKE) $($(PKG)_UNINSTALL_TARGET_OPT) -C $(@D)/$($(PKG)_SUBDIR)
- rm -f $($(PKG)_TARGET_INSTALL_TARGET) $($(PKG)_HOOK_POST_INSTALL)
-
-$(BUILD_DIR)/%/.stamp_dircleaned:
- rm -Rf $(@D)
-
-
-################################################################################
-# AUTOTARGETS -- the target generator macro; define a set of human-readable
-# make targets, stamps, and default per-package variables.
-# Argument 1 is the package directory prefix.
-# Argument 2 is the (lowercase) package name.
-################################################################################
-
-define AUTOTARGETS
-$(call AUTOTARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(1))
-endef
-
-# AUTOTARGETS_INNER -- does the job for AUTOTARGETS; argument 1 is the
-# lowercase package name, argument 2 the uppercase package name,
-# argument 3 the package directory prefix
define AUTOTARGETS_INNER
# define package-specific variables to default values
-$(2)_NAME = $(1)
-$(2)_VERSION ?= undefined
-$(2)_DIR = $$(BUILD_DIR)/$(1)-$$($(2)_VERSION)
-$(2)_SOURCE ?= $(1)-$$($(2)_VERSION).tar.gz
-$(2)_SITE ?= \
- http://$$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/$(1)
-$(2)_DEPENDENCIES ?=
-$(2)_AUTORECONF ?= NO
-$(2)_AUTORECONF_OPT ?=
-$(2)_LIBTOOL_PATCH ?= YES
-$(2)_USE_CONFIG_CACHE ?= $(if $(BR2_CONFIG_CACHE),YES,NO)
+ifndef $(2)_SUBDIR
+ ifdef $(3)_SUBDIR
+ $(2)_SUBDIR = $($(3)_SUBDIR)
+ else
+ $(2)_SUBDIR ?=
+ endif
+endif
+
$(2)_CONF_ENV ?=
$(2)_CONF_OPT ?=
$(2)_MAKE ?= $(MAKE)
$(2)_MAKE_ENV ?=
$(2)_MAKE_OPT ?=
-$(2)_INSTALL_STAGING ?= NO
-$(2)_INSTALL_TARGET ?= YES
+$(2)_AUTORECONF ?= NO
+$(2)_AUTORECONF_OPT ?=
+$(2)_LIBTOOL_PATCH ?= YES
+$(2)_USE_CONFIG_CACHE ?= $(if $(BR2_CONFIG_CACHE),YES,NO)
$(2)_INSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) install
ifeq ($(BR2_ENABLE_DEBUG),y)
$(2)_INSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) install-exec
@@ -352,111 +67,204 @@ endif
$(2)_CLEAN_OPT ?= clean
$(2)_UNINSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) uninstall
$(2)_UNINSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) uninstall
-$(2)_SUBDIR ?=
-$(2)_DIR_PREFIX = $(if $(3),$(3),$(TOP_SRCDIR)/package)
+$(2)_SRCDIR = $$($(2)_DIR)/$($(2)_SUBDIR)
-# define sub-target stamps
-$(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed
-$(2)_TARGET_INSTALL_STAGING = $$($(2)_DIR)/.stamp_staging_installed
-$(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built
-$(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured
-$(2)_TARGET_AUTORECONF = $$($(2)_DIR)/.stamp_autoconfigured
-$(2)_TARGET_LIBTOOL_PATCH = $$($(2)_DIR)/.stamp_libtool_patch
-$(2)_TARGET_PATCH = $$($(2)_DIR)/.stamp_patched
-$(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_extracted
-$(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded
-$(2)_TARGET_UNINSTALL = $$($(2)_DIR)/.stamp_uninstalled
-$(2)_TARGET_CLEAN = $$($(2)_DIR)/.stamp_cleaned
-$(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned
+#
+# Configure step. Only define it if not already defined by the package
+# .mk file. And take care of the differences between host and target
+# packages.
+#
+ifndef $(2)_CONFIGURE_CMDS
+ifeq ($(5),target)
+
+# Configure package for target
+define $(2)_CONFIGURE_CMDS
+ (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache && \
+ $$(TARGET_CONFIGURE_OPTS) \
+ $$(TARGET_CONFIGURE_ARGS) \
+ $$(TARGET_CONFIGURE_ENV) \
+ $$($$(PKG)_CONF_ENV) \
+ ./configure \
+ $(if $(filter YES,$$($$(PKG)_USE_CONFIG_CACHE)),--cache-file="$(BUILD_DIR)/tgt-config.cache",) \
+ --target=$$(GNU_TARGET_NAME) \
+ --host=$$(GNU_TARGET_NAME) \
+ --build=$$(GNU_HOST_NAME) \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --sysconfdir=/etc \
+ $$(DISABLE_DOCUMENTATION) \
+ $$(DISABLE_NLS) \
+ $$(DISABLE_LARGEFILE) \
+ $$(DISABLE_IPV6) \
+ $$(QUIET) $$($$(PKG)_CONF_OPT) \
+ )
+endef
+else
-$(2)_HOOK_POST_EXTRACT = $$($(2)_DIR)/.stamp_hook_post_extract
-$(2)_HOOK_POST_CONFIGURE = $$($(2)_DIR)/.stamp_hook_post_configure
-$(2)_HOOK_POST_BUILD = $$($(2)_DIR)/.stamp_hook_post_build
-$(2)_HOOK_POST_INSTALL = $$($(2)_DIR)/.stamp_hook_post_install
+# Configure package for host
+define $(2)_CONFIGURE_CMDS
+ (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache; \
+ $$(HOST_CONFIGURE_OPTS) \
+ CFLAGS="$$(HOST_CFLAGS)" \
+ LDFLAGS="$$(HOST_LDFLAGS)" \
+ ./configure \
+ --prefix="$$(HOST_DIR)/usr" \
+ --sysconfdir="$$(HOST_DIR)/etc" \
+ $$($$(PKG)_CONF_OPT) \
+ )
+endef
+endif
+endif
-# human-friendly targets and target sequencing
-$(1): $(1)-install
-$(1)-install: $(1)-install-staging $(1)-install-target \
- $$($(2)_HOOK_POST_INSTALL)
+#
+# Hook to update config.sub and config.guess if needed
+#
+define UPDATE_CONFIG_HOOK
+ for file in config.guess config.sub; do \
+ for i in $$$$(find $$(@D) -name $$$$file); do \
+ cp package/gnuconfig/$$$$file $$$$i; \
+ done; \
+ done
+endef
-ifeq ($$($(2)_INSTALL_TARGET),YES)
-$(1)-install-target: $(1)-build $$($(2)_TARGET_INSTALL_TARGET)
-else
-$(1)-install-target:
+ifeq ($(BR2_UPDATE_CONFIG),y)
+$(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
endif
-ifeq ($$($(2)_INSTALL_STAGING),YES)
-$(1)-install-staging: $(1)-build $$($(2)_TARGET_INSTALL_STAGING)
-else
-$(1)-install-staging:
-endif
+#
+# Hook to patch libtool to make it work properly for cross-compilation
+#
+define LIBTOOL_PATCH_HOOK
+ @$(call MESSAGE,"Patching libtool")
+ $(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES" -a \
+ "$$($$(PKG)_AUTORECONF)" != "YES"; then \
+ for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \
+ toolchain/patch-kernel.sh $${i%/*} package buildroot-libtool.patch; \
+ done \
+ fi
+endef
-$(1)-build: $(1)-configure \
- $$($(2)_TARGET_BUILD) \
- $$($(2)_HOOK_POST_BUILD)
+ifeq ($($(2)_LIBTOOL_PATCH),YES)
+$(2)_POST_PATCH_HOOKS += LIBTOOL_PATCH_HOOK
+endif
-$(1)-configure: $(1)-autoreconf \
- $$($(2)_TARGET_CONFIGURE) \
- $$($(2)_HOOK_POST_CONFIGURE)
+#
+# Hook to autoreconf the package if needed
+#
+define AUTORECONF_HOOK
+ @$(call MESSAGE,"Autoreconfiguring")
+ $(Q)cd $$($$(PKG)_SRCDIR) && $(AUTORECONF) $$($$(PKG)_AUTORECONF_OPT)
+ $(Q)if test "$($$(PKG)_LIBTOOL_PATCH)" = "YES"; then \
+ for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \
+ toolchain/patch-kernel.sh $${i%/*} package buildroot-libtool.patch; \
+ done \
+ fi
+endef
-ifeq ($$($(2)_AUTORECONF),YES)
-$(1)-autoreconf: $(1)-patch $$($(2)_TARGET_AUTORECONF)
+ifeq ($($(2)_AUTORECONF),YES)
+$(2)_POST_PATCH_HOOKS += AUTORECONF_HOOK
$(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
+endif
+
+#
+# Build step. Only define it if not already defined by the package .mk
+# file.
+#
+ifndef $(2)_BUILD_CMDS
+ifeq ($(5),target)
+define $(2)_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPT) -C $$($$(PKG)_SRCDIR)
+endef
else
-$(1)-autoreconf: $(1)-patch
+define $(2)_BUILD_CMDS
+ $(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPT) -C $$($$(PKG)_SRCDIR)
+endef
+endif
endif
-$(1)-patch: $(1)-extract $$($(2)_TARGET_PATCH)
+#
+# Host installation step. Only define it if not already defined by the
+# package .mk file.
+#
+ifndef $(2)_INSTALL_CMDS
+define $(2)_INSTALL_CMDS
+ $(HOST_MAKE_ENV) $(MAKE) -C $$($$(PKG)_SRCDIR) install
+endef
+endif
-$(1)-extract: $(1)-depends \
- $$($(2)_TARGET_EXTRACT) \
- $$($(2)_HOOK_POST_EXTRACT) \
- $$($(2)_TARGET_LIBTOOL_PATCH)
+#
+# Staging installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_STAGING_CMDS
+define $(2)_INSTALL_STAGING_CMDS
+ $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR)
+ for i in $$$$(find $(STAGING_DIR)/usr/lib/ -name "*.la"); do \
+ cp $$$$i $$$$i~; \
+ $$(SED) "s:\(['= ]\)/usr:\\1$(STAGING_DIR)/usr:g" $$$$i; \
+ done
+endef
+endif
-$(1)-depends: $(1)-source $$($(2)_DEPENDENCIES)
+#
+# Target installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_TARGET_CMDS
+define $(2)_INSTALL_TARGET_CMDS
+ $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
+endef
+endif
-$(1)-source: $$($(2)_TARGET_SOURCE)
+#
+# Clean step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_CLEAN_CMDS
+define $(2)_CLEAN_CMDS
+ -$$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_CLEAN_OPT) -C $$($$(PKG)_SRCDIR)
+endef
+endif
-# non-build targets
-$(1)-uninstall: $(1)-configure $$($(2)_TARGET_UNINSTALL)
+#
+# Uninstall from staging step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_UNINSTALL_STAGING_CMDS
+define $(2)_UNINSTALL_STAGING_CMDS
+ $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR)
+endef
+endif
-$(1)-clean: $(1)-uninstall \
- $$($(2)_TARGET_CLEAN)
+#
+# Uninstall from target step. Only define it if not already defined
+# by the package .mk file.
+#
+ifndef $(2)_UNINSTALL_TARGET_CMDS
+define $(2)_UNINSTALL_TARGET_CMDS
+ $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
+endef
+endif
-$(1)-dirclean: $$($(2)_TARGET_DIRCLEAN)
+# Call the generic package infrastructure to generate the necessary
+# make targets
+$(call GENTARGETS_INNER,$(1),$(2),$(3),$(4),$(5))
-# define the PKG variable for all targets, containing the
-# uppercase package variable prefix
-$$($(2)_TARGET_INSTALL_TARGET): PKG=$(2)
-$$($(2)_TARGET_INSTALL_STAGING): PKG=$(2)
-$$($(2)_TARGET_BUILD): PKG=$(2)
-$$($(2)_TARGET_CONFIGURE): PKG=$(2)
-$$($(2)_TARGET_LIBTOOL_PATCH): PKG=$(2)
-$$($(2)_TARGET_AUTORECONF): PKG=$(2)
-$$($(2)_TARGET_PATCH): PKG=$(2)
-$$($(2)_TARGET_EXTRACT): PKG=$(2)
-$$($(2)_TARGET_SOURCE): PKG=$(2)
-$$($(2)_TARGET_UNINSTALL): PKG=$(2)
-$$($(2)_TARGET_CLEAN): PKG=$(2)
-$$($(2)_TARGET_DIRCLEAN): PKG=$(2)
-$$($(2)_HOOK_POST_EXTRACT): PKG=$(2)
-$$($(2)_HOOK_POST_CONFIGURE): PKG=$(2)
-$$($(2)_HOOK_POST_BUILD): PKG=$(2)
-$$($(2)_HOOK_POST_INSTALL): PKG=$(2)
+endef
-# define hook targets
-# default hook behaviour: do nothing
-$$($(2)_HOOK_POST_EXTRACT):
-$$($(2)_HOOK_POST_CONFIGURE):
-$$($(2)_HOOK_POST_BUILD):
-$$($(2)_HOOK_POST_INSTALL):
+################################################################################
+# AUTOTARGETS -- the target generator macro for autotools packages
+#
+# Argument 1 is the package directory prefix [mandatory]
+# Argument 2 is the lowercase package name [mandatory]
+# Argument 3 is "target" or "host" [optional, default: "target"]
+################################################################################
-# add package to the general list of targets if requested by the buildroot
-# configuration
-ifeq ($$(BR2_PACKAGE_$(2)),y)
-TARGETS += $(1)
+define AUTOTARGETS
+ifeq ($(3),host)
+$(call AUTOTARGETS_INNER,$(3)-$(2),$(call UPPERCASE,$(3)-$(2)),$(call UPPERCASE,$(2)),$(1),host)
+else
+$(call AUTOTARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(call UPPERCASE,$(2)),$(1),target)
endif
endef
-
-# :mode=makefile:
diff --git a/package/Makefile.in b/package/Makefile.in
index 25dd6da81..e643577fe 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -109,7 +109,7 @@ ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
# Quotes are needed for spaces et al in path components.
-TARGET_PATH="$(TOOLCHAIN_DIR)/bin:$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
+TARGET_PATH="$(TOOLCHAIN_DIR)/bin:$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(ARCH)$(ROOTFS_SUFFIX)
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)
@@ -119,7 +119,7 @@ else
TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
-TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(TOOLCHAIN_DIR)/bin:$(TOOLCHAIN_EXTERNAL_PATH)/bin:$(PATH)"
+TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(TOOLCHAIN_DIR)/bin:$(TOOLCHAIN_EXTERNAL_PATH)/bin:$(PATH)"
#IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(TOOLCHAIN_EXTERNAL_PREFIX)$(ROOTFS_SUFFIX)
IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(ARCH)$(ROOTFS_SUFFIX)
@@ -236,6 +236,8 @@ TARGET_CONFIGURE_ENV=\
LDFLAGS="$(TARGET_LDFLAGS)" \
FCFLAGS="$(TARGET_FCFLAGS)" \
+TARGET_MAKE_ENV=PATH=$(TARGET_PATH)
+
HOST_CONFIGURE_OPTS=PATH=$(HOST_PATH) \
AR="$(HOSTAR)" \
AS="$(HOSTAS)" \
@@ -349,3 +351,4 @@ endif
X11_PREFIX:=$(call qstrip,$(BR2_X11_PREFIX))
include package/Makefile.autotools.in
+include package/Makefile.package.in
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
new file mode 100644
index 000000000..fbd7f6931
--- /dev/null
+++ b/package/Makefile.package.in
@@ -0,0 +1,397 @@
+################################################################################
+# Generic package infrastructure
+#
+# This file implements an infrastructure that eases development of
+# package .mk files. It should be used for all non-autotools based
+# packages. Autotools-based packages should use the specialized
+# autotools infrastructure in package/Makefile.autotools.in.
+#
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
+#
+# In terms of implementation, this generic infrastructure requires the
+# .mk file to specify:
+#
+# 1. Metadata informations about the package: name, version,
+# download URL, etc.
+#
+# 2. Description of the commands to be executed to configure, build
+# and install the package
+#
+# The autotools infrastructure specializes this generic infrastructure
+# by already implementing the configure, build and install steps.
+################################################################################
+
+# UPPERCASE Macro -- transform its argument to uppercase and replace dots and
+# hyphens to underscores
+UPPERCASE = $(shell echo $(1) | tr "a-z.-" "A-Z__")
+
+# Define extrators for different archive suffixes
+INFLATE.bz2 = $(BZCAT)
+INFLATE.gz = $(ZCAT)
+INFLATE.tbz = $(BZCAT)
+INFLATE.tgz = $(ZCAT)
+INFLATE.tar = cat
+
+# MESSAGE Macro -- display a message in bold type
+MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(1)$(TERM_RESET)"
+TERM_BOLD := $(shell tput smso)
+TERM_RESET := $(shell tput rmso)
+
+################################################################################
+# DOWNLOAD -- Download helper. Will try to download source from:
+# 1) BR2_PRIMARY_SITE if enabled
+# 2) Download site
+# 3) BR2_BACKUP_SITE if enabled
+#
+# Argument 1 is the source location
+# Argument 2 is the source filename
+#
+# E.G. use like this:
+# $(call DOWNLOAD,$(FOO_SITE),$(FOO_SOURCE))
+################################################################################
+
+# support make source-check/external-deps
+ifneq ($(SPIDER),)
+DOWNLOAD=$(WGET) -P $(DL_DIR) $(1)/$(2)
+else
+define DOWNLOAD
+ $(Q)test -e $(DL_DIR)/$(2) || \
+ for site in $(call qstrip,$(BR2_PRIMARY_SITE)) $(1) $(call qstrip,$(BR2_BACKUP_SITE)); \
+ do $(WGET) -P $(DL_DIR) $$site/$(2) && exit; done
+endef
+endif
+
+# Utility programs used to build packages
+TAR ?= tar
+
+# Automatically detect tar --strip-path/components option
+TAR_STRIP_COMPONENTS := \
+ $(shell $(TAR) --help | grep strip-path > /dev/null ; \
+ if test $$? = 0 ; then \
+ echo '--strip-path' ; \
+ else \
+ echo '--strip-components' ; \
+ fi)
+
+# Needed for the foreach loops to loop over the list of hooks, so that
+# each hook call is properly separated by a newline.
+define sep
+
+
+endef
+
+################################################################################
+# Implicit targets -- produce a stamp file for each step of a package build
+################################################################################
+
+# Retrieve the archive
+$(BUILD_DIR)/%/.stamp_downloaded:
+# support make source-check/external-deps
+ifeq ($(SPIDER),)
+# Only show the download message if it isn't already downloaded
+ $(Q)(test -e $(DL_DIR)/$($(PKG)_SOURCE) && \
+ (test -z $($(PKG)_PATCH) || test -e $(DL_DIR)$($(PKG)_PATCH))) || \
+ $(call MESSAGE,"Downloading")
+endif
+ $(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE))
+ $(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_PATCH)))
+ifeq ($(SPIDER),)
+ $(Q)mkdir -p $(@D)
+ $(Q)touch $@
+endif
+
+# Unpack the archive
+$(BUILD_DIR)/%/.stamp_extracted:
+ @$(call MESSAGE,"Extracting")
+ $(Q)mkdir -p $(@D)
+ $(Q)$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) | \
+ $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
+# some packages have messed up permissions inside
+ $(Q)chmod -R ug+rw $(@D)
+ $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
+ $(Q)touch $@
+
+# Patch
+#
+# The NOHOSTPKG variable is the uppercased package name, without the
+# HOST_ prefix, even for host packages. This allows to find the
+# patches in the package directory, because $($(NOHOSTPKG)_NAME)
+# expands to the package directory name.
+#
+$(BUILD_DIR)/%/.stamp_patched: NAMEVER = $($(NOHOSTPKG)_NAME)-$($(PKG)_VERSION)
+$(BUILD_DIR)/%/.stamp_patched:
+ @$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)")
+ $(if $($(PKG)_PATCH),toolchain/patch-kernel.sh $(@D) $(DL_DIR) $($(PKG)_PATCH))
+ $(Q)( \
+ if test -d $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME); then \
+ if test "$(wildcard $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME)/$(NAMEVER)*.patch*)"; then \
+ toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \
+ else \
+ toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME) $($(NOHOSTPKG)_NAME)\*.patch $($(NOHOSTPKG)_NAME)\*.patch.$(ARCH) || exit 1; \
+ if test -d $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER); then \
+ toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \
+ fi; \
+ fi; \
+ fi; \
+ )
+ $(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep))
+ $(Q)touch $@
+
+# Configure
+$(BUILD_DIR)/%/.stamp_configured:
+ @$(call MESSAGE,"Configuring")
+ $($(PKG)_CONFIGURE_CMDS)
+ $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
+ $(Q)touch $@
+
+# Build
+$(BUILD_DIR)/%/.stamp_built::
+ @$(call MESSAGE,"Building")
+ $($(PKG)_BUILD_CMDS)
+ $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
+ $(Q)touch $@
+
+# Install to host dir
+$(BUILD_DIR)/%/.stamp_host_installed:
+ @$(call MESSAGE,'Installing to host directory')
+ $($(PKG)_INSTALL_CMDS)
+ $(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
+ $(Q)touch $@
+
+# Install to staging dir
+$(BUILD_DIR)/%/.stamp_staging_installed:
+ @$(call MESSAGE,'Installing to staging directory')
+ $($(PKG)_INSTALL_STAGING_CMDS)
+ $(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
+ $(Q)touch $@
+
+# Install to target dir
+$(BUILD_DIR)/%/.stamp_target_installed:
+ @$(call MESSAGE,"Installing to target")
+ $($(PKG)_INSTALL_TARGET_CMDS)
+ $(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
+ $(if $(BR2_HAVE_MANPAGES),,for d in man share/man; do \
+ rm -rf $(TARGET_DIR)/$$d $(TARGET_DIR)/usr/$$d; \
+ done)
+ $(if $(BR2_HAVE_INFOPAGES),,for d in info share/info; do \
+ rm -rf $(TARGET_DIR)/$$d $(TARGET_DIR)/usr/$$d; \
+ done)
+ $(if $(BR2_HAVE_DOCUMENTATION),,for d in doc share/doc; do \
+ rm -rf $(TARGET_DIR)/$$d $(TARGET_DIR)/usr/$$d; \
+ done)
+ $(Q)touch $@
+
+# Clean package
+$(BUILD_DIR)/%/.stamp_cleaned:
+ @$(call MESSAGE,"Cleaning up")
+ $($(PKG)_CLEAN_CMDS)
+ rm -f $(@D)/.stamp_built
+
+# Uninstall package from target and staging
+$(BUILD_DIR)/%/.stamp_uninstalled:
+ @$(call MESSAGE,"Uninstalling")
+ $($(PKG)_UNINSTALL_STAGING_CMDS)
+ rm -f $($(PKG)_TARGET_INSTALL_STAGING)
+ $($(PKG)_UNINSTALL_TARGET_CMDS)
+ rm -f $($(PKG)_TARGET_INSTALL_TARGET) $($(PKG)_HOOK_POST_INSTALL)
+
+# Remove package sources
+$(BUILD_DIR)/%/.stamp_dircleaned:
+ rm -Rf $(@D)
+
+################################################################################
+# GENTARGETS_INNER -- generates the make targets needed to build a
+# generic package
+#
+# argument 1 is the lowercase package name
+# argument 2 is the uppercase package name, including an HOST_ prefix
+# for host packages
+# argument 3 is the uppercase package name, without the HOST_ prefix
+# for host packages
+# argument 4 is the package directory prefix
+# argument 5 is the type (target or host)
+################################################################################
+
+define GENTARGETS_INNER
+
+# Define default values for various package-related variables, if not
+# already defined. For some variables (version, source, site and
+# subdir), if they are undefined, we try to see if a variable without
+# the HOST_ prefix is defined. If so, we use such a variable, so that
+# these informations have only to be specified once, for both the
+# target and host packages of a given .mk file.
+
+$(2)_TYPE = $(5)
+$(2)_NAME = $(1)
+
+ifndef $(2)_VERSION
+ ifdef $(3)_VERSION
+ $(2)_VERSION = $($(3)_VERSION)
+ else
+ $(2)_VERSION = undefined
+ endif
+endif
+
+$(2)_DIR = $$(BUILD_DIR)/$(1)-$$($(2)_VERSION)
+
+ifndef $(2)_SOURCE
+ ifdef $(3)_SOURCE
+ $(2)_SOURCE = $($(3)_SOURCE)
+ else
+ $(2)_SOURCE ?= $(1)-$$($(2)_VERSION).tar.gz
+ endif
+endif
+
+ifndef $(2)_PATCH
+ ifdef $(3)_PATCH
+ $(2)_PATCH = $($(3)_PATCH)
+ endif
+endif
+
+ifndef $(2)_SITE
+ ifdef $(3)_SITE
+ $(2)_SITE = $($(3)_SITE)
+ else
+ $(2)_SITE ?= \
+ http://$$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/$(1)
+ endif
+endif
+
+$(2)_DEPENDENCIES ?=
+$(2)_INSTALL_STAGING ?= NO
+$(2)_INSTALL_TARGET ?= YES
+$(2)_DIR_PREFIX = $(if $(4),$(4),$(TOP_SRCDIR)/package)
+
+# define sub-target stamps
+$(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed
+$(2)_TARGET_INSTALL_STAGING = $$($(2)_DIR)/.stamp_staging_installed
+$(2)_TARGET_INSTALL_HOST = $$($(2)_DIR)/.stamp_host_installed
+$(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built
+$(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured
+$(2)_TARGET_PATCH = $$($(2)_DIR)/.stamp_patched
+$(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_extracted
+$(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded
+$(2)_TARGET_UNINSTALL = $$($(2)_DIR)/.stamp_uninstalled
+$(2)_TARGET_CLEAN = $$($(2)_DIR)/.stamp_cleaned
+$(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned
+
+# new-style hooks
+$(2)_POST_EXTRACT_HOOKS ?=
+$(2)_POST_PATCH_HOOKS ?=
+$(2)_POST_CONFIGURE_HOOKS ?=
+$(2)_POST_BUILD_HOOKS ?=
+$(2)_POST_INSTALL_HOOKS ?=
+$(2)_POST_INSTALL_STAGING_HOOKS ?=
+$(2)_POST_INSTALL_TARGET_HOOKS ?=
+
+# old-style hooks
+$(2)_HOOK_POST_EXTRACT = $$($(2)_DIR)/.stamp_hook_post_extract
+$(2)_HOOK_POST_CONFIGURE = $$($(2)_DIR)/.stamp_hook_post_configure
+$(2)_HOOK_POST_BUILD = $$($(2)_DIR)/.stamp_hook_post_build
+$(2)_HOOK_POST_INSTALL = $$($(2)_DIR)/.stamp_hook_post_install
+
+# human-friendly targets and target sequencing
+$(1): $(1)-install
+
+ifeq ($$($(2)_TYPE),host)
+$(1)-install: $(1)-install-host $$($(2)_HOOK_POST_INSTALL)
+else
+$(1)-install: $(1)-install-staging $(1)-install-target \
+ $$($(2)_HOOK_POST_INSTALL)
+endif
+
+ifeq ($$($(2)_INSTALL_TARGET),YES)
+$(1)-install-target: $(1)-build \
+ $$($(2)_TARGET_INSTALL_TARGET)
+else
+$(1)-install-target:
+endif
+
+ifeq ($$($(2)_INSTALL_STAGING),YES)
+$(1)-install-staging: $(1)-build \
+ $$($(2)_TARGET_INSTALL_STAGING)
+else
+$(1)-install-staging:
+endif
+
+$(1)-install-host: $(1)-build $$($(2)_TARGET_INSTALL_HOST)
+
+$(1)-build: $(1)-configure \
+ $$($(2)_TARGET_BUILD) \
+ $$($(2)_HOOK_POST_BUILD)
+
+$(1)-configure: $(1)-patch \
+ $$($(2)_TARGET_CONFIGURE) \
+ $$($(2)_HOOK_POST_CONFIGURE)
+
+$(1)-patch: $(1)-extract $$($(2)_TARGET_PATCH)
+
+$(1)-extract: $(1)-depends \
+ $$($(2)_TARGET_EXTRACT) \
+ $$($(2)_HOOK_POST_EXTRACT)
+
+$(1)-depends: $(1)-source $$($(2)_DEPENDENCIES)
+
+$(1)-source: $$($(2)_TARGET_SOURCE)
+
+$(1)-uninstall: $(1)-configure $$($(2)_TARGET_UNINSTALL)
+
+$(1)-clean: $(1)-uninstall \
+ $$($(2)_TARGET_CLEAN)
+
+$(1)-dirclean: $$($(2)_TARGET_DIRCLEAN)
+
+# define the PKG variable for all targets, containing the
+# uppercase package variable prefix
+$$($(2)_TARGET_INSTALL_TARGET): PKG=$(2)
+$$($(2)_TARGET_INSTALL_STAGING): PKG=$(2)
+$$($(2)_TARGET_INSTALL_HOST): PKG=$(2)
+$$($(2)_TARGET_BUILD): PKG=$(2)
+$$($(2)_TARGET_CONFIGURE): PKG=$(2)
+$$($(2)_TARGET_PATCH): PKG=$(2)
+$$($(2)_TARGET_PATCH): NOHOSTPKG=$(3)
+$$($(2)_TARGET_EXTRACT): PKG=$(2)
+$$($(2)_TARGET_SOURCE): PKG=$(2)
+$$($(2)_TARGET_UNINSTALL): PKG=$(2)
+$$($(2)_TARGET_CLEAN): PKG=$(2)
+$$($(2)_TARGET_DIRCLEAN): PKG=$(2)
+$$($(2)_HOOK_POST_EXTRACT): PKG=$(2)
+$$($(2)_HOOK_POST_CONFIGURE): PKG=$(2)
+$$($(2)_HOOK_POST_BUILD): PKG=$(2)
+$$($(2)_HOOK_POST_INSTALL): PKG=$(2)
+
+# define hook targets
+# default hook behaviour: do nothing
+$$($(2)_HOOK_POST_EXTRACT):
+$$($(2)_HOOK_POST_CONFIGURE):
+$$($(2)_HOOK_POST_BUILD):
+$$($(2)_HOOK_POST_INSTALL):
+
+# add package to the general list of targets if requested by the buildroot
+# configuration
+
+ifeq ($$(BR2_PACKAGE_$(2)),y)
+TARGETS += $(1)
+endif
+endef
+
+################################################################################
+# GENTARGETS -- the target generator macro for generic packages
+#
+# Argument 1 is the package directory prefix [mandatory]
+# Argument 2 is the lowercase package name [mandatory]
+# Argument 3 is "target" or "host" [optional, default: "target"]
+################################################################################
+
+define GENTARGETS
+ifeq ($(3),host)
+# In the case of host packages, turn the package name "pkg" into "host-pkg"
+$(call GENTARGETS_INNER,$(3)-$(2),$(call UPPERCASE,$(3)-$(2)),$(call UPPERCASE,$(2)),$(1),host)
+else
+# In the case of target packages, keep the package name "pkg"
+$(call GENTARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(call UPPERCASE,$(2)),$(1),target)
+endif
+endef
+
+# :mode=makefile:
diff --git a/package/atk/atk.mk b/package/atk/atk.mk
index 93b9e9e4e..e357f4992 100644
--- a/package/atk/atk.mk
+++ b/package/atk/atk.mk
@@ -51,52 +51,14 @@ else
ATK_CONF_OPT += --without-x
endif
-ATK_DEPENDENCIES = libglib2 host-pkgconfig
+ATK_DEPENDENCIES = libglib2 host-pkg-config
-$(eval $(call AUTOTARGETS,package,atk))
-
-# atk for the host
-ATK_HOST_DIR:=$(BUILD_DIR)/atk-$(ATK_VERSION)-host
-
-$(DL_DIR)/$(ATK_SOURCE):
- $(call DOWNLOAD,$(ATK_SITE),$(ATK_SOURCE))
+HOST_ATK_DEPENDENCIES = host-libglib2 host-pkg-config
-$(STAMP_DIR)/host_atk_unpacked: $(DL_DIR)/$(ATK_SOURCE)
- mkdir -p $(ATK_HOST_DIR)
- $(INFLATE$(suffix $(ATK_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(ATK_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_atk_configured: $(STAMP_DIR)/host_atk_unpacked $(STAMP_DIR)/host_libglib2_installed $(STAMP_DIR)/host_pkgconfig_installed
- (cd $(ATK_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_ATK_CONF_OPT = \
--enable-shared \
--disable-static \
- --disable-glibtest \
- )
- touch $@
-
-$(STAMP_DIR)/host_atk_compiled: $(STAMP_DIR)/host_atk_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(ATK_HOST_DIR)
- touch $@
+ --disable-glibtest
-$(STAMP_DIR)/host_atk_installed: $(STAMP_DIR)/host_atk_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(ATK_HOST_DIR) install
- touch $@
-
-host-atk: $(STAMP_DIR)/host_atk_installed
-
-host-atk-source: atk-source
-
-host-atk-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_atk_,unpacked configured compiled installed)
- -$(MAKE) -C $(ATK_HOST_DIR) uninstall
- -$(MAKE) -C $(ATK_HOST_DIR) clean
-
-host-atk-dirclean:
- rm -rf $(ATK_HOST_DIR)
+$(eval $(call AUTOTARGETS,package,atk))
+$(eval $(call AUTOTARGETS,package,atk,host))
diff --git a/package/autoconf/autoconf-2.65-fix-m4-detection-test-on-dash.patch b/package/autoconf/autoconf-2.65-fix-m4-detection-test-on-dash.patch
new file mode 100644
index 000000000..35f99b2fd
--- /dev/null
+++ b/package/autoconf/autoconf-2.65-fix-m4-detection-test-on-dash.patch
@@ -0,0 +1,36 @@
+Patch taken upstream at
+http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=7f75858f577f11a844781764f30cd42cfe8a5669,
+with the following modifications:
+
+ * Changes to NEWS file removed to avoid conflicts
+
+ * Changes also made manually to the generated configure
+ script. Otherwise, host-autoconf is needed to compile
+ host-autoconf !
+
+Index: autoconf-2.65.old/configure
+===================================================================
+--- autoconf-2.65.old.orig/configure 2009-12-15 16:11:05.175566911 +0100
++++ autoconf-2.65.old/configure 2009-12-15 16:11:37.739562146 +0100
+@@ -2380,7 +2380,7 @@
+ ac_snippet=change'quote(<,>)in''dir(<if''def>,mac,bug)'
+ ac_snippet=${ac_snippet}pat'subst(a,\(b\)\|\(a\),\1)d'nl
+ test -z "`$ac_path_M4 -F conftest.m4f </dev/null 2>&1`" \
+- && test -z "`echo $ac_snippet | $ac_path_M4 --trace=mac 2>&1`" \
++ && test -z "`$as_echo $ac_snippet | $ac_path_M4 --trace=mac 2>&1`" \
+ && test -f conftest.m4f \
+ && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:
+ rm -f conftest.m4f
+Index: autoconf-2.65.old/m4/m4.m4
+===================================================================
+--- autoconf-2.65.old.orig/m4/m4.m4 2009-12-15 16:11:05.207566124 +0100
++++ autoconf-2.65.old/m4/m4.m4 2009-12-15 16:11:18.595562030 +0100
+@@ -29,7 +29,7 @@
+ ac_snippet=change'quote(<,>)in''dir(<if''def>,mac,bug)'
+ ac_snippet=${ac_snippet}pat'subst(a,\(b\)\|\(a\),\1)d'nl
+ test -z "`$ac_path_M4 -F conftest.m4f </dev/null 2>&1`" \
+- && test -z "`echo $ac_snippet | $ac_path_M4 --trace=mac 2>&1`" \
++ && test -z "`AS_ECHO([$ac_snippet]) | $ac_path_M4 --trace=mac 2>&1`" \
+ && test -f conftest.m4f \
+ && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:
+ rm -f conftest.m4f],
diff --git a/package/autoconf/autoconf.mk b/package/autoconf/autoconf.mk
index 931d551f5..d82c2c5c7 100644
--- a/package/autoconf/autoconf.mk
+++ b/package/autoconf/autoconf.mk
@@ -3,7 +3,7 @@
# autoconf
#
#############################################################
-AUTOCONF_VERSION = 2.64
+AUTOCONF_VERSION = 2.65
AUTOCONF_SOURCE = autoconf-$(AUTOCONF_VERSION).tar.bz2
AUTOCONF_SITE = $(BR2_GNU_MIRROR)/autoconf
@@ -16,53 +16,14 @@ AUTOCONF_CONF_ENV = EMACS="no" ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
AUTOCONF_DEPENDENCIES = microperl host-m4
-$(eval $(call AUTOTARGETS,package,autoconf))
+HOST_AUTOCONF_CONF_ENV = ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
+ ac_cv_prog_gnu_m4_gnu=no
+
+HOST_AUTOCONF_DEPENDENCIES = host-m4 host-libtool
-# autoconf for the host
-AUTOCONF_HOST_DIR:=$(BUILD_DIR)/autoconf-$(AUTOCONF_VERSION)-host
+$(eval $(call AUTOTARGETS,package,autoconf))
+$(eval $(call AUTOTARGETS,package,autoconf,host))
# variables used by other packages
AUTOCONF:=$(HOST_DIR)/usr/bin/autoconf
AUTORECONF=$(HOST_CONFIGURE_OPTS) ACLOCAL="$(ACLOCAL)" $(HOST_DIR)/usr/bin/autoreconf -v -f -i -I "$(ACLOCAL_DIR)"
-
-$(DL_DIR)/$(AUTOCONF_SOURCE):
- $(call DOWNLOAD,$(AUTOCONF_SITE),$(AUTOCONF_SOURCE))
-
-$(STAMP_DIR)/host_autoconf_unpacked: $(DL_DIR)/$(AUTOCONF_SOURCE)
- mkdir -p $(AUTOCONF_HOST_DIR)
- $(INFLATE$(suffix $(AUTOCONF_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(AUTOCONF_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(AUTOCONF_HOST_DIR) package/autoconf/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_autoconf_configured: $(STAMP_DIR)/host_autoconf_unpacked $(STAMP_DIR)/host_m4_installed $(STAMP_DIR)/host_libtool_installed
- (cd $(AUTOCONF_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
- ac_cv_prog_gnu_m4_gnu=no \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --disable-static \
- )
- touch $@
-
-$(STAMP_DIR)/host_autoconf_compiled: $(STAMP_DIR)/host_autoconf_configured
- $(MAKE) -C $(AUTOCONF_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_autoconf_installed: $(STAMP_DIR)/host_autoconf_compiled
- $(MAKE) -C $(AUTOCONF_HOST_DIR) install
- touch $@
-
-host-autoconf: $(STAMP_DIR)/host_autoconf_installed
-
-host-autoconf-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_autoconf_,unpacked configured compiled installed)
- -$(MAKE) -C $(AUTOCONF_HOST_DIR) uninstall
- -$(MAKE) -C $(AUTOCONF_HOST_DIR) clean
-
-host-autoconf-dirclean:
- rm -rf $(AUTOCONF_HOST_DIR)
diff --git a/package/automake/automake.mk b/package/automake/automake.mk
index 82ae9bef3..65db386c5 100644
--- a/package/automake/automake.mk
+++ b/package/automake/automake.mk
@@ -13,53 +13,12 @@ endif
AUTOMAKE_DEPENDENCIES = autoconf microperl
-$(eval $(call AUTOTARGETS,package,automake))
+HOST_AUTOMAKE_DEPENDENCIES = host-autoconf
-# automake for the host
-AUTOMAKE_HOST_DIR:=$(BUILD_DIR)/automake-$(AUTOMAKE_VERSION)-host
+$(eval $(call AUTOTARGETS,package,automake))
+$(eval $(call AUTOTARGETS,package,automake,host))
# variables used by other packages
AUTOMAKE:=$(HOST_DIR)/usr/bin/automake
ACLOCAL_DIR = $(STAGING_DIR)/usr/share/aclocal
ACLOCAL = $(HOST_DIR)/usr/bin/aclocal -I $(ACLOCAL_DIR)
-
-$(DL_DIR)/$(AUTOMAKE_SOURCE):
- $(call DOWNLOAD,$(AUTOMAKE_SITE),$(AUTOMAKE_SOURCE))
-
-$(STAMP_DIR)/host_automake_unpacked: $(DL_DIR)/$(AUTOMAKE_SOURCE)
- mkdir -p $(AUTOMAKE_HOST_DIR)
- $(INFLATE$(suffix $(AUTOMAKE_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(AUTOMAKE_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(AUTOMAKE_HOST_DIR) package/automake/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_automake_configured: $(STAMP_DIR)/host_automake_unpacked $(STAMP_DIR)/host_autoconf_installed
- (cd $(AUTOMAKE_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --disable-static \
- )
- touch $@
-
-$(STAMP_DIR)/host_automake_compiled: $(STAMP_DIR)/host_automake_configured
- $(MAKE) -C $(AUTOMAKE_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_automake_installed: $(STAMP_DIR)/host_automake_compiled
- $(MAKE) -C $(AUTOMAKE_HOST_DIR) install
- mkdir -p $(STAGING_DIR)/usr/share/aclocal
- touch $@
-
-host-automake: $(STAMP_DIR)/host_automake_installed
-
-host-automake-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_automake_,unpacked configured compiled installed)
- -$(MAKE) -C $(AUTOMAKE_HOST_DIR) uninstall
- -$(MAKE) -C $(AUTOMAKE_HOST_DIR) clean
-
-host-automake-dirclean:
- rm -rf $(AUTOMAKE_HOST_DIR)
diff --git a/package/cairo/cairo.mk b/package/cairo/cairo.mk
index e160bf92c..0ca99aa61 100644
--- a/package/cairo/cairo.mk
+++ b/package/cairo/cairo.mk
@@ -36,7 +36,7 @@ CAIRO_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
ac_cv_func_working_mktime=yes jm_cv_func_working_re_compile_pattern=yes \
ac_use_included_regex=no gl_cv_c_restrict=no
-CAIRO_DEPENDENCIES = host-pkgconfig fontconfig pixman
+CAIRO_DEPENDENCIES = host-pkg-config fontconfig pixman
ifeq ($(BR2_PACKAGE_DIRECTFB),y)
CAIRO_CONF_OPT += --enable-directfb
@@ -79,53 +79,15 @@ else
CAIRO_CONF_OPT += --disable-svg
endif
-$(eval $(call AUTOTARGETS,package,cairo))
-
-# cairo for the host
-CAIRO_HOST_DIR:=$(BUILD_DIR)/cairo-$(CAIRO_VERSION)-host
-
-$(DL_DIR)/$(CAIRO_SOURCE):
- $(call DOWNLOAD,$(CAIRO_SITE),$(CAIRO_SOURCE))
+HOST_CAIRO_DEPENDENCIES = host-pkg-config host-pixman host-fontconfig
-$(STAMP_DIR)/host_cairo_unpacked: $(DL_DIR)/$(CAIRO_SOURCE)
- mkdir -p $(CAIRO_HOST_DIR)
- $(INFLATE$(suffix $(CAIRO_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(CAIRO_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_cairo_configured: $(STAMP_DIR)/host_cairo_unpacked $(STAMP_DIR)/host_pkgconfig_installed $(STAMP_DIR)/host_fontconfig_installed $(STAMP_DIR)/host_pixman_installed
- (cd $(CAIRO_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_CAIRO_CONF_OPT = \
--enable-ps \
--enable-pdf \
--enable-xlib \
--with-x \
--disable-png \
- --disable-svg \
- )
- touch $@
-
-$(STAMP_DIR)/host_cairo_compiled: $(STAMP_DIR)/host_cairo_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(CAIRO_HOST_DIR)
- touch $@
+ --disable-svg
-$(STAMP_DIR)/host_cairo_installed: $(STAMP_DIR)/host_cairo_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(CAIRO_HOST_DIR) install
- touch $@
-
-host-cairo: $(STAMP_DIR)/host_cairo_installed
-
-host-cairo-source: cairo-source
-
-host-cairo-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_cairo_,unpacked configured compiled installed)
- -$(MAKE) -C $(CAIRO_HOST_DIR) uninstall
- -$(MAKE) -C $(CAIRO_HOST_DIR) clean
-
-host-cairo-dirclean:
- rm -rf $(CAIRO_HOST_DIR)
+$(eval $(call AUTOTARGETS,package,cairo))
+$(eval $(call AUTOTARGETS,package,cairo,host))
diff --git a/package/dbus-glib/dbus-glib.mk b/package/dbus-glib/dbus-glib.mk
index e9b1bf0ed..302d1b1b8 100644
--- a/package/dbus-glib/dbus-glib.mk
+++ b/package/dbus-glib/dbus-glib.mk
@@ -23,55 +23,19 @@ DBUS_GLIB_CONF_OPT = --localstatedir=/var \
--disable-doxygen-docs \
--enable-asserts=yes
-DBUS_GLIB_DEPENDENCIES = host-pkgconfig dbus host-dbus host-dbus-glib libglib2 expat
+DBUS_GLIB_DEPENDENCIES = host-pkg-config dbus host-dbus host-dbus-glib libglib2 expat
-$(eval $(call AUTOTARGETS,package,dbus-glib))
-
-# dbus-glib for the host
-DBUS_GLIB_HOST_DIR:=$(BUILD_DIR)/dbus-glib-$(DBUS_GLIB_VERSION)-host
-DBUS_GLIB_HOST_BINARY:=$(HOST_DIR)/usr/bin/dbus-binding-tool
+HOST_DBUS_GLIB_DEPENDENCIES = host-dbus host-expat host-libglib2
-$(DL_DIR)/$(DBUS_GLIB_SOURCE):
- $(call DOWNLOAD,$(DBUS_GLIB_SITE),$(DBUS_GLIB_SOURCE))
-
-$(STAMP_DIR)/host_dbusglib_unpacked: $(DL_DIR)/$(DBUS_GLIB_SOURCE)
- mkdir -p $(DBUS_GLIB_HOST_DIR)
- $(INFLATE$(suffix $(DBUS_GLIB_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(DBUS_GLIB_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_dbusglib_configured: $(STAMP_DIR)/host_dbusglib_unpacked $(STAMP_DIR)/host_dbus_installed $(STAMP_DIR)/host_expat_installed $(STAMP_DIR)/host_libglib2_installed
- (cd $(DBUS_GLIB_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_DBUS_GLIB_CONF_OPT = \
--disable-tests \
--disable-xml-docs \
--disable-bash-completion \
--disable-doxygen-docs \
- --enable-asserts=yes \
- )
- touch $@
-
-$(STAMP_DIR)/host_dbusglib_compiled: $(STAMP_DIR)/host_dbusglib_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(DBUS_GLIB_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_dbusglib_installed: $(STAMP_DIR)/host_dbusglib_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(DBUS_GLIB_HOST_DIR) install
- touch $@
-
-host-dbus-glib: $(STAMP_DIR)/host_dbusglib_installed
-
-host-dbus-glib-source: dbus-glib-source
+ --enable-asserts=yes
-host-dbus-glib-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_dbusglib_,unpacked configured compiled installed)
- -$(MAKE) -C $(DBUS_GLIB_HOST_DIR) uninstall
- -$(MAKE) -C $(DBUS_GLIB_HOST_DIR) clean
+$(eval $(call AUTOTARGETS,package,dbus-glib))
+$(eval $(call AUTOTARGETS,package,dbus-glib,host))
-host-dbus-glib-dirclean:
- rm -rf $(DBUS_GLIB_HOST_DIR)
+# dbus-glib for the host
+DBUS_GLIB_HOST_BINARY:=$(HOST_DIR)/usr/bin/dbus-binding-tool
diff --git a/package/dbus/dbus.mk b/package/dbus/dbus.mk
index eb97e767d..63f3caa98 100644
--- a/package/dbus/dbus.mk
+++ b/package/dbus/dbus.mk
@@ -17,7 +17,7 @@ else
DBUS_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install-strip STRIPPROG="$(STRIPCMD)"
endif
-DBUS_DEPENDENCIES = host-pkgconfig
+DBUS_DEPENDENCIES = host-pkg-config
DBUS_CONF_ENV = ac_cv_have_abstract_sockets=yes
DBUS_CONF_OPT = --program-prefix="" \
@@ -49,41 +49,8 @@ else
DBUS_CONF_OPT += --without-x
endif
-$(eval $(call AUTOTARGETS,package,dbus))
-
-# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
-$(DBUS_HOOK_POST_BUILD): $(DBUS_TARGET_BUILD)
- rm -rf $(TARGET_DIR)/var/lib/dbus
- touch $@
-
-$(DBUS_HOOK_POST_INSTALL): $(DBUS_TARGET_INSTALL_TARGET)
- rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
- rm -rf $(TARGET_DIR)/var/lib/dbus
- ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
- $(INSTALL) -m 0755 package/dbus/S30dbus $(TARGET_DIR)/etc/init.d
- touch $@
-
-# dbus for the host
-DBUS_HOST_DIR:=$(BUILD_DIR)/dbus-$(DBUS_VERSION)-host
-DBUS_HOST_INTROSPECT:=$(DBUS_HOST_DIR)/introspect.xml
-
-$(DL_DIR)/$(DBUS_SOURCE):
- $(call DOWNLOAD,$(DBUS_SITE),$(DBUS_SOURCE))
-
-$(STAMP_DIR)/host_dbus_unpacked: $(DL_DIR)/$(DBUS_SOURCE)
- mkdir -p $(DBUS_HOST_DIR)
- $(INFLATE$(suffix $(DBUS_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(DBUS_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_dbus_configured: $(STAMP_DIR)/host_dbus_unpacked $(STAMP_DIR)/host_expat_installed $(STAMP_DIR)/host_pkgconfig_installed
- (cd $(DBUS_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_DBUS_DEPENDENCIES = host-pkg-config host-expat
+HOST_DBUS_CONF_OPT = \
--with-dbus-user=dbus \
--disable-tests \
--disable-asserts \
@@ -94,28 +61,27 @@ $(STAMP_DIR)/host_dbus_configured: $(STAMP_DIR)/host_dbus_unpacked $(STAMP_DIR)/
--disable-static \
--enable-dnotify \
--without-x \
- --with-xml=expat \
- )
- touch $@
+ --with-xml=expat
-$(STAMP_DIR)/host_dbus_compiled: $(STAMP_DIR)/host_dbus_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(DBUS_HOST_DIR)
- touch $@
+# dbus for the host
+DBUS_HOST_INTROSPECT=$(HOST_DBUS_DIR)/introspect.xml
-$(STAMP_DIR)/host_dbus_installed: $(STAMP_DIR)/host_dbus_compiled
- $(MAKE) -C $(DBUS_HOST_DIR) install
+HOST_DBUS_GEN_INTROSPECT = \
$(HOST_DIR)/usr/bin/dbus-daemon --introspect > $(DBUS_HOST_INTROSPECT)
- touch $@
-host-dbus: $(STAMP_DIR)/host_dbus_installed
+HOST_DBUS_POST_INSTALL_HOOKS += HOST_DBUS_GEN_INTROSPECT
-host-dbus-source: dbus-source
+$(eval $(call AUTOTARGETS,package,dbus))
+$(eval $(call AUTOTARGETS,package,dbus,host))
-host-dbus-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_dbus_,unpacked configured compiled installed)
- rm -f $(DBUS_HOST_INTROSPECT)
- -$(MAKE) -C $(DBUS_HOST_DIR) uninstall
- -$(MAKE) -C $(DBUS_HOST_DIR) clean
+# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
+$(DBUS_HOOK_POST_BUILD): $(DBUS_TARGET_BUILD)
+ rm -rf $(TARGET_DIR)/var/lib/dbus
+ touch $@
-host-dbus-dirclean:
- rm -rf $(DBUS_HOST_DIR)
+$(DBUS_HOOK_POST_INSTALL): $(DBUS_TARGET_INSTALL_TARGET)
+ rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
+ rm -rf $(TARGET_DIR)/var/lib/dbus
+ ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
+ $(INSTALL) -m 0755 package/dbus/S30dbus $(TARGET_DIR)/etc/init.d
+ touch $@
diff --git a/package/directfb/directfb.mk b/package/directfb/directfb.mk
index eb492cd3c..57b2e17eb 100644
--- a/package/directfb/directfb.mk
+++ b/package/directfb/directfb.mk
@@ -150,56 +150,23 @@ DIRECTFB_CONF_OPT = \
DIRECTFB_DEPENDENCIES = $(DIRECTFB_DEP) freetype $(DIRECTFB_FUSION)
-$(eval $(call AUTOTARGETS,package,directfb))
-
-
-# directfb-csource for the host
-
-DIRECTFB_HOST_DIR:=$(BUILD_DIR)/directfb-$(DIRECTFB_VERSION)-host
-DIRECTFB_HOST_BINARY:=$(HOST_DIR)/usr/bin/directfb-csource
-
-$(DL_DIR)/$(DIRECTFB_SOURCE):
- $(call DOWNLOAD,$(DIRECTFB_SITE),$(DIRECTFB_SOURCE))
-
-$(STAMP_DIR)/host_directfb_unpacked: $(DL_DIR)/$(DIRECTFB_SOURCE)
- mkdir -p $(DIRECTFB_HOST_DIR)
- $(INFLATE$(suffix $(DIRECTFB_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(DIRECTFB_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_directfb_configured: $(STAMP_DIR)/host_directfb_unpacked $(STAMP_DIR)/host_pkgconfig_installed
- (cd $(DIRECTFB_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_DIRECTFB_DEPENDENCIES = host-pkg-config
+HOST_DIRECTFB_CONF_OPT = \
--enable-shared \
--disable-static \
--disable-debug \
--disable-multi \
--with-gfxdrivers=none \
- --with-inputdrivers=none \
- )
- touch $@
-
-$(STAMP_DIR)/host_directfb_compiled: $(STAMP_DIR)/host_directfb_configured
- $(MAKE) -C $(DIRECTFB_HOST_DIR)/tools directfb-csource
- touch $@
-
-$(STAMP_DIR)/host_directfb_installed: $(STAMP_DIR)/host_directfb_compiled
- $(INSTALL) -m 0755 $(DIRECTFB_HOST_DIR)/tools/directfb-csource $(HOST_DIR)/usr/bin
- touch $@
+ --with-inputdrivers=none
-host-directfb: $(STAMP_DIR)/host_directfb_installed
+HOST_DIRECTFB_BUILD_CMDS = \
+ $(MAKE) -C $(@D)/tools directfb-csource
-host-directfb-source: directfb-source
+HOST_DIRECTFB_INSTALL_CMDS = \
+ $(INSTALL) -m 0755 $(@D)/tools/directfb-csource $(HOST_DIR)/usr/bin
-host-directfb-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_directfb_,unpacked configured compiled installed)
- rm -f $(HOST_DIR)/usr/bin/directfb-csource
- -$(MAKE) -C $(DIRECTFB_HOST_DIR)/tools clean
+$(eval $(call AUTOTARGETS,package,directfb))
+$(eval $(call AUTOTARGETS,package,directfb,host))
-host-directfb-dirclean:
- rm -rf $(DIRECTFB_HOST_DIR)
+# directfb-csource for the host
+DIRECTFB_HOST_BINARY:=$(HOST_DIR)/usr/bin/directfb-csource
diff --git a/package/dnsmasq/dnsmasq.mk b/package/dnsmasq/dnsmasq.mk
index 07b3c484a..6d66d09fd 100644
--- a/package/dnsmasq/dnsmasq.mk
+++ b/package/dnsmasq/dnsmasq.mk
@@ -34,7 +34,7 @@ DNSMASQ_COPTS += -DNO_LARGEFILE
endif
ifeq ($(BR2_PACKAGE_DBUS),y)
-DNSMASQ_DEPENDENCIES += host-pkgconfig dbus
+DNSMASQ_DEPENDENCIES += host-pkg-config dbus
endif
$(eval $(call AUTOTARGETS,package,dnsmasq))
diff --git a/package/docker/docker.mk b/package/docker/docker.mk
index 2dfe0f3e6..8525d6423 100644
--- a/package/docker/docker.mk
+++ b/package/docker/docker.mk
@@ -19,7 +19,7 @@ DOCKER_MAKE_OPT = CC=$(TARGET_CC) CXX=$(TARGET_CXX) LD=$(TARGET_LD) \
DOCKER_INSTALL_TARGET_OPT = PREFIX=$(TARGET_DIR)/usr install
-DOCKER_DEPENDENCIES = host-pkgconfig libglib2 xserver_xorg-server
+DOCKER_DEPENDENCIES = host-pkg-config libglib2 xserver_xorg-server
$(eval $(call AUTOTARGETS,package,docker))
diff --git a/package/editors/vim/vim.mk b/package/editors/vim/vim.mk
index 63f6c12a6..fea7f18d4 100644
--- a/package/editors/vim/vim.mk
+++ b/package/editors/vim/vim.mk
@@ -75,7 +75,7 @@ ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
)
endif
-vim: host-pkgconfig ncurses vim-source $(TARGET_DIR)/usr/bin/vim
+vim: host-pkg-config ncurses vim-source $(TARGET_DIR)/usr/bin/vim
#############################################################
#
diff --git a/package/enchant/enchant.mk b/package/enchant/enchant.mk
index 63cd311c6..9c12231f8 100644
--- a/package/enchant/enchant.mk
+++ b/package/enchant/enchant.mk
@@ -11,6 +11,6 @@ ENCHANT_INSTALL_STAGING = YES
ENCHANT_INSTALL_TARGET = YES
ENCHANT_LIBTOOL_PATCH = NO
-ENCHANT_DEPENDENCIES = libglib2 host-pkgconfig
+ENCHANT_DEPENDENCIES = libglib2 host-pkg-config
$(eval $(call AUTOTARGETS,package,enchant))
diff --git a/package/expat/expat.mk b/package/expat/expat.mk
index e1d5668f2..5b4eb97e2 100644
--- a/package/expat/expat.mk
+++ b/package/expat/expat.mk
@@ -16,53 +16,11 @@ EXPAT_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) installlib
EXPAT_CONF_OPT = --enable-shared
-EXPAT_DEPENDENCIES = host-pkgconfig
+EXPAT_DEPENDENCIES = host-pkg-config
$(eval $(call AUTOTARGETS,package,expat))
+$(eval $(call AUTOTARGETS,package,expat,host))
$(EXPAT_HOOK_POST_INSTALL): $(EXPAT_TARGET_INSTALL_TARGET)
$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libexpat.so.*
touch $@
-
-# expat for the host
-EXPAT_HOST_DIR:=$(BUILD_DIR)/expat-$(EXPAT_VERSION)-host
-
-$(DL_DIR)/$(EXPAT_SOURCE):
- $(call DOWNLOAD,$(EXPAT_SITE),$(EXPAT_SOURCE))
-
-$(STAMP_DIR)/host_expat_unpacked: $(DL_DIR)/$(EXPAT_SOURCE)
- mkdir -p $(EXPAT_HOST_DIR)
- $(INFLATE$(suffix $(EXPAT_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(EXPAT_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_expat_configured: $(STAMP_DIR)/host_expat_unpacked
- (cd $(EXPAT_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- )
- touch $@
-
-$(STAMP_DIR)/host_expat_compiled: $(STAMP_DIR)/host_expat_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(EXPAT_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_expat_installed: $(STAMP_DIR)/host_expat_compiled
- $(MAKE) -C $(EXPAT_HOST_DIR) installlib
- touch $@
-
-host-expat: $(STAMP_DIR)/host_expat_installed
-
-host-expat-source: expat-source
-
-host-expat-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_expat_,unpacked configured compiled installed)
- -$(MAKE) -C $(EXPAT_HOST_DIR) uninstall
- -$(MAKE) -C $(EXPAT_HOST_DIR) clean
-
-host-expat-dirclean:
- rm -rf $(EXPAT_HOST_DIR)
diff --git a/package/fontconfig/fontconfig.mk b/package/fontconfig/fontconfig.mk
index df618d0dc..6cbe2eafe 100644
--- a/package/fontconfig/fontconfig.mk
+++ b/package/fontconfig/fontconfig.mk
@@ -23,49 +23,10 @@ FONTCONFIG_CONF_OPT = --with-arch=$(GNU_TARGET_NAME) \
FONTCONFIG_DEPENDENCIES = freetype expat
-$(eval $(call AUTOTARGETS,package,fontconfig))
-
-# fontconfig for the host
-FONTCONFIG_HOST_DIR:=$(BUILD_DIR)/fontconfig-$(FONTCONFIG_VERSION)-host
-
-$(DL_DIR)/$(FONTCONFIG_SOURCE):
- $(call DOWNLOAD,$(FONTCONFIG_SITE),$(FONTCONFIG_SOURCE))
-
-$(STAMP_DIR)/host_fontconfig_unpacked: $(DL_DIR)/$(FONTCONFIG_SOURCE)
- mkdir -p $(FONTCONFIG_HOST_DIR)
- $(INFLATE$(suffix $(FONTCONFIG_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(FONTCONFIG_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_fontconfig_configured: $(STAMP_DIR)/host_fontconfig_unpacked $(STAMP_DIR)/host_freetype_installed $(STAMP_DIR)/host_expat_installed
- (cd $(FONTCONFIG_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_FONTCONFIG_DEPENDENCIES = host-freetype host-expat
+HOST_FONTCONFIG_CONF_OPT = \
--disable-docs \
- --disable-static \
- )
- touch $@
-
-$(STAMP_DIR)/host_fontconfig_compiled: $(STAMP_DIR)/host_fontconfig_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(FONTCONFIG_HOST_DIR)
- touch $@
+ --disable-static
-$(STAMP_DIR)/host_fontconfig_installed: $(STAMP_DIR)/host_fontconfig_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(FONTCONFIG_HOST_DIR) install
- touch $@
-
-host-fontconfig: $(STAMP_DIR)/host_fontconfig_installed
-
-host-fontconfig-source: fontconfig-source
-
-host-fontconfig-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_fontconfig_,unpacked configured compiled installed)
- -$(MAKE) -C $(FONTCONFIG_HOST_DIR) uninstall
- -$(MAKE) -C $(FONTCONFIG_HOST_DIR) clean
-
-host-fontconfig-dirclean:
- rm -rf $(FONTCONFIG_HOST_DIR)
+$(eval $(call AUTOTARGETS,package,fontconfig))
+$(eval $(call AUTOTARGETS,package,fontconfig,host))
diff --git a/package/freetype/freetype.mk b/package/freetype/freetype.mk
index 7a837aac8..ed73253e4 100644
--- a/package/freetype/freetype.mk
+++ b/package/freetype/freetype.mk
@@ -11,9 +11,12 @@ FREETYPE_INSTALL_STAGING = YES
FREETYPE_INSTALL_TARGET = YES
FREETYPE_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
FREETYPE_MAKE_OPT = CCexe="$(HOSTCC)"
-FREETYPE_DEPENDENCIES = host-pkgconfig $(if $(BR2_PACKAGE_ZLIB),zlib)
+FREETYPE_DEPENDENCIES = host-pkg-config $(if $(BR2_PACKAGE_ZLIB),zlib)
+
+HOST_FREETYPE_DEPENDENCIES = host-pkg-config
$(eval $(call AUTOTARGETS,package,freetype))
+$(eval $(call AUTOTARGETS,package,freetype,host))
$(FREETYPE_HOOK_POST_INSTALL):
$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" \
@@ -26,46 +29,3 @@ ifneq ($(BR2_HAVE_DEVFILES),y)
rm -f $(TARGET_DIR)/usr/bin/freetype-config
endif
touch $@
-
-# freetype for the host
-FREETYPE_HOST_DIR:=$(BUILD_DIR)/freetype-$(FREETYPE_VERSION)-host
-
-$(DL_DIR)/$(FREETYPE_SOURCE):
- $(call DOWNLOAD,$(FREETYPE_SITE),$(FREETYPE_SOURCE))
-
-$(STAMP_DIR)/host_freetype_unpacked: $(DL_DIR)/$(FREETYPE_SOURCE)
- mkdir -p $(FREETYPE_HOST_DIR)
- $(INFLATE$(suffix $(FREETYPE_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(FREETYPE_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_freetype_configured: $(STAMP_DIR)/host_freetype_unpacked $(STAMP_DIR)/host_pkgconfig_installed
- (cd $(FREETYPE_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- )
- touch $@
-
-$(STAMP_DIR)/host_freetype_compiled: $(STAMP_DIR)/host_freetype_configured
- $(MAKE) -C $(FREETYPE_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_freetype_installed: $(STAMP_DIR)/host_freetype_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(FREETYPE_HOST_DIR) install
- touch $@
-
-host-freetype: $(STAMP_DIR)/host_freetype_installed
-
-host-freetype-source: freetype-source
-
-host-freetype-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_freetype_,unpacked configured compiled installed)
- -$(MAKE) -C $(FREETYPE_HOST_DIR) uninstall
- -$(MAKE) -C $(FREETYPE_HOST_DIR) clean
-
-host-freetype-dirclean:
- rm -rf $(FREETYPE_HOST_DIR)
diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk
index a0955c159..dbc1f2cfa 100644
--- a/package/gettext/gettext.mk
+++ b/package/gettext/gettext.mk
@@ -114,7 +114,7 @@ $(STAGING_DIR)/$(GETTEXT_TARGET_BINARY): $(GETTEXT_DIR)/$(GETTEXT_BINARY)
autopoint envsubst gettext.sh gettextize msg* ?gettext)
touch -c $@
-gettext: host-pkgconfig $(if $(BR2_PACKAGE_LIBICONV),libiconv) $(STAGING_DIR)/$(GETTEXT_TARGET_BINARY)
+gettext: host-pkg-config $(if $(BR2_PACKAGE_LIBICONV),libiconv) $(STAGING_DIR)/$(GETTEXT_TARGET_BINARY)
gettext-unpacked: $(GETTEXT_DIR)/.unpacked
diff --git a/package/gob2/gob2.mk b/package/gob2/gob2.mk
index 8679f4a27..cdf7961b1 100644
--- a/package/gob2/gob2.mk
+++ b/package/gob2/gob2.mk
@@ -7,50 +7,12 @@ GOB2_VERSION = 2.0.15
GOB2_SOURCE = gob2-$(GOB2_VERSION).tar.gz
GOB2_SITE = http://ftp.5z.com/pub/gob/
-GOB2_DEPENDENCIES = libglib2 flex bison host-pkgconfig
+GOB2_DEPENDENCIES = libglib2 flex bison host-pkg-config
+
+HOST_GOB2_DEPENDENCIES = host-libglib2
$(eval $(call AUTOTARGETS,package,gob2))
+$(eval $(call AUTOTARGETS,package,gob2,host))
# gob2 for the host
-GOB2_HOST_DIR:=$(BUILD_DIR)/gob2-$(GOB2_VERSION)-host
GOB2_HOST_BINARY:=$(HOST_DIR)/usr/bin/gob2
-
-$(DL_DIR)/$(GOB2_SOURCE):
- $(call DOWNLOAD,$(GOB2_SITE),$(GOB2_SOURCE))
-
-$(STAMP_DIR)/host_gob2_unpacked: $(DL_DIR)/$(GOB2_SOURCE)
- mkdir -p $(GOB2_HOST_DIR)
- $(INFLATE$(suffix $(GOB2_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(GOB2_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_gob2_configured: $(STAMP_DIR)/host_gob2_unpacked $(STAMP_DIR)/host_libglib2_installed
- (cd $(GOB2_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- )
- touch $@
-
-$(STAMP_DIR)/host_gob2_compiled: $(STAMP_DIR)/host_gob2_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(GOB2_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_gob2_installed: $(STAMP_DIR)/host_gob2_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(GOB2_HOST_DIR) install
- touch $@
-
-host-gob2: $(STAMP_DIR)/host_gob2_installed
-
-host-gob2-source: gob2-source
-
-host-gob2-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_gob2_,unpacked configured compiled installed)
- -$(MAKE) -C $(GOB2_HOST_DIR) uninstall
- -$(MAKE) -C $(GOB2_HOST_DIR) clean
-
-host-gob2-dirclean:
- rm -rf $(GOB2_HOST_DIR)
diff --git a/package/gqview/gqview.mk b/package/gqview/gqview.mk
index d5ac86196..1bd76e226 100644
--- a/package/gqview/gqview.mk
+++ b/package/gqview/gqview.mk
@@ -10,7 +10,7 @@ GQVIEW_AUTORECONF = NO
GQVIEW_INSTALL_STAGING = NO
GQVIEW_INSTALL_TARGET = YES
-GQVIEW_DEPENDENCIES = host-pkgconfig libgtk2
+GQVIEW_DEPENDENCIES = host-pkg-config libgtk2
$(eval $(call AUTOTARGETS,package,gqview))
diff --git a/package/gvfs/gvfs.mk b/package/gvfs/gvfs.mk
index f8f81cd1d..cf28862b5 100644
--- a/package/gvfs/gvfs.mk
+++ b/package/gvfs/gvfs.mk
@@ -14,7 +14,7 @@ GVFS_INSTALL_TARGET = YES
GVFS_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
GVFS_AUTORECONF = NO
-GVFS_DEPENDENCIES = host-pkgconfig host-libglib2 libglib2 dbus-glib shared-mime-info
+GVFS_DEPENDENCIES = host-pkg-config host-libglib2 libglib2 dbus-glib shared-mime-info
GVFS_CONF_OPT = \
--disable-gconf \
diff --git a/package/hal/Config.in b/package/hal/Config.in
index 56ed42854..623825cd1 100644
--- a/package/hal/Config.in
+++ b/package/hal/Config.in
@@ -3,6 +3,7 @@ config BR2_PACKAGE_HAL
select BR2_PACKAGE_DBUS
select BR2_PACKAGE_DBUS_GLIB
select BR2_PACKAGE_HWDATA
+ select BR2_PACKAGE_UDEV
select BR2_PACKAGE_UDEV_VOLUME_ID
help
The Hardware Abstraction Layer (HAL) suite.
diff --git a/package/hal/hal-include-fix.patch b/package/hal/hal-include-fix.patch
new file mode 100644
index 000000000..af2a7fe59
--- /dev/null
+++ b/package/hal/hal-include-fix.patch
@@ -0,0 +1,35 @@
+[PATCH] hal: add missing includes
+
+- hald/linux/classdev.c needs sys/socket.h for struct sockaddr
+- hald/linux/addons/addon-storage.c needs limits.h for INT_MAX
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ hald/linux/addons/addon-storage.c | 1 +
+ hald/linux/classdev.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+Index: hal-0.5.8/hald/linux/addons/addon-storage.c
+===================================================================
+--- hal-0.5.8.orig/hald/linux/addons/addon-storage.c
++++ hal-0.5.8/hald/linux/addons/addon-storage.c
+@@ -29,6 +29,7 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
++#include <limits.h>
+ #include <linux/cdrom.h>
+ #include <linux/fs.h>
+ #include <mntent.h>
+Index: hal-0.5.8/hald/linux/classdev.c
+===================================================================
+--- hal-0.5.8.orig/hald/linux/classdev.c
++++ hal-0.5.8/hald/linux/classdev.c
+@@ -31,6 +31,7 @@
+
+ #include <ctype.h>
+ #include <limits.h>
++#include <sys/socket.h>
+ #include <linux/types.h>
+ #include <net/if_arp.h> /* for ARPHRD_... */
+ #include <stdlib.h>
diff --git a/package/hal/hal.mk b/package/hal/hal.mk
index 07ff04656..754ed85b2 100644
--- a/package/hal/hal.mk
+++ b/package/hal/hal.mk
@@ -12,11 +12,11 @@ HAL_BINARY:=hald/hald
HAL_TARGET_BINARY:=usr/sbin/hald
GLIB_CFLAGS:=-I$(STAGING_DIR)/usr/include/glib-2.0 \
- -I$(STAGING_DIR)/lib/glib/include
-GLIB_LIBS:=$(STAGING_DIR)/lib/libglib-2.0.so \
- $(STAGING_DIR)/lib/libgmodule-2.0.so \
- $(STAGING_DIR)/lib/libgobject-2.0.so \
- $(STAGING_DIR)/lib/libgthread-2.0.so
+ -I$(STAGING_DIR)/usr/lib/glib-2.0/include
+GLIB_LIBS:=$(STAGING_DIR)/usr/lib/libglib-2.0.so \
+ $(STAGING_DIR)/usr/lib/libgmodule-2.0.so \
+ $(STAGING_DIR)/usr/lib/libgobject-2.0.so \
+ $(STAGING_DIR)/usr/lib/libgthread-2.0.so
DBUS_GLIB_LIBS:=$(STAGING_DIR)/usr/lib/libdbus-glib-1.so
$(DL_DIR)/$(HAL_SOURCE):
@@ -29,7 +29,7 @@ $(HAL_DIR)/.unpacked: $(DL_DIR)/$(HAL_SOURCE)
toolchain/patch-kernel.sh $(HAL_DIR) package/hal/ \*.patch
touch $(HAL_DIR)/.unpacked
-$(HAL_DIR)/.configured: $(HAL_DIR)/.unpacked /usr/bin/pkg-config
+$(HAL_DIR)/.configured: $(HAL_DIR)/.unpacked
(cd $(HAL_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
@@ -39,7 +39,7 @@ $(HAL_DIR)/.configured: $(HAL_DIR)/.unpacked /usr/bin/pkg-config
DBUS_CFLAGS="-I$(STAGING_DIR)/usr/include/dbus-1.0 -I$(STAGING_DIR)/usr/lib/dbus-1.0/include" \
DBUS_LIBS="$(STAGING_DIR)/usr/lib/libdbus-1.so" \
VOLUME_ID_CFLAGS="$(TARGET_CFLAGS)" \
- VOLUME_ID_LIBS="$(STAGING_DIR)/usr/lib/libvolume_id.so" \
+ VOLUME_ID_LIBS="$(STAGING_DIR)/lib/libvolume_id.so" \
ac_cv_path_LIBUSB_CONFIG= \
./configure $(QUIET) \
--target=$(GNU_TARGET_NAME) \
@@ -49,6 +49,7 @@ $(HAL_DIR)/.configured: $(HAL_DIR)/.unpacked /usr/bin/pkg-config
--sysconfdir=/etc \
--localstatedir=/var \
--with-hwdata=$(TARGET_DIR)/usr/share/hwdata \
+ --with-expat=$(STAGING_DIR)/usr/ \
--disable-policy-kit \
--disable-gtk-doc \
--disable-static \
@@ -87,7 +88,7 @@ $(TARGET_DIR)/$(HAL_TARGET_BINARY): $(HAL_DIR)/hald/hald
done
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libhal*
-hal: host-pkgconfig dbus-glib hwdata udev-volume_id $(TARGET_DIR)/$(HAL_TARGET_BINARY)
+hal: host-pkg-config dbus-glib hwdata udev $(TARGET_DIR)/$(HAL_TARGET_BINARY)
hal-clean:
rm -f $(TARGET_DIR)/etc/dbus-1/system.d/hal.conf
diff --git a/package/hal/hal01-configure-buildroot-cross.patch b/package/hal/hal01-configure-buildroot-cross.patch
deleted file mode 100644
index e97a7757e..000000000
--- a/package/hal/hal01-configure-buildroot-cross.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-diff -ur hal-0.5.8/configure hal-0.5.8-patched/configure
---- hal-0.5.8/configure 2006-11-15 12:34:03.000000000 -0600
-+++ hal-0.5.8-patched/configure 2006-11-15 12:33:36.000000000 -0600
-@@ -22014,7 +22014,7 @@
- echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5
- echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6
- if test $ac_cv_lib_expat_XML_ParserCreate = yes; then
-- EXPAT_LIB="-lexpat"
-+ EXPAT_LIB="\$(STAGING_DIR)/lib/libexpat.so"
- fi
diff --git a/package/i2c-tools/i2c-tools.mk b/package/i2c-tools/i2c-tools.mk
index 5d28e1dfb..d419524fe 100644
--- a/package/i2c-tools/i2c-tools.mk
+++ b/package/i2c-tools/i2c-tools.mk
@@ -6,45 +6,17 @@
I2C_TOOLS_VERSION:=3.0.2
I2C_TOOLS_SOURCE:=i2c-tools-$(I2C_TOOLS_VERSION).tar.bz2
I2C_TOOLS_SITE:=http://dl.lm-sensors.org/i2c-tools/releases/
-I2C_TOOLS_DIR:=$(BUILD_DIR)/i2c-tools-$(I2C_TOOLS_VERSION)
-I2C_TOOLS_BINARY:=tools/i2cdetect
-I2C_TOOLS_TARGET_BINARY:=usr/bin/i2cdetect
-$(DL_DIR)/$(I2C_TOOLS_SOURCE):
- $(call DOWNLOAD,$(I2C_TOOLS_SITE),$(I2C_TOOLS_SOURCE))
+define I2C_TOOLS_BUILD_CMDS
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
-$(I2C_TOOLS_DIR)/.unpacked: $(DL_DIR)/$(I2C_TOOLS_SOURCE)
- $(BZCAT) $(DL_DIR)/$(I2C_TOOLS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(I2C_TOOLS_DIR) package/i2c-tools/ i2c-tools-$(I2C_TOOLS_VERSION)\*.patch
- touch $@
-
-$(I2C_TOOLS_DIR)/$(I2C_TOOLS_BINARY): $(I2C_TOOLS_DIR)/.unpacked
- $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(I2C_TOOLS_DIR)
-
-$(TARGET_DIR)/$(I2C_TOOLS_TARGET_BINARY): $(I2C_TOOLS_DIR)/$(I2C_TOOLS_BINARY)
- $(INSTALL) -m 755 -d $(@D)
+define I2C_TOOLS_INSTALL_TARGET_CMDS
for i in i2cdump i2cget i2cset i2cdetect; \
do \
- $(INSTALL) -m 755 $(<D)/$$i $(@D); \
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(@D)/$$i; \
+ $(INSTALL) -m 755 $(@D)/tools/$$i $(TARGET_DIR)/usr/bin/$$i; \
+ $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/bin/$$i; \
done
+endef
-i2c-tools: $(TARGET_DIR)/$(I2C_TOOLS_TARGET_BINARY)
-
-i2c-tools-source: $(DL_DIR)/$(I2C_TOOLS_SOURCE)
-
-i2c-tools-clean:
- rm -f $(addprefix $(TARGET_DIR)/usr/bin/,i2cdump i2cget i2cset i2cdetect)
- -$(MAKE) -C $(I2C_TOOLS_DIR) clean
-
-i2c-tools-dirclean:
- rm -rf $(I2C_TOOLS_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_I2C_TOOLS),y)
-TARGETS+=i2c-tools
-endif
+$(eval $(call GENTARGETS,package,i2c-tools))
diff --git a/package/java/classpath/classpath.mk b/package/java/classpath/classpath.mk
index c63837b7b..979cc7451 100644
--- a/package/java/classpath/classpath.mk
+++ b/package/java/classpath/classpath.mk
@@ -52,7 +52,7 @@ CLASSPATH_CONF_OPT = \
--disable-gconf-peer --disable-examples --disable-plugin \
--disable-Werror
-CLASSPATH_DEPENDENCIES = host-pkgconfig libpng jpeg
+CLASSPATH_DEPENDENCIES = host-pkg-config libpng jpeg
ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
CLASSPATH_DEPENDENCIES+= alsa-lib
diff --git a/package/java/jamvm/jamvm.mk b/package/java/jamvm/jamvm.mk
index 65ba096c7..c7f7eac99 100644
--- a/package/java/jamvm/jamvm.mk
+++ b/package/java/jamvm/jamvm.mk
@@ -47,7 +47,7 @@ JAMVM_CONF_OPT = \
--disable-debug --with-classpath-install-dir=/usr
-JAMVM_DEPENDENCIES = host-pkgconfig classpath
+JAMVM_DEPENDENCIES = host-pkg-config classpath
#Include X libraries when we have an X server
ifeq ($(BR2_PACKAGE_XORG7),y)
diff --git a/package/libdaemon/libdaemon.mk b/package/libdaemon/libdaemon.mk
index c73dd8d2a..7a9d5c857 100644
--- a/package/libdaemon/libdaemon.mk
+++ b/package/libdaemon/libdaemon.mk
@@ -13,6 +13,6 @@ LIBDAEMON_INSTALL_TARGET:=YES
LIBDAEMON_CONF_ENV:=ac_cv_func_setpgrp_void=no
LIBDAEMON_CONF_OPT:=--disable-lynx
-LIBDAEMON_DEPENDENCIES:=host-pkgconfig
+LIBDAEMON_DEPENDENCIES:=host-pkg-config
$(eval $(call AUTOTARGETS,package,libdaemon))
diff --git a/package/libdrm/libdrm.mk b/package/libdrm/libdrm.mk
index 5be2bc8d0..53284b38a 100644
--- a/package/libdrm/libdrm.mk
+++ b/package/libdrm/libdrm.mk
@@ -61,7 +61,7 @@ $(TARGET_DIR)/usr/lib/libdrm.so: $(STAGING_DIR)/usr/lib/libdrm.so
cp -dpf $(STAGING_DIR)/usr/lib/libdrm.so* $(TARGET_DIR)/usr/lib/
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libdrm.so
-libdrm: host-pkgconfig $(TARGET_DIR)/usr/lib/libdrm.so
+libdrm: host-pkg-config $(TARGET_DIR)/usr/lib/libdrm.so
libdrm-clean:
-$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(LIBDRM_DIR) uninstall
diff --git a/package/libglade/libglade.mk b/package/libglade/libglade.mk
index 786306173..30b752174 100644
--- a/package/libglade/libglade.mk
+++ b/package/libglade/libglade.mk
@@ -7,7 +7,7 @@ LIBGLADE_VERSION = 2.6.3
LIBGLADE_SOURCE = libglade-$(LIBGLADE_VERSION).tar.bz2
LIBGLADE_SITE = http://ftp.gnome.org/pub/GNOME/sources/libglade/2.6/
LIBGLADE_INSTALL_STAGING = YES
-LIBGLADE_DEPENDENCIES = host-pkgconfig libglib2 libgtk2 atk libxml2
+LIBGLADE_DEPENDENCIES = host-pkg-config libglib2 libgtk2 atk libxml2
$(eval $(call AUTOTARGETS,package,libglade))
diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index 2d02b9b56..04e3f2dd9 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -49,7 +49,15 @@ LIBGLIB2_CONF_ENV = \
LIBGLIB2_CONF_OPT = --enable-shared \
--enable-static
-LIBGLIB2_DEPENDENCIES = gettext libintl host-pkgconfig host-libglib2
+HOST_LIBGLIB2_CONF_OPT = \
+ --enable-shared \
+ --disable-static \
+ --disable-gtk-doc \
+ --enable-debug=no \
+
+LIBGLIB2_DEPENDENCIES = gettext libintl host-pkg-config host-libglib2
+
+HOST_LIBGLIB2_DEPENDENCIES = host-pkg-config
ifneq ($(BR2_ENABLE_LOCALE),y)
LIBGLIB2_DEPENDENCIES+=libiconv
@@ -61,51 +69,6 @@ LIBGLIB2_DEPENDENCIES+=libiconv
endif
$(eval $(call AUTOTARGETS,package,libglib2))
+$(eval $(call AUTOTARGETS,package,libglib2,host))
-# libglib2 for the host
-LIBGLIB2_HOST_DIR:=$(BUILD_DIR)/libglib2-$(LIBGLIB2_VERSION)-host
LIBGLIB2_HOST_BINARY:=$(HOST_DIR)/usr/bin/glib-genmarshal
-
-$(DL_DIR)/$(LIBGLIB2_SOURCE):
- $(call DOWNLOAD,$(LIBGLIB2_SITE),$(LIBGLIB2_SOURCE))
-
-$(STAMP_DIR)/host_libglib2_unpacked: $(DL_DIR)/$(LIBGLIB2_SOURCE)
- mkdir -p $(LIBGLIB2_HOST_DIR)
- $(INFLATE$(suffix $(LIBGLIB2_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LIBGLIB2_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_libglib2_configured: $(STAMP_DIR)/host_libglib2_unpacked $(STAMP_DIR)/host_pkgconfig_installed
- (cd $(LIBGLIB2_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --enable-shared \
- --disable-static \
- --disable-gtk-doc \
- --enable-debug=no \
- )
- touch $@
-
-$(STAMP_DIR)/host_libglib2_compiled: $(STAMP_DIR)/host_libglib2_configured
- $(MAKE) -C $(LIBGLIB2_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_libglib2_installed: $(STAMP_DIR)/host_libglib2_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(LIBGLIB2_HOST_DIR) install
- touch $@
-
-host-libglib2: $(STAMP_DIR)/host_libglib2_installed
-
-host-libglib2-source: libglib2-source
-
-host-libglib2-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_libglib2_,unpacked configured compiled installed)
- -$(MAKE) -C $(LIBGLIB2_HOST_DIR) uninstall
- -$(MAKE) -C $(LIBGLIB2_HOST_DIR) clean
-
-host-libglib2-dirclean:
- rm -rf $(LIBGLIB2_HOST_DIR)
diff --git a/package/libgtk2/libgtk2.mk b/package/libgtk2/libgtk2.mk
index 83eab38d3..626b2da3f 100644
--- a/package/libgtk2/libgtk2.mk
+++ b/package/libgtk2/libgtk2.mk
@@ -72,7 +72,7 @@ LIBGTK2_CONF_OPT = --enable-shared \
--enable-explicit-deps=no \
--disable-debug
-LIBGTK2_DEPENDENCIES = host-pkgconfig host-libgtk2 libglib2 cairo pango atk
+LIBGTK2_DEPENDENCIES = host-pkg-config host-libgtk2 libglib2 cairo pango atk
ifeq ($(BR2_PACKAGE_DIRECTFB),y)
LIBGTK2_CONF_OPT += --with-gdktarget=directfb
@@ -119,33 +119,8 @@ else
LIBGTK2_CONF_OPT += --disable-cups
endif
-$(eval $(call AUTOTARGETS,package,libgtk2))
-
-$(LIBGTK2_HOOK_POST_INSTALL):
- $(INSTALL) -m 755 package/libgtk2/S26libgtk2 $(TARGET_DIR)/etc/init.d/
- rm -rf $(TARGET_DIR)/usr/share/gtk-2.0/demo $(TARGET_DIR)/usr/bin/gtk-demo
- touch $@
-
-# libgtk2 for the host
-LIBGTK2_HOST_DIR:=$(BUILD_DIR)/libgtk2-$(LIBGTK2_VERSION)-host
-
-$(DL_DIR)/$(LIBGTK2_SOURCE):
- $(call DOWNLOAD,$(LIBGTK2_SITE),$(LIBGTK2_SOURCE))
-
-$(STAMP_DIR)/host_libgtk2_unpacked: $(DL_DIR)/$(LIBGTK2_SOURCE)
- mkdir -p $(LIBGTK2_HOST_DIR)
- $(INFLATE$(suffix $(LIBGTK2_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LIBGTK2_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_libgtk2_configured: $(STAMP_DIR)/host_libgtk2_unpacked $(STAMP_DIR)/host_cairo_installed $(STAMP_DIR)/host_libglib2_installed $(STAMP_DIR)/host_pango_installed $(STAMP_DIR)/host_atk_installed
- (cd $(LIBGTK2_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_LIBGTK2_DEPENDENCIES = host-cairo host-libglib2 host-pango host-atk
+HOST_LIBGTK2_CONF_OPT = \
--disable-static \
--disable-glibtest \
--without-libtiff \
@@ -153,26 +128,12 @@ $(STAMP_DIR)/host_libgtk2_configured: $(STAMP_DIR)/host_libgtk2_unpacked $(STAMP
--with-x \
--with-gdktarget=x11 \
--disable-cups \
- --disable-debug \
- )
- touch $@
+ --disable-debug
-$(STAMP_DIR)/host_libgtk2_compiled: $(STAMP_DIR)/host_libgtk2_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(LIBGTK2_HOST_DIR)
- touch $@
+$(eval $(call AUTOTARGETS,package,libgtk2))
+$(eval $(call AUTOTARGETS,package,libgtk2,host))
-$(STAMP_DIR)/host_libgtk2_installed: $(STAMP_DIR)/host_libgtk2_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(LIBGTK2_HOST_DIR) install
+$(LIBGTK2_HOOK_POST_INSTALL):
+ $(INSTALL) -m 755 package/libgtk2/S26libgtk2 $(TARGET_DIR)/etc/init.d/
+ rm -rf $(TARGET_DIR)/usr/share/gtk-2.0/demo $(TARGET_DIR)/usr/bin/gtk-demo
touch $@
-
-host-libgtk2: $(STAMP_DIR)/host_libgtk2_installed
-
-host-libgtk2-source: libgtk2-source
-
-host-libgtk2-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_libgtk2_,unpacked configured compiled installed)
- -$(MAKE) -C $(LIBGTK2_HOST_DIR) uninstall
- -$(MAKE) -C $(LIBGTK2_HOST_DIR) clean
-
-host-libgtk2-dirclean:
- rm -rf $(LIBGTK2_HOST_DIR)
diff --git a/package/libidn/libidn.mk b/package/libidn/libidn.mk
index 52f59f23b..6ee1a9698 100644
--- a/package/libidn/libidn.mk
+++ b/package/libidn/libidn.mk
@@ -10,7 +10,7 @@ LIBIDN_INSTALL_STAGING = YES
LIBIDN_INSTALL_TARGET = YES
LIBIDN_CONF_OPT = --enable-shared --disable-java --enable-csharp=no
LIBIDN_LIBTOOL_PATCH = NO
-LIBIDN_DEPENDENCIES = host-pkgconfig gettext $(if $(BR2_PACKAGE_LIBICONV),libiconv)
+LIBIDN_DEPENDENCIES = host-pkg-config gettext $(if $(BR2_PACKAGE_LIBICONV),libiconv)
$(eval $(call AUTOTARGETS,package,libidn))
diff --git a/package/libpng/libpng.mk b/package/libpng/libpng.mk
index 3cb03a6f9..1297c89ee 100644
--- a/package/libpng/libpng.mk
+++ b/package/libpng/libpng.mk
@@ -9,7 +9,7 @@ LIBPNG_SOURCE = libpng-$(LIBPNG_VERSION).tar.bz2
LIBPNG_LIBTOOL_PATCH = NO
LIBPNG_INSTALL_STAGING = YES
LIBPNG_CONF_OPT = --without-libpng-compat
-LIBPNG_DEPENDENCIES = host-pkgconfig zlib
+LIBPNG_DEPENDENCIES = host-pkg-config zlib
$(eval $(call AUTOTARGETS,package,libpng))
diff --git a/package/libsoup/libsoup.mk b/package/libsoup/libsoup.mk
index 64a192cfb..3e9edd3e6 100644
--- a/package/libsoup/libsoup.mk
+++ b/package/libsoup/libsoup.mk
@@ -26,6 +26,6 @@ LIBSOUP_CONF_OPT = \
--without-gnome \
--disable-gtk-doc --without-html-dir
-LIBSOUP_DEPENDENCIES = gettext libintl host-pkgconfig host-libglib2 libglib2 libxml2
+LIBSOUP_DEPENDENCIES = gettext libintl host-pkg-config host-libglib2 libglib2 libxml2
$(eval $(call AUTOTARGETS,package,libsoup))
diff --git a/package/libtool/libtool.mk b/package/libtool/libtool.mk
index 14d0835c2..bbabbb03c 100644
--- a/package/libtool/libtool.mk
+++ b/package/libtool/libtool.mk
@@ -11,54 +11,17 @@ ifeq ($(BR2_ENABLE_DEBUG),y) # install-exec doesn't install aclocal stuff
LIBTOOL_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
endif
-$(eval $(call AUTOTARGETS,package,libtool))
-
-# libtool for the host
-LIBTOOL_HOST_DIR:=$(BUILD_DIR)/libtool-$(LIBTOOL_VERSION)-host
-
-# variables used by other packages
-LIBTOOL:=$(HOST_DIR)/usr/bin/libtool
-
-$(DL_DIR)/$(LIBTOOL_SOURCE):
- $(call DOWNLOAD,$(LIBTOOL_SITE),$(LIBTOOL_SOURCE))
-
-$(STAMP_DIR)/host_libtool_unpacked: $(DL_DIR)/$(LIBTOOL_SOURCE)
- mkdir -p $(LIBTOOL_HOST_DIR)
- $(INFLATE$(suffix $(LIBTOOL_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LIBTOOL_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(LIBTOOL_HOST_DIR) package/libtool/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_libtool_configured: $(STAMP_DIR)/host_libtool_unpacked
- (cd $(LIBTOOL_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --disable-static \
- )
- touch $@
-
-$(STAMP_DIR)/host_libtool_compiled: $(STAMP_DIR)/host_libtool_configured
- $(MAKE) -C $(LIBTOOL_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_libtool_installed: $(STAMP_DIR)/host_libtool_compiled
- $(MAKE) -C $(LIBTOOL_HOST_DIR) install
+define HOST_LIBTOOL_CUSTOM_INSTALL
install -D -m 0644 $(HOST_DIR)/usr/share/aclocal/libtool.m4 \
$(STAGING_DIR)/usr/share/aclocal/libtool.m4
install -D -m 0644 $(HOST_DIR)/usr/share/aclocal/ltdl.m4 \
$(STAGING_DIR)/usr/share/aclocal/ltdl.m4
- touch $@
+endef
-host-libtool: $(STAMP_DIR)/host_libtool_installed
+HOST_LIBTOOL_POST_INSTALL_HOOKS += HOST_LIBTOOL_CUSTOM_INSTALL
-host-libtool-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_libtool_,unpacked configured compiled installed)
- -$(MAKE) -C $(LIBTOOL_HOST_DIR) uninstall
- -$(MAKE) -C $(LIBTOOL_HOST_DIR) clean
+$(eval $(call AUTOTARGETS,package,libtool))
+$(eval $(call AUTOTARGETS,package,libtool,host))
-host-libtool-dirclean:
- rm -rf $(LIBTOOL_HOST_DIR)
+# variables used by other packages
+LIBTOOL:=$(HOST_DIR)/usr/bin/libtool
diff --git a/package/libusb/libusb.mk b/package/libusb/libusb.mk
index e489c9d0e..618d36b27 100644
--- a/package/libusb/libusb.mk
+++ b/package/libusb/libusb.mk
@@ -23,7 +23,7 @@ $(DL_DIR)/$(LIBUSB_SOURCE): $(LIBUSB_PATCH)
libusb-source: $(DL_DIR)/$(LIBUSB_SOURCE) $(LIBUSB_PATCH)
libusb-unpacked: $(LIBUSB_DIR)/.unpacked
-$(LIBUSB_DIR)/.unpacked: $(STAMP_DIR)/host_autoconf_installed $(STAMP_DIR)/host_automake_installed $(STAMP_DIR)/host_libtool_installed $(DL_DIR)/$(LIBUSB_SOURCE)
+$(LIBUSB_DIR)/.unpacked: host-autoconf host-automake host-libtool $(DL_DIR)/$(LIBUSB_SOURCE)
$(LIBUSB_CAT) $(DL_DIR)/$(LIBUSB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
ifneq ($(LIBUSB_PATCH_FILE),)
(cd $(LIBUSB_DIR) && $(LIBUSB_CAT) $(LIBUSB_PATCH) | patch -p1)
@@ -58,7 +58,7 @@ $(TARGET_DIR)/$(LIBUSB_BINARY): $(STAGING_DIR)/usr/lib/libusb.so
cp -dpf $(STAGING_DIR)/usr/lib/libusb*.so* $(TARGET_DIR)/usr/lib/
$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libusb*.so*
-libusb: host-pkgconfig $(TARGET_DIR)/$(LIBUSB_BINARY)
+libusb: host-pkg-config $(TARGET_DIR)/$(LIBUSB_BINARY)
libusb-clean:
rm -f $(STAGING_DIR)/bin/libusb-config
diff --git a/package/libxml2/libxml2.mk b/package/libxml2/libxml2.mk
index ceabcd905..a5542266e 100644
--- a/package/libxml2/libxml2.mk
+++ b/package/libxml2/libxml2.mk
@@ -20,7 +20,14 @@ LIBXML2_CONF_OPT = --with-gnu-ld --enable-shared \
--without-debugging --without-python \
--without-threads
+HOST_LIBXML2_DEPENDENCIES = host-pkg-config
+
+HOST_LIBXML2_CONF_OPT = \
+ --enable-shared --without-debugging --without-python \
+ --without-threads
+
$(eval $(call AUTOTARGETS,package,libxml2))
+$(eval $(call AUTOTARGETS,package,libxml2,host))
$(LIBXML2_HOOK_POST_INSTALL):
$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
@@ -31,47 +38,4 @@ $(LIBXML2_HOOK_POST_INSTALL):
touch $@
# libxml2 for the host
-LIBXML2_HOST_DIR:=$(BUILD_DIR)/libxml2-$(LIBXML2_VERSION)-host
-LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint
-
-$(DL_DIR)/$(LIBXML2_SOURCE):
- $(call DOWNLOAD,$(LIBXML2_SITE),$(LIBXML2_SOURCE))
-
-$(STAMP_DIR)/host_libxml2_unpacked: $(DL_DIR)/$(LIBXML2_SOURCE)
- mkdir -p $(LIBXML2_HOST_DIR)
- $(INFLATE$(suffix $(LIBXML2_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LIBXML2_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_libxml2_configured: $(STAMP_DIR)/host_libxml2_unpacked $(STAMP_DIR)/host_pkgconfig_installed
- (cd $(LIBXML2_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --enable-shared --without-debugging --without-python \
- --without-threads \
- )
- touch $@
-
-$(STAMP_DIR)/host_libxml2_compiled: $(STAMP_DIR)/host_libxml2_configured
- $(MAKE) -C $(LIBXML2_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_libxml2_installed: $(STAMP_DIR)/host_libxml2_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(LIBXML2_HOST_DIR) install
- touch $@
-
-host-libxml2: $(STAMP_DIR)/host_libxml2_installed
-
-host-libxml2-source: libxml2-source
-
-host-libxml2-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_libxml2_,unpacked configured compiled installed)
- -$(MAKE) -C $(LIBXML2_HOST_DIR) uninstall
- -$(MAKE) -C $(LIBXML2_HOST_DIR) clean
-
-host-libxml2-dirclean:
- rm -rf $(LIBXML2_HOST_DIR)
+LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint \ No newline at end of file
diff --git a/package/lzo/lzo.mk b/package/lzo/lzo.mk
index 3c3b832d8..ed300562e 100644
--- a/package/lzo/lzo.mk
+++ b/package/lzo/lzo.mk
@@ -12,45 +12,4 @@ LZO_INSTALL_TARGET = YES
LZO_INSTALL_STAGING_OPT = CC="$(TARGET_CC)" DESTDIR=$(STAGING_DIR) install
$(eval $(call AUTOTARGETS,package,lzo))
-
-# lzo for the host
-LZO_HOST_DIR:=$(BUILD_DIR)/lzo-$(LZO_VERSION)-host
-
-$(DL_DIR)/$(LZO_SOURCE):
- $(call DOWNLOAD,$(LZO_SITE),$(LZO_SOURCE))
-
-$(STAMP_DIR)/host_lzo_unpacked: $(DL_DIR)/$(LZO_SOURCE)
- mkdir -p $(LZO_HOST_DIR)
- $(INFLATE$(suffix $(LZO_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LZO_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(LZO_HOST_DIR) package/lzo/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_lzo_configured: $(STAMP_DIR)/host_lzo_unpacked
- (cd $(LZO_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- )
- touch $@
-
-$(STAMP_DIR)/host_lzo_compiled: $(STAMP_DIR)/host_lzo_configured
- $(MAKE) -C $(LZO_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_lzo_installed: $(STAMP_DIR)/host_lzo_compiled
- $(MAKE) -C $(LZO_HOST_DIR) install
- touch $@
-
-host-lzo: $(STAMP_DIR)/host_lzo_installed
-
-host-lzo-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_lzo_,unpacked configured compiled installed)
- -$(MAKE) -C $(LZO_HOST_DIR) uninstall
- -$(MAKE) -C $(LZO_HOST_DIR) clean
-
-host-lzo-dirclean:
- rm -rf $(LZO_HOST_DIR)
+$(eval $(call AUTOTARGETS,package,lzo,host))
diff --git a/package/m4/m4.mk b/package/m4/m4.mk
index b7721859c..a0b56c42a 100644
--- a/package/m4/m4.mk
+++ b/package/m4/m4.mk
@@ -17,47 +17,7 @@ ifneq ($(BR2_USE_WCHAR),y)
M4_CONF_ENV += gt_cv_c_wchar_t=no gl_cv_absolute_wchar_h=__fpending.h
endif
-$(eval $(call AUTOTARGETS,package,m4))
-
-# m4 for the host
-M4_HOST_DIR:=$(BUILD_DIR)/m4-$(M4_VERSION)-host
-
-$(DL_DIR)/$(M4_SOURCE):
- $(call DOWNLOAD,$(M4_SITE),$(M4_SOURCE))
-
-$(STAMP_DIR)/host_m4_unpacked: $(DL_DIR)/$(M4_SOURCE)
- mkdir -p $(M4_HOST_DIR)
- $(INFLATE$(suffix $(M4_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(M4_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(M4_HOST_DIR) package/m4/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_m4_configured: $(STAMP_DIR)/host_m4_unpacked
- (cd $(M4_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --disable-static \
- )
- touch $@
+HOST_M4_CONF_OPT = --disable-static
-$(STAMP_DIR)/host_m4_compiled: $(STAMP_DIR)/host_m4_configured
- $(MAKE) -C $(M4_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_m4_installed: $(STAMP_DIR)/host_m4_compiled
- $(MAKE) -C $(M4_HOST_DIR) install
- touch $@
-
-host-m4: $(STAMP_DIR)/host_m4_installed
-
-host-m4-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_m4_,unpacked configured compiled installed)
- -$(MAKE) -C $(M4_HOST_DIR) uninstall
- -$(MAKE) -C $(M4_HOST_DIR) clean
-
-host-m4-dirclean:
- rm -rf $(M4_HOST_DIR)
+$(eval $(call AUTOTARGETS,package,m4))
+$(eval $(call AUTOTARGETS,package,m4,host))
diff --git a/package/matchbox/matchbox.mk b/package/matchbox/matchbox.mk
index c8a377748..06e94cda1 100644
--- a/package/matchbox/matchbox.mk
+++ b/package/matchbox/matchbox.mk
@@ -609,7 +609,7 @@ $(TARGET_DIR)/usr/bin/$(MATCHBOX_KB_BIN): $(STAGING_DIR)/usr/bin/$(MATCHBOX_KB_B
cp -af $(STAGING_DIR)/usr/share/matchbox/matchbox-keyboard $(TARGET_DIR)/usr/share/matchbox/
cp -dpf ./package/matchbox/mb-applet-kbd-wrapper.sh $(TARGET_DIR)/usr/bin/
-matchbox: host-pkgconfig expat $(MATCHBOX_WM_DEPS) $(MATCHBOX_SNOTIFY_DEPS) $(MATCHBOX_LIB_DEPS) $(TARGET_DIR)/usr/lib/libmb.so $(TARGET_DIR)/usr/bin/$(MATCHBOX_WM_BIN)
+matchbox: host-pkg-config expat $(MATCHBOX_WM_DEPS) $(MATCHBOX_SNOTIFY_DEPS) $(MATCHBOX_LIB_DEPS) $(TARGET_DIR)/usr/lib/libmb.so $(TARGET_DIR)/usr/bin/$(MATCHBOX_WM_BIN)
matchbox-panel: matchbox $(TARGET_DIR)/usr/bin/$(MATCHBOX_PL_BIN) $(TARGET_DIR)/usr/bin/matchbox-session $(MATCHBOX_PANEL_DEPS)
diff --git a/package/midori/midori.mk b/package/midori/midori.mk
index a82c5b4f1..400b5283a 100644
--- a/package/midori/midori.mk
+++ b/package/midori/midori.mk
@@ -11,6 +11,6 @@ MIDORI_AUTORECONF = YES
MIDORI_INSTALL_STAGING = NO
MIDORI_INSTALL_TARGET = YES
-MIDORI_DEPENDENCIES = host-pkgconfig webkit libsexy xserver_xorg-server
+MIDORI_DEPENDENCIES = host-pkg-config webkit libsexy xserver_xorg-server
$(eval $(call AUTOTARGETS,package,midori))
diff --git a/package/mtd/mtd-utils/mtd.mk b/package/mtd/mtd-utils/mtd.mk
index a68666145..ddae44ea1 100644
--- a/package/mtd/mtd-utils/mtd.mk
+++ b/package/mtd/mtd-utils/mtd.mk
@@ -34,7 +34,7 @@ $(MTD_HOST_DIR)/.unpacked: $(DL_DIR)/$(MTD_SOURCE)
touch $@
-$(MKFS_JFFS2): $(MTD_HOST_DIR)/.unpacked $(STAMP_DIR)/host_lzo_installed
+$(MKFS_JFFS2): $(MTD_HOST_DIR)/.unpacked host-lzo
CC="$(HOSTCC)" CROSS= LDFLAGS=-L$(HOST_DIR)/usr/lib \
$(MAKE) CFLAGS='-I$(HOST_DIR)/usr/include -I./include' \
LINUXDIR=$(LINUX_DIR) BUILDDIR=$(MTD_HOST_DIR) \
diff --git a/package/multimedia/gstreamer/gstreamer.mk b/package/multimedia/gstreamer/gstreamer.mk
index 76afa4414..7f9c73943 100644
--- a/package/multimedia/gstreamer/gstreamer.mk
+++ b/package/multimedia/gstreamer/gstreamer.mk
@@ -24,7 +24,7 @@ GSTREAMER_CONF_OPT = \
--disable-tests \
--disable-failing-tests
-GSTREAMER_DEPENDENCIES = libglib2 host-pkgconfig
+GSTREAMER_DEPENDENCIES = libglib2 host-pkg-config
ifeq ($(BR2_PACKAGE_GSTREAMER_LIBXML2),y)
GSTREAMER_DEPENDENCIES += libxml2
diff --git a/package/multimedia/libmms/libmms.mk b/package/multimedia/libmms/libmms.mk
index 2cf89d575..489bf0de2 100644
--- a/package/multimedia/libmms/libmms.mk
+++ b/package/multimedia/libmms/libmms.mk
@@ -12,6 +12,6 @@ LIBMMS_LIBTOOL_PATCH = NO
LIBMMS_INSTALL_STAGING = YES
LIBMMS_INSTALL_TARGET = YES
-LIBMMS_DEPENDENCIES = host-pkgconfig libglib2
+LIBMMS_DEPENDENCIES = host-pkg-config libglib2
$(eval $(call AUTOTARGETS,package/multimedia,libmms))
diff --git a/package/multimedia/libogg/libogg.mk b/package/multimedia/libogg/libogg.mk
index 1608c383c..02b19766b 100644
--- a/package/multimedia/libogg/libogg.mk
+++ b/package/multimedia/libogg/libogg.mk
@@ -10,6 +10,6 @@ LIBOGG_AUTORECONF = NO
LIBOGG_INSTALL_STAGING = YES
LIBOGG_INSTALL_TARGET = YES
-LIBOGG_DEPENDENCIES = host-pkgconfig
+LIBOGG_DEPENDENCIES = host-pkg-config
$(eval $(call AUTOTARGETS,package/multimedia,libogg))
diff --git a/package/multimedia/libtheora/libtheora.mk b/package/multimedia/libtheora/libtheora.mk
index d6a9b2a9d..81eb83f77 100644
--- a/package/multimedia/libtheora/libtheora.mk
+++ b/package/multimedia/libtheora/libtheora.mk
@@ -14,6 +14,6 @@ LIBTHEORA_CONF_OPT = \
--disable-sdltest \
--disable-examples
-LIBTHEORA_DEPENDENCIES = libogg libvorbis host-pkgconfig
+LIBTHEORA_DEPENDENCIES = libogg libvorbis host-pkg-config
$(eval $(call AUTOTARGETS,package/multimedia,libtheora))
diff --git a/package/multimedia/libvorbis/libvorbis.mk b/package/multimedia/libvorbis/libvorbis.mk
index 3cabd5e32..d8c786981 100644
--- a/package/multimedia/libvorbis/libvorbis.mk
+++ b/package/multimedia/libvorbis/libvorbis.mk
@@ -13,11 +13,10 @@ LIBVORBIS_INSTALL_TARGET = YES
LIBVORBIS_CONF_OPT = --disable-oggtest
-LIBVORBIS_DEPENDENCIES = host-pkgconfig libogg
+LIBVORBIS_DEPENDENCIES = host-pkg-config libogg
$(eval $(call AUTOTARGETS,package/multimedia,libvorbis))
-
############################################################
#
# Toplevel Makefile options
diff --git a/package/multimedia/swfdec/swfdec.mk b/package/multimedia/swfdec/swfdec.mk
index 015d32e37..d55568f56 100644
--- a/package/multimedia/swfdec/swfdec.mk
+++ b/package/multimedia/swfdec/swfdec.mk
@@ -13,7 +13,7 @@ SWFDEC_LIBTOOL_PATCH = NO
SWFDEC_INSTALL_STAGING = YES
SWFDEC_INSTALL_TARGET = YES
-SWFDEC_DEPENDENCIES = liboil alsa-lib pango cairo host-pkgconfig
+SWFDEC_DEPENDENCIES = liboil alsa-lib pango cairo host-pkg-config
ifeq ($(BR2_PACKAGE_SWFDEC_GSTREAMER),y)
SWFDEC_DEPENDENCIES += gstreamer gst-plugins-base
diff --git a/package/neon/neon.mk b/package/neon/neon.mk
index 7f7f391de..1f26a0c96 100644
--- a/package/neon/neon.mk
+++ b/package/neon/neon.mk
@@ -9,7 +9,7 @@ NEON_INSTALL_STAGING:=YES
NEON_INSTALL_TARGET_OPT:=DESTDIR=$(TARGET_DIR) install
NEON_CONF_OPT:=--enable-shared --without-gssapi --disable-rpath
-NEON_DEPENDENCIES:=host-pkgconfig
+NEON_DEPENDENCIES:=host-pkg-config
ifeq ($(BR2_PACKAGE_NEON_LIBXML2),y)
NEON_CONF_OPT+=--with-libxml2=yes
diff --git a/package/olsr/olsr.mk b/package/olsr/olsr.mk
index 91076539a..75d5d66ab 100644
--- a/package/olsr/olsr.mk
+++ b/package/olsr/olsr.mk
@@ -9,55 +9,33 @@ OLSR_VERSION_MINOR=6
OLSR_VERSION:=$(OLSR_VERSION_MAJOR).$(OLSR_VERSION_MINOR)
OLSR_SOURCE:=olsrd-$(OLSR_VERSION).tar.bz2
OLSR_SITE:=http://www.olsr.org/releases/$(OLSR_VERSION_MAJOR)
-OLSR_DIR:=$(BUILD_DIR)/olsrd-$(OLSR_VERSION)
-OLSR_CAT:=$(BZCAT)
OLSR_BINARY:=olsrd
OLSR_TARGET_BINARY:=usr/sbin/olsrd
#OLSR_PLUGINS=httpinfo tas dot_draw nameservice dyn_gw dyn_gw_plain pgraph bmf quagga secure
OLSR_PLUGINS=dot_draw dyn_gw secure
OLSR_TARGET_PLUGIN=usr/lib/
-$(DL_DIR)/$(OLSR_SOURCE):
- $(call DOWNLOAD,$(OLSR_SITE),$(OLSR_SOURCE))
-
-olsr-source: $(DL_DIR)/$(OLSR_SOURCE)
-
-olsr-unpacked: $(OLSR_DIR)/.unpacked
-$(OLSR_DIR)/.unpacked: $(DL_DIR)/$(OLSR_SOURCE)
- $(OLSR_CAT) $(DL_DIR)/$(OLSR_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(OLSR_DIR)/$(OLSR_BINARY): $(OLSR_DIR)/.unpacked
- $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(OLSR_DIR) olsrd $(OLSR_PLUGINS)
-
-$(TARGET_DIR)/$(OLSR_TARGET_BINARY): $(OLSR_DIR)/$(OLSR_BINARY)
- rm -f $(TARGET_DIR)/$(OLSR_TARGET_BINARY)
- cp -dpf $(OLSR_DIR)/$(OLSR_BINARY) $(TARGET_DIR)/$(OLSR_TARGET_BINARY)
- cp -R $(OLSR_DIR)/lib/*/olsrd_*.so* $(TARGET_DIR)/$(OLSR_TARGET_PLUGIN)
- mkdir -p $(TARGET_DIR)/etc/init.d
- cp -dpf package/olsr/S50olsr $(TARGET_DIR)/etc/init.d/
- test -r $(TARGET_DIR)/etc/olsrd.conf || \
- cp -dpf $(OLSR_DIR)/files/olsrd.conf.default.lq $(TARGET_DIR)/etc/olsrd.conf
- -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(OLSR_TARGET_PLUGIN)/olsrd_*.so*
- $(STRIPCMD) $(STRIP_STRIP_ALL) $@
-
-olsr: $(TARGET_DIR)/$(OLSR_TARGET_BINARY)
-
-olsr-clean:
+define OLSR_BUILD_CMDS
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) olsrd $(OLSR_PLUGINS)
+endef
+
+define OLSR_INSTALL_TARGET_CMDS
+ cp -dpf $(@D)/$(OLSR_BINARY) $(TARGET_DIR)/$(OLSR_TARGET_BINARY)
+ cp -R $(@D)/lib/*/olsrd_*.so* $(TARGET_DIR)/$(OLSR_TARGET_PLUGIN)
+ mkdir -p $(TARGET_DIR)/etc/init.d
+ cp -dpf package/olsr/S50olsr $(TARGET_DIR)/etc/init.d/
+ test -r $(TARGET_DIR)/etc/olsrd.conf || \
+ cp -dpf $(@D)/files/olsrd.conf.default.lq $(TARGET_DIR)/etc/olsrd.conf
+ -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(OLSR_TARGET_PLUGIN)/olsrd_*.so*
+ $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/$(OLSR_TARGET_BINARY)
+endef
+
+define OLSR_CLEAN_CMDS
rm -f $(TARGET_DIR)/$(OLSR_TARGET_BINARY) \
$(TARGET_DIR)/$(OLSR_TARGET_PLUGIN)/olsrd_*.so* \
$(TARGET_DIR)/etc/init.d/S50olsr \
$(TARGET_DIR)/etc/olsrd.conf
- -$(MAKE) -C $(OLSR_DIR) clean
+ -$(MAKE) -C $(@D) clean
+endef
-olsr-dirclean:
- rm -rf $(OLSR_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_OLSR),y)
-TARGETS+=olsr $(OLSR_PLUGINS)
-endif
+$(eval $(call GENTARGETS,package,olsr))
diff --git a/package/pango/pango.mk b/package/pango/pango.mk
index f7bf0aa02..38e163e04 100644
--- a/package/pango/pango.mk
+++ b/package/pango/pango.mk
@@ -40,7 +40,16 @@ PANGO_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
PANGO_CONF_OPT = --enable-shared --enable-static \
--enable-explicit-deps=no --disable-debug
-PANGO_DEPENDENCIES = gettext libintl host-pkgconfig host-pango libglib2 cairo
+HOST_PANGO_CONF_OPT = \
+ --disable-static \
+ $(if $(BR2_PACKAGE_XORG7),--with-x,--without-x) \
+ --disable-debug \
+
+PANGO_DEPENDENCIES = gettext libintl host-pkg-config host-pango libglib2 cairo
+
+HOST_PANGO_DEPENDENCIES = host-pkg-config host-cairo host-libglib2 host-autoconf host-automake
+
+HOST_PANGO_AUTORECONF = YES
ifeq ($(BR2_PACKAGE_XORG7),y)
PANGO_CONF_OPT += --with-x \
@@ -52,6 +61,7 @@ else
endif
$(eval $(call AUTOTARGETS,package,pango))
+$(eval $(call AUTOTARGETS,package,pango,host))
$(PANGO_HOOK_POST_INSTALL):
mkdir -p $(TARGET_DIR)/etc/pango
@@ -59,50 +69,4 @@ $(PANGO_HOOK_POST_INSTALL):
$(SED) 's~$(HOST_DIR)~~g' $(TARGET_DIR)/etc/pango/pango.modules
touch $@
-# pango for the host
-PANGO_HOST_DIR:=$(BUILD_DIR)/pango-$(PANGO_VERSION)-host
PANGO_HOST_BINARY:=$(HOST_DIR)/usr/bin/pango-querymodules
-
-$(DL_DIR)/$(PANGO_SOURCE):
- $(call DOWNLOAD,$(PANGO_SITE),$(PANGO_SOURCE))
-
-$(STAMP_DIR)/host_pango_unpacked: $(DL_DIR)/$(PANGO_SOURCE)
- mkdir -p $(PANGO_HOST_DIR)
- $(INFLATE$(suffix $(PANGO_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(PANGO_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(PANGO_HOST_DIR) package/pango/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_pango_configured: $(STAMP_DIR)/host_pango_unpacked $(STAMP_DIR)/host_cairo_installed $(STAMP_DIR)/host_libglib2_installed $(STAMP_DIR)/host_autoconf_installed $(STAMP_DIR)/host_automake_installed
- (cd $(PANGO_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --disable-static \
- $(if $(BR2_PACKAGE_XORG7),--with-x,--without-x) \
- --disable-debug \
- )
- touch $@
-
-$(STAMP_DIR)/host_pango_compiled: $(STAMP_DIR)/host_pango_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(PANGO_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_pango_installed: $(STAMP_DIR)/host_pango_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(PANGO_HOST_DIR) install
- touch $@
-
-host-pango: $(STAMP_DIR)/host_pango_installed
-
-host-pango-source: pango-source
-
-host-pango-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_pango_,unpacked configured compiled installed)
- -$(MAKE) -C $(PANGO_HOST_DIR) uninstall
- -$(MAKE) -C $(PANGO_HOST_DIR) clean
-
-host-pango-dirclean:
- rm -rf $(PANGO_HOST_DIR)
diff --git a/package/pcmanfm/pcmanfm.mk b/package/pcmanfm/pcmanfm.mk
index 3a300ca2c..370cf801a 100644
--- a/package/pcmanfm/pcmanfm.mk
+++ b/package/pcmanfm/pcmanfm.mk
@@ -12,7 +12,7 @@ PCMANFM_INSTALL_TARGET = YES
PCMANFM_CONF_OPT = --disable-hal
-PCMANFM_DEPENDENCIES = host-pkgconfig libgtk2 gamin startup-notification xserver_xorg-server
+PCMANFM_DEPENDENCIES = host-pkg-config libgtk2 gamin startup-notification xserver_xorg-server
$(eval $(call AUTOTARGETS,package,pcmanfm))
diff --git a/package/pixman/pixman.mk b/package/pixman/pixman.mk
index 3a76c9674..9507bbfe1 100644
--- a/package/pixman/pixman.mk
+++ b/package/pixman/pixman.mk
@@ -10,46 +10,4 @@ PIXMAN_AUTORECONF = NO
PIXMAN_INSTALL_STAGING = YES
$(eval $(call AUTOTARGETS,package,pixman))
-
-# pixman for the host
-PIXMAN_HOST_DIR:=$(BUILD_DIR)/pixman-$(PIXMAN_VERSION)-host
-
-$(DL_DIR)/$(PIXMAN_SOURCE):
- $(call DOWNLOAD,$(PIXMAN_SITE),$(PIXMAN_SOURCE))
-
-$(STAMP_DIR)/host_pixman_unpacked: $(DL_DIR)/$(PIXMAN_SOURCE)
- mkdir -p $(PIXMAN_HOST_DIR)
- $(INFLATE$(suffix $(PIXMAN_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(PIXMAN_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_pixman_configured: $(STAMP_DIR)/host_pixman_unpacked
- (cd $(PIXMAN_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- )
- touch $@
-
-$(STAMP_DIR)/host_pixman_compiled: $(STAMP_DIR)/host_pixman_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(PIXMAN_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_pixman_installed: $(STAMP_DIR)/host_pixman_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(PIXMAN_HOST_DIR) install
- touch $@
-
-host-pixman: $(STAMP_DIR)/host_pixman_installed
-
-host-pixman-source: pixman-source
-
-host-pixman-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_pixman_,unpacked configured compiled installed)
- -$(MAKE) -C $(PIXMAN_HOST_DIR) uninstall
- -$(MAKE) -C $(PIXMAN_HOST_DIR) clean
-
-host-pixman-dirclean:
- rm -rf $(PIXMAN_HOST_DIR)
+$(eval $(call AUTOTARGETS,package,pixman,host))
diff --git a/package/pkg-config/pkg-config.mk b/package/pkg-config/pkg-config.mk
index e32854488..7caf37b38 100644
--- a/package/pkg-config/pkg-config.mk
+++ b/package/pkg-config/pkg-config.mk
@@ -15,51 +15,18 @@ PKG_CONFIG_DEPENDENCIES = libglib2
PKG_CONFIG_CONF_OPT = --with-installed-glib
-$(eval $(call AUTOTARGETS,package,pkg-config))
-
-# pkg-config for the host
-PKG_CONFIG_HOST_DIR:=$(BUILD_DIR)/pkg-config-$(PKG_CONFIG_VERSION)-host
-PKG_CONFIG_HOST_BINARY:=$(HOST_DIR)/usr/bin/pkg-config
-
-$(DL_DIR)/$(PKG_CONFIG_SOURCE):
- $(call DOWNLOAD,$(PKG_CONFIG_SITE),$(PKG_CONFIG_SOURCE))
-
-$(STAMP_DIR)/host_pkgconfig_unpacked: $(DL_DIR)/$(PKG_CONFIG_SOURCE)
- mkdir -p $(PKG_CONFIG_HOST_DIR)
- $(INFLATE$(suffix $(PKG_CONFIG_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(PKG_CONFIG_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(PKG_CONFIG_HOST_DIR) package/pkg-config/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_pkgconfig_configured: $(STAMP_DIR)/host_pkgconfig_unpacked
- (cd $(PKG_CONFIG_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
+HOST_PKG_CONFIG_CONF_OPT = \
--with-pc-path="$(STAGING_DIR)/usr/lib/pkgconfig" \
- --disable-static \
- )
- touch $@
-
-$(STAMP_DIR)/host_pkgconfig_compiled: $(STAMP_DIR)/host_pkgconfig_configured
- $(MAKE) -C $(PKG_CONFIG_HOST_DIR)
- touch $@
+ --disable-static
-$(STAMP_DIR)/host_pkgconfig_installed: $(STAMP_DIR)/host_pkgconfig_compiled
- $(MAKE) -C $(PKG_CONFIG_HOST_DIR) install
- install -D -m 0644 $(HOST_DIR)/usr/share/aclocal/pkg.m4 \
+define HOST_PKG_CONFIG_INSTALL_M4
+install -D -m 0644 $(HOST_DIR)/usr/share/aclocal/pkg.m4 \
$(STAGING_DIR)/usr/share/aclocal/pkg.m4
- touch $@
+endef
-host-pkgconfig: $(STAMP_DIR)/host_pkgconfig_installed
+HOST_PKG_CONFIG_POST_INSTALL_HOOKS += HOST_PKG_CONFIG_INSTALL_M4
-host-pkgconfig-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_pkgconfig_,unpacked configured compiled installed)
- -$(MAKE) -C $(PKG_CONFIG_HOST_DIR) uninstall
- -$(MAKE) -C $(PKG_CONFIG_HOST_DIR) clean
+$(eval $(call AUTOTARGETS,package,pkg-config))
+$(eval $(call AUTOTARGETS,package,pkg-config,host))
-host-pkgconfig-dirclean:
- rm -rf $(PKG_CONFIG_HOST_DIR)
+PKG_CONFIG_HOST_BINARY:=$(HOST_DIR)/usr/bin/pkg-config
diff --git a/package/shared-mime-info/shared-mime-info.mk b/package/shared-mime-info/shared-mime-info.mk
index 48895e056..cfd3521b0 100644
--- a/package/shared-mime-info/shared-mime-info.mk
+++ b/package/shared-mime-info/shared-mime-info.mk
@@ -12,61 +12,23 @@ SHARED_MIME_INFO_INSTALL_TARGET = NO
SHARED_MIME_INFO_AUTORECONF = NO
SHARED_MIME_INFO_CONF_ENV = XMLLINT=$(HOST_DIR)/usr/bin/xmllint
-SHARED_MIME_INFO_DEPENDENCIES = host-pkgconfig host-libglib2 host-libxml2 libxml2 libglib2
+SHARED_MIME_INFO_DEPENDENCIES = host-pkg-config host-libglib2 host-libxml2 libxml2 libglib2
SHARED_MIME_INFO_CONF_OPT = --disable-update-mimedb
-$(eval $(call AUTOTARGETS,package,shared-mime-info))
+HOST_SHARED_MIME_INFO_DEPENDENCIES = host-pkg-config
+
+HOST_SHARED_MIME_INFO_CONF_OPT = \
+ --disable-update-mimedb
+$(eval $(call AUTOTARGETS,package,shared-mime-info))
+$(eval $(call AUTOTARGETS,package,shared-mime-info,host))
# shared-mime-info for the host
-SHARED_MIME_INFO_HOST_DIR:=$(BUILD_DIR)/shared-mime-info-$(SHARED_MIME_INFO_VERSION)-host
SHARED_MIME_INFO_HOST_BINARY:=$(HOST_DIR)/usr/bin/update-mime-database
-$(DL_DIR)/$(SHARED_MIME_INFO_SOURCE):
- $(call DOWNLOAD,$(SHARED_MIME_INFO_SITE),$(SHARED_MIME_INFO_SOURCE))
-
-$(STAMP_DIR)/host_shared-mime-info_unpacked: $(DL_DIR)/$(SHARED_MIME_INFO_SOURCE)
- mkdir -p $(SHARED_MIME_INFO_HOST_DIR)
- $(INFLATE$(suffix $(SHARED_MIME_INFO_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(SHARED_MIME_INFO_HOST_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(SHARED_MIME_INFO_HOST_DIR) package/shared-mime-info/ \*.patch
- touch $@
-
-$(STAMP_DIR)/host_shared-mime-info_configured: $(STAMP_DIR)/host_shared-mime-info_unpacked $(STAMP_DIR)/host_pkgconfig_installed
- (cd $(SHARED_MIME_INFO_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- --disable-update-mimedb \
- )
- touch $@
-
-$(STAMP_DIR)/host_shared-mime-info_compiled: $(STAMP_DIR)/host_shared-mime-info_configured
- $(MAKE) -C $(SHARED_MIME_INFO_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_shared-mime-info_installed: $(STAMP_DIR)/host_shared-mime-info_compiled
- $(HOST_MAKE_ENV) $(MAKE) -C $(SHARED_MIME_INFO_HOST_DIR) install
- touch $@
-
-host-shared-mime-info: $(STAMP_DIR)/host_shared-mime-info_installed
-
-host-shared-mime-info-source: shared-mime-info-source
-
-host-shared-mime-info-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_shared-mime-info_,unpacked configured compiled installed)
- -$(MAKE) -C $(SHARED_MIME_INFO_HOST_DIR) uninstall
- -$(MAKE) -C $(SHARED_MIME_INFO_HOST_DIR) clean
-
-host-shared-mime-info-dirclean:
- rm -rf $(SHARED_MIME_INFO_HOST_DIR)
-
# update the shared-mime-info database in the target
-$(SHARED_MIME_INFO_HOOK_POST_INSTALL): $(STAMP_DIR)/host_shared-mime-info_installed
+$(SHARED_MIME_INFO_HOOK_POST_INSTALL): host-shared-mime-info
$(SHARED_MIME_INFO_HOST_BINARY) $(STAGING_DIR)/usr/share/mime
$(INSTALL) -D $(STAGING_DIR)/usr/share/mime/mime.cache $(TARGET_DIR)/usr/share/mime/mime.cache
touch $@
diff --git a/package/sylpheed/sylpheed.mk b/package/sylpheed/sylpheed.mk
index 19985237d..96eca9c36 100644
--- a/package/sylpheed/sylpheed.mk
+++ b/package/sylpheed/sylpheed.mk
@@ -13,7 +13,7 @@ SYLPHEED_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
SYLPHEED_CONF_OPT = --disable-gtkspell --program-prefix=""
-SYLPHEED_DEPENDENCIES = host-pkgconfig
+SYLPHEED_DEPENDENCIES = host-pkg-config
$(eval $(call AUTOTARGETS,package,sylpheed))
diff --git a/package/tiff/tiff.mk b/package/tiff/tiff.mk
index 9ec06a8ee..8db215ee5 100644
--- a/package/tiff/tiff.mk
+++ b/package/tiff/tiff.mk
@@ -15,7 +15,7 @@ TIFF_CONF_OPT = \
--disable-cxx \
--without-x \
-TIFF_DEPENDENCIES = host-pkgconfig zlib jpeg
+TIFF_DEPENDENCIES = host-pkg-config zlib jpeg
$(eval $(call AUTOTARGETS,package,tiff))
diff --git a/package/udev/udev.mk b/package/udev/udev.mk
index ace9ae4f2..ccefae04f 100644
--- a/package/udev/udev.mk
+++ b/package/udev/udev.mk
@@ -10,10 +10,7 @@ UDEV_VOLUME_ID_REVISION:=0
UDEV_VOLUME_ID_VERSION:=$(UDEV_VOLUME_ID_CURRENT).$(UDEV_VOLUME_ID_AGE).$(UDEV_VOLUME_ID_REVISION)
UDEV_SOURCE:=udev-$(UDEV_VERSION).tar.bz2
UDEV_SITE:=$(BR2_KERNEL_MIRROR)/linux/utils/kernel/hotplug/
-UDEV_CAT:=$(BZCAT)
-UDEV_DIR:=$(BUILD_DIR)/udev-$(UDEV_VERSION)
-UDEV_TARGET_BINARY:=sbin/udevd
-UDEV_BINARY:=udevd
+UDEV_INSTALL_STAGING=YES
# 094 had _GNU_SOURCE set
BR2_UDEV_CFLAGS:= -D_GNU_SOURCE $(TARGET_CFLAGS)
@@ -24,205 +21,113 @@ endif
# UDEV_ROOT is /dev so we can replace devfs, not /udev for experiments
UDEV_ROOT:=/dev
-$(DL_DIR)/$(UDEV_SOURCE):
- $(call DOWNLOAD,$(UDEV_SITE),$(UDEV_SOURCE))
-
-$(UDEV_DIR)/.unpacked: $(DL_DIR)/$(UDEV_SOURCE)
- $(UDEV_CAT) $(DL_DIR)/$(UDEV_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(UDEV_DIR) package/udev \*.patch
- touch $@
-
-$(UDEV_DIR)/$(UDEV_BINARY): $(UDEV_DIR)/.unpacked
- $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) CC=$(TARGET_CC) LD=$(TARGET_CC)\
- CFLAGS="$(BR2_UDEV_CFLAGS)" \
- USE_LOG=false USE_SELINUX=false \
- udevdir=$(UDEV_ROOT) -C $(UDEV_DIR)
- touch -c $@
-
-$(TARGET_DIR)/$(UDEV_TARGET_BINARY): $(UDEV_DIR)/$(UDEV_BINARY)
- mkdir -p $(TARGET_DIR)/sys
- $(MAKE) $(TARGET_CONFIGURE_OPTS) \
- DESTDIR=$(TARGET_DIR) \
- CFLAGS="$(BR2_UDEV_CFLAGS)" \
- LDFLAGS="-warn-common" \
- USE_LOG=false USE_SELINUX=false \
- udevdir=$(UDEV_ROOT) -C $(UDEV_DIR) install
- $(INSTALL) -m 0755 package/udev/S10udev $(TARGET_DIR)/etc/init.d
- $(INSTALL) -m 0644 $(UDEV_DIR)/etc/udev/frugalware/* $(TARGET_DIR)/etc/udev/rules.d
- ( grep udev_root $(TARGET_DIR)/etc/udev/udev.conf > /dev/null 2>&1 || echo 'udev_root=/dev' >> $(TARGET_DIR)/etc/udev/udev.conf )
- install -m 0755 -D $(UDEV_DIR)/udevstart $(TARGET_DIR)/sbin/udevstart
- rm -rf $(TARGET_DIR)/usr/share/man
-ifneq ($(BR2_PACKAGE_UDEV_UTILS),y)
- rm -f $(TARGET_DIR)/usr/sbin/udevmonitor
- rm -f $(TARGET_DIR)/usr/bin/udevinfo
- rm -f $(TARGET_DIR)/usr/bin/udevtest
-endif
-
-#####################################################################
-.PHONY: udev-source udev udev-clean udev-dirclean
-
-udev: $(TARGET_DIR)/$(UDEV_TARGET_BINARY)
-
-udev-source: $(DL_DIR)/$(UDEV_SOURCE)
-
-udev-clean: $(UDEV_CLEAN_DEPS)
- rm -f $(TARGET_DIR)/etc/init.d/S10udev $(TARGET_DIR)/sbin/udev*
- rm -f $(TARGET_DIR)/usr/sbin/udevmonitor $(TARGET_DIR)/usr/bin/udev*
- rm -fr $(TARGET_DIR)/sys
- -$(MAKE) -C $(UDEV_DIR) clean
-
-
-udev-dirclean: $(UDEV_DIRCLEAN_DEPS)
- rm -rf $(UDEV_DIR)
-
-#####################################################################
+UDEV_EXTRAS=
ifeq ($(BR2_PACKAGE_UDEV_VOLUME_ID),y)
-.PHONY: udev-volume_id udev-volume_id-clean udev-volume_id-dirclean
-
-$(STAGING_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION):
- $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
- CFLAGS="$(BR2_UDEV_CFLAGS)" \
- USE_LOG=false USE_SELINUX=false \
- udevdir=$(UDEV_ROOT) EXTRAS="extras/volume_id" -C $(UDEV_DIR)
- $(INSTALL) -m 0644 -D $(UDEV_DIR)/extras/volume_id/lib/libvolume_id.h $(STAGING_DIR)/usr/include/libvolume_id.h
- $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/volume_id/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $@
- -ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/usr/lib/libvolume_id.so.0
- -ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/usr/lib/libvolume_id.so
-
-$(STAGING_DIR)/usr/lib/libvolume_id.la: $(STAGING_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
- $(INSTALL) -m 0755 -D package/udev/libvolume_id.la.tmpl $@
- $(SED) 's/REPLACE_CURRENT/$(UDEV_VOLUME_ID_CURRENT)/g' $@
- $(SED) 's/REPLACE_AGE/$(UDEV_VOLUME_ID_AGE)/g' $@
- $(SED) 's/REPLACE_REVISION/$(UDEV_VOLUME_ID_REVISION)/g' $@
- $(SED) 's,REPLACE_LIB_DIR,$(STAGING_DIR)/usr/lib,g' $@
-
-$(TARGET_DIR)/lib/udev/vol_id: $(STAGING_DIR)/usr/lib/libvolume_id.la
- $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/volume_id/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(TARGET_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
- -ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(TARGET_DIR)/usr/lib/libvolume_id.so.0
- -ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(TARGET_DIR)/usr/lib/libvolume_id.so
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
- $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/volume_id/vol_id $@
-
-udev-volume_id: udev $(TARGET_DIR)/lib/udev/vol_id
-
-udev-volume_id-clean:
- rm -f $(STAGING_DIR)/usr/include/libvolume_id.h
- rm -f $(STAGING_DIR)/usr/lib/libvolume_id.so*
- rm -f $(STAGING_DIR)/usr/lib/libvolume_id.la
- rm -f $(TARGET_DIR)/usr/lib/libvolume_id.so.0*
- rm -f $(TARGET_DIR)/lib/udev/vol_id
- rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
-
-udev-volume_id-dirclean:
- -$(MAKE) EXTRAS="extras/volume_id" -C $(UDEV_DIR) clean
-
-UDEV_CLEAN_DEPS+=udev-volume_id-clean
-UDEV_DIRCLEAN_DEPS+=udev-volume_id-dirclean
+UDEV_EXTRAS+=volume_id
endif
-
-#####################################################################
ifeq ($(BR2_PACKAGE_UDEV_SCSI_ID),y)
-.PHONY: udev-scsi_id udev-scsi_id-clean udev-scsi_id-dirclean
-
-$(TARGET_DIR)/lib/udev/scsi_id: $(STAGING_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
- $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
- CFLAGS="$(BR2_UDEV_CFLAGS)" \
- USE_LOG=false USE_SELINUX=false \
- udevdir=$(UDEV_ROOT) EXTRAS="extras/scsi_id" -C $(UDEV_DIR)
- $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/scsi_id/scsi_id $@
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
-
-$(TARGET_DIR)/lib/udev/usb_id: $(STAGING_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
- $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
- CFLAGS="$(BR2_UDEV_CFLAGS)" \
- USE_LOG=false USE_SELINUX=false \
- udevdir=$(UDEV_ROOT) EXTRAS="extras/usb_id" -C $(UDEV_DIR)
- $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/usb_id/usb_id $@
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
-
-udev-scsi_id: udev $(TARGET_DIR)/lib/udev/scsi_id $(TARGET_DIR)/lib/udev/usb_id
-
-udev-scsi_id-clean:
- rm -f $(TARGET_DIR)/lib/udev/scsi_id
- rm -f $(TARGET_DIR)/lib/udev/usb_id
- rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
-
-udev-scsi_id-dirclean:
- -$(MAKE) EXTRAS="extras/scsi_id" -C $(UDEV_DIR) clean
-
-UDEV_CLEAN_DEPS+=udev-scsi_id-clean
-UDEV_DIRCLEAN_DEPS+=udev-scsi_id-dirclean
+UDEV_EXTRAS+=scsi_id
+UDEV_EXTRAS+=usb_id
endif
-
-#####################################################################
ifeq ($(BR2_PACKAGE_UDEV_PATH_ID),y)
-.PHONY: udev-path_id udev-path_id-clean udev-path_id-dirclean
+UDEV_EXTRAS+=path_id
+endif
+ifeq ($(BR2_PACKAGE_UDEV_FIRMWARE_SH),y)
+UDEV_EXTRAS+=firmware
+endif
+
+UDEV_BUILD_EXTRAS=$(addprefix extras/,$(UDEV_EXTRAS))
-$(TARGET_DIR)/lib/udev/path_id: $(STAGING_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
- $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
+#
+# Build
+#
+define UDEV_BUILD_CMDS
+ $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) CC=$(TARGET_CC) LD=$(TARGET_CC)\
CFLAGS="$(BR2_UDEV_CFLAGS)" \
USE_LOG=false USE_SELINUX=false \
- udevdir=$(UDEV_ROOT) EXTRAS="extras/path_id" -C $(UDEV_DIR)
- $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/path_id/path_id $@
+ udevdir=$(UDEV_ROOT) EXTRAS="$(UDEV_BUILD_EXTRAS)" -C $(@D)
+endef
-udev-path_id: udev $(TARGET_DIR)/lib/udev/path_id
-
-udev-path_id-clean:
- rm -f $(TARGET_DIR)/lib/udev/path_id
- rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
+#
+# Staging installation
+#
+ifeq ($(BR2_PACKAGE_UDEV_VOLUME_ID),y)
+define UDEV_VOLUME_ID_STAGING_INSTALL_CMDS
+ $(INSTALL) -m 0644 -D $(UDEV_DIR)/extras/volume_id/lib/libvolume_id.h $(STAGING_DIR)/usr/include/libvolume_id.h
+ $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/volume_id/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
+ -ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/lib/libvolume_id.so.0
+ -ln -sf libvolume_id.so.$(UDEV_VOLUME_ID_VERSION) $(STAGING_DIR)/lib/libvolume_id.so
+ $(INSTALL) -m 0755 -D package/udev/libvolume_id.la.tmpl $(STAGING_DIR)/lib/libvolume_id.la
+ $(SED) 's/REPLACE_CURRENT/$(UDEV_VOLUME_ID_CURRENT)/g' $(STAGING_DIR)/lib/libvolume_id.la
+ $(SED) 's/REPLACE_AGE/$(UDEV_VOLUME_ID_AGE)/g' $(STAGING_DIR)/lib/libvolume_id.la
+ $(SED) 's/REPLACE_REVISION/$(UDEV_VOLUME_ID_REVISION)/g' $(STAGING_DIR)/lib/libvolume_id.la
+ $(SED) 's,REPLACE_LIB_DIR,$(STAGING_DIR)/usr/lib,g' $(STAGING_DIR)/lib/libvolume_id.la
+endef
+endif
-udev-path_id-dirclean:
- -$(MAKE) EXTRAS="extras/path_id" -C $(UDEV_DIR) clean
+define UDEV_INSTALL_STAGING_CMDS
+$(UDEV_VOLUME_ID_STAGING_INSTALL_CMDS)
+endef
-UDEV_CLEAN_DEPS+=udev-path_id-clean
-UDEV_DIRCLEAN_DEPS+=udev-path_id-dirclean
+#
+# Target installation
+#
+ifneq ($(BR2_PACKAGE_UDEV_UTILS),y)
+define UDEV_UTILS_REMOVAL
+ rm -f $(TARGET_DIR)/usr/sbin/udevmonitor
+ rm -f $(TARGET_DIR)/usr/bin/udevinfo
+ rm -f $(TARGET_DIR)/usr/bin/udevtest
+endef
endif
-#####################################################################
-ifeq ($(BR2_PACKAGE_UDEV_FIRMWARE_SH),y)
-.PHONY: udev-firmware_sh udev-firmware_sh-clean udev-firmware_sh-dirclean
-
-$(TARGET_DIR)/lib/udev/firmware.sh: $(STAGING_DIR)/usr/lib/libvolume_id.so.$(UDEV_VOLUME_ID_VERSION)
- $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
+define UDEV_INSTALL_TARGET_CMDS
+ mkdir -p $(TARGET_DIR)/sys
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ DESTDIR=$(TARGET_DIR) \
CFLAGS="$(BR2_UDEV_CFLAGS)" \
+ LDFLAGS="-warn-common" \
USE_LOG=false USE_SELINUX=false \
- udevdir=$(UDEV_ROOT) EXTRAS="extras/firmware" -C $(UDEV_DIR)
- $(INSTALL) -m 0755 -D $(UDEV_DIR)/extras/firmware/firmware.sh $@
-
-udev-firmware_sh: udev $(TARGET_DIR)/lib/udev/firmware.sh
-
-udev-firmware_sh-clean:
- rm -f $(TARGET_DIR)/lib/udev/firmware.sh
- rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
-
-udev-firmware_sh-dirclean:
- -$(MAKE) EXTRAS="extras/firmware" -C $(UDEV_DIR) clean
-
-UDEV_CLEAN_DEPS+=udev-firmware_sh-clean
-UDEV_DIRCLEAN_DEPS+=udev-firmware_sh-dirclean
-endif
+ udevdir=$(UDEV_ROOT) EXTRAS="$(UDEV_BUILD_EXTRAS)" -C $(@D) install
+ $(INSTALL) -m 0755 package/udev/S10udev $(TARGET_DIR)/etc/init.d
+ $(INSTALL) -m 0644 $(@D)/etc/udev/frugalware/* $(TARGET_DIR)/etc/udev/rules.d
+ ( grep udev_root $(TARGET_DIR)/etc/udev/udev.conf > /dev/null 2>&1 || echo 'udev_root=/dev' >> $(TARGET_DIR)/etc/udev/udev.conf )
+ install -m 0755 -D $(@D)/udevstart $(TARGET_DIR)/sbin/udevstart
+ for i in $(TARGET_DIR)/sbin/udev* $(TARGET_DIR)/usr/bin/udev* ; do \
+ $(STRIPCMD) $(STRIP_STRIP_ALL) $$i ; \
+ done
+ for i in scsi_id usb_id vol_id ; do \
+ if test -e $(TARGET_DIR)/lib/udev/$$i ; then \
+ $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/lib/udev/$$i ; \
+ fi \
+ done
+ $(UDEV_UTILS_REMOVAL)
+endef
-#############################################################
#
-# Toplevel Makefile options
+# Clean
#
-#############################################################
-ifeq ($(BR2_PACKAGE_UDEV),y)
-TARGETS+=udev
-endif
-
-ifeq ($(BR2_PACKAGE_UDEV_VOLUME_ID),y)
-TARGETS+=udev-volume_id
-endif
+define UDEV_CLEAN_CMDS
+ -$(MAKE) EXTRAS="$(UDEV_BUILD_EXTRAS)" -C $(@D) clean
+endef
-ifeq ($(BR2_PACKAGE_UDEV_SCSI_ID),y)
-TARGETS+=udev-scsi_id
-endif
+#
+# Staging uninstall
+#
+define UDEV_UNINSTALL_STAGING_CMDS
+ rm -f $(STAGING_DIR)/usr/include/libvolume_id.h
+ rm -f $(STAGING_DIR)/lib/libvolume_id.so*
+ rm -f $(STAGING_DIR)/lib/libvolume_id.la
+endef
-ifeq ($(BR2_PACKAGE_UDEV_PATH_ID),y)
-TARGETS+=udev-path_id
-endif
+#
+# Target uninstall
+#
+define UDEV_UNINSTALL_TARGET_CMDS
+ rm -f $(TARGET_DIR)/etc/init.d/S10udev $(TARGET_DIR)/sbin/udev*
+ rm -f $(TARGET_DIR)/usr/sbin/udevmonitor $(TARGET_DIR)/usr/bin/udev*
+ rm -fr $(TARGET_DIR)/sys
+ rm -f $(TARGET_DIR)/lib/libvolume_id.so.0*
+ rm -rf $(TARGET_DIR)/lib/udev
+endef
-ifeq ($(BR2_PACKAGE_UDEV_FIRMWARE_SH),y)
-TARGETS+=udev-firmware_sh
-endif
+$(eval $(call GENTARGETS,package,udev))
diff --git a/package/usbutils/usbutils.mk b/package/usbutils/usbutils.mk
index 1d21a08aa..ef014037d 100644
--- a/package/usbutils/usbutils.mk
+++ b/package/usbutils/usbutils.mk
@@ -6,7 +6,7 @@
USBUTILS_VERSION = 0.86
USBUTILS_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/linux-usb/
-USBUTILS_DEPENDENCIES = host-pkgconfig
+USBUTILS_DEPENDENCIES = host-pkg-config
ifeq ($(BR2_PACKAGE_USBUTILS_ZLIB),y)
USBUTILS_DEPENDENCIES += zlib
diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
index 5d7857389..7edab8484 100644
--- a/package/wpa_supplicant/wpa_supplicant.mk
+++ b/package/wpa_supplicant/wpa_supplicant.mk
@@ -19,7 +19,7 @@ ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_OPENSSL),y)
WPA_SUPPLICANT_DEPENDENCIES += openssl
endif
ifeq ($(BR2_PACKAGE_DBUS),y)
- WPA_SUPPLICANT_DEPENDENCIES += host-pkgconfig dbus
+ WPA_SUPPLICANT_DEPENDENCIES += host-pkg-config dbus
WPA_SUPPLICANT_MAKE_ENV = \
PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig"
diff --git a/package/x11r7/xfont_font-util/xfont_font-util.mk b/package/x11r7/xfont_font-util/xfont_font-util.mk
index 0c9dc29a9..38e7e80a7 100644
--- a/package/x11r7/xfont_font-util/xfont_font-util.mk
+++ b/package/x11r7/xfont_font-util/xfont_font-util.mk
@@ -59,7 +59,7 @@ $(XFONT_FONT_UTIL_DIR)/.hacked: $(XFONT_FONT_UTIL_DIR)/.installed
( package/x11r7/xfont_font-util/post-install.sh $(STAGING_DIR) )
touch $@
-xfont_font-util: host-pkgconfig $(XFONT_FONT_UTIL_DIR)/.hacked
+xfont_font-util: host-pkg-config $(XFONT_FONT_UTIL_DIR)/.hacked
xfont_font-util-unpacked: $(XFONT_FONT_UTIL_DIR)/.unpacked
diff --git a/package/x11r7/xproto_xproto/xproto_xproto.mk b/package/x11r7/xproto_xproto/xproto_xproto.mk
index 879b55453..ff2a042b2 100644
--- a/package/x11r7/xproto_xproto/xproto_xproto.mk
+++ b/package/x11r7/xproto_xproto/xproto_xproto.mk
@@ -12,46 +12,4 @@ XPROTO_XPROTO_INSTALL_STAGING = YES
XPROTO_XPROTO_INSTALL_TARGET = NO
$(eval $(call AUTOTARGETS,package/x11r7,xproto_xproto))
-
-# xproto_xproto for the host
-XPROTO_XPROTO_HOST_DIR:=$(BUILD_DIR)/xproto_xproto-$(XPROTO_XPROTO_VERSION)-host
-
-$(DL_DIR)/$(XPROTO_XPROTO_SOURCE):
- $(call DOWNLOAD,$(XPROTO_XPROTO_SITE),$(XPROTO_XPROTO_SOURCE))
-
-$(STAMP_DIR)/host_xproto_xproto_unpacked: $(DL_DIR)/$(XPROTO_XPROTO_SOURCE)
- mkdir -p $(XPROTO_XPROTO_HOST_DIR)
- $(INFLATE$(suffix $(XPROTO_XPROTO_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(XPROTO_XPROTO_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_xproto_xproto_configured: $(STAMP_DIR)/host_xproto_xproto_unpacked
- (cd $(XPROTO_XPROTO_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- )
- touch $@
-
-$(STAMP_DIR)/host_xproto_xproto_compiled: $(STAMP_DIR)/host_xproto_xproto_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(XPROTO_XPROTO_HOST_DIR)
- touch $@
-
-$(STAMP_DIR)/host_xproto_xproto_installed: $(STAMP_DIR)/host_xproto_xproto_compiled
- $(MAKE) -C $(XPROTO_XPROTO_HOST_DIR) install
- touch $@
-
-host-xproto_xproto: $(STAMP_DIR)/host_xproto_xproto_installed
-
-host-xproto_xproto-source: xproto_xproto-source
-
-host-xproto_xproto-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_xproto_xproto_,unpacked configured compiled installed)
- -$(MAKE) -C $(XPROTO_XPROTO_HOST_DIR) uninstall
- -$(MAKE) -C $(XPROTO_XPROTO_HOST_DIR) clean
-
-host-xproto_xproto-dirclean:
- rm -rf $(XPROTO_XPROTO_HOST_DIR)
+$(eval $(call AUTOTARGETS,package/x11r7,xproto_xproto,host))
diff --git a/package/x11r7/xutil_makedepend/xutil_makedepend.mk b/package/x11r7/xutil_makedepend/xutil_makedepend.mk
index edbe2514d..b0bbafd10 100644
--- a/package/x11r7/xutil_makedepend/xutil_makedepend.mk
+++ b/package/x11r7/xutil_makedepend/xutil_makedepend.mk
@@ -11,47 +11,7 @@ XUTIL_MAKEDEPEND_AUTORECONF = NO
XUTIL_MAKEDEPEND_INSTALL_STAGING = NO
XUTIL_MAKEDEPEND_INSTALL_TARGET = YES
-$(eval $(call AUTOTARGETS,package/x11r7,xutil_makedepend))
-
-# makedepend for the host
-MAKEDEPEND_HOST_DIR:=$(BUILD_DIR)/makedepend-$(XUTIL_MAKEDEPEND_VERSION)-host
-
-$(DL_DIR)/$(XUTIL_MAKEDEPEND_SOURCE):
- $(call DOWNLOAD,$(XUTIL_MAKEDEPEND_SITE),$(XUTIL_MAKEDEPEND_SOURCE))
-
-$(STAMP_DIR)/host_makedepend_unpacked: $(DL_DIR)/$(XUTIL_MAKEDEPEND_SOURCE)
- mkdir -p $(MAKEDEPEND_HOST_DIR)
- $(INFLATE$(suffix $(XUTIL_MAKEDEPEND_SOURCE))) $< | \
- $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(MAKEDEPEND_HOST_DIR) $(TAR_OPTIONS) -
- touch $@
-
-$(STAMP_DIR)/host_makedepend_configured: $(STAMP_DIR)/host_makedepend_unpacked $(STAMP_DIR)/host_xproto_xproto_installed
- (cd $(MAKEDEPEND_HOST_DIR); rm -rf config.cache; \
- $(HOST_CONFIGURE_OPTS) \
- CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS)" \
- ./configure $(QUIET) \
- --prefix="$(HOST_DIR)/usr" \
- --sysconfdir="$(HOST_DIR)/etc" \
- )
- touch $@
-
-$(STAMP_DIR)/host_makedepend_compiled: $(STAMP_DIR)/host_makedepend_configured
- $(HOST_MAKE_ENV) $(MAKE) -C $(MAKEDEPEND_HOST_DIR)
- touch $@
+HOST_XUTIL_MAKEDEPEND_DEPENDENCIES = host-xproto-xproto
-$(STAMP_DIR)/host_makedepend_installed: $(STAMP_DIR)/host_makedepend_compiled
- $(MAKE) -C $(MAKEDEPEND_HOST_DIR) install
- touch $@
-
-host-makedepend: $(STAMP_DIR)/host_makedepend_installed
-
-host-makedepend-source: makedepend-source
-
-host-makedepend-clean:
- rm -f $(addprefix $(STAMP_DIR)/host_makedepend_,unpacked configured compiled installed)
- -$(MAKE) -C $(MAKEDEPEND_HOST_DIR) uninstall
- -$(MAKE) -C $(MAKEDEPEND_HOST_DIR) clean
-
-host-makedepend-dirclean:
- rm -rf $(MAKEDEPEND_HOST_DIR)
+$(eval $(call AUTOTARGETS,package/x11r7,xutil_makedepend))
+$(eval $(call AUTOTARGETS,package/x11r7,xutil_makedepend,host))
diff --git a/package/zlib/zlib.mk b/package/zlib/zlib.mk
index f207bcf54..5365b30ef 100644
--- a/package/zlib/zlib.mk
+++ b/package/zlib/zlib.mk
@@ -5,31 +5,19 @@
#############################################################
ZLIB_VERSION:=1.2.3
ZLIB_SOURCE:=zlib-$(ZLIB_VERSION).tar.bz2
-ZLIB_CAT:=$(BZCAT)
ZLIB_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
-ZLIB_DIR:=$(BUILD_DIR)/zlib-$(ZLIB_VERSION)
-
-$(DL_DIR)/$(ZLIB_SOURCE):
- $(call DOWNLOAD,$(ZLIB_SITE),$(ZLIB_SOURCE))
-
-$(ZLIB_DIR)/.patched: $(DL_DIR)/$(ZLIB_SOURCE)
- $(ZLIB_CAT) $(DL_DIR)/$(ZLIB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(ZLIB_DIR) package/zlib/ zlib\*.patch
- $(CONFIG_UPDATE) $(@D)
- touch $@
+ZLIB_INSTALL_STAGING=YES
ifeq ($(BR2_PREFER_STATIC_LIB),y)
ZLIB_PIC :=
ZLIB_SHARED :=
-ZLIB_TARGET := $(STAGING_DIR)/usr/lib/libz.a
else
ZLIB_PIC := -fPIC
ZLIB_SHARED := --shared
-ZLIB_TARGET := $(TARGET_DIR)/usr/lib/libz.so
endif
-$(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched
- (cd $(ZLIB_DIR); rm -rf config.cache; \
+define ZLIB_CONFIGURE_CMDS
+ (cd $(@D); rm -rf config.cache; \
$(TARGET_CONFIGURE_ARGS) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) $(ZLIB_PIC)" \
@@ -40,55 +28,32 @@ $(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched
--libdir=$(STAGING_DIR)/usr/lib \
--includedir=$(STAGING_DIR)/usr/include \
)
- touch $@
-
-$(ZLIB_DIR)/libz.a: $(ZLIB_DIR)/.configured
- $(MAKE) -C $(ZLIB_DIR) all libz.a
- touch -c $@
-
-$(STAGING_DIR)/usr/lib/libz.a: $(ZLIB_DIR)/libz.a
- $(INSTALL) -D $(ZLIB_DIR)/libz.a $(STAGING_DIR)/usr/lib/libz.a
- $(INSTALL) -D $(ZLIB_DIR)/zlib.h $(STAGING_DIR)/usr/include/zlib.h
- $(INSTALL) $(ZLIB_DIR)/zconf.h $(STAGING_DIR)/usr/include/
- touch -c $@
-
-$(STAGING_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.a
- cp -dpf $(ZLIB_DIR)/libz.so* $(STAGING_DIR)/usr/lib/
- touch -c $@
+endef
+
+define ZLIB_BUILD_CMDS
+ $(MAKE) -C $(@D) all libz.a
+endef
+
+define ZLIB_INSTALL_STAGING_CMDS
+ $(INSTALL) -D $(@D)/libz.a $(STAGING_DIR)/usr/lib/libz.a
+ $(INSTALL) -D $(@D)/zlib.h $(STAGING_DIR)/usr/include/zlib.h
+ $(INSTALL) $(@D)/zconf.h $(STAGING_DIR)/usr/include/
+ cp -dpf $(@D)/libz.so* $(STAGING_DIR)/usr/lib/
+endef
+
+ifeq ($(BR2_HAVE_DEVFILES),y)
+define ZLIB_INSTALL_TARGET_HEADERS
+ $(INSTALL) -D $(@D)/zlib.h $(STAGING_DIR)/usr/include/zlib.h
+ $(INSTALL) $(@D)/zconf.h $(STAGING_DIR)/usr/include/
+endef
+endif
-$(TARGET_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.so
+define ZLIB_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/lib
- cp -dpf $(STAGING_DIR)/usr/lib/libz.so* $(TARGET_DIR)/usr/lib
- -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
- touch -c $@
-
-$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/usr/lib/libz.a
- $(INSTALL) -D $(STAGING_DIR)/usr/include/zlib.h $(TARGET_DIR)/usr/include/zlib.h
- $(INSTALL) $(STAGING_DIR)/usr/include/zconf.h $(TARGET_DIR)/usr/include/
- $(INSTALL) -D $(STAGING_DIR)/usr/lib/libz.a $(TARGET_DIR)/usr/lib/libz.a
- touch -c $@
-
-zlib: $(ZLIB_TARGET) $(if $(BR2_HAVE_DEVFILES),$(TARGET_DIR)/usr/lib/libz.a)
+ cp -dpf $(@D)/libz.so* $(TARGET_DIR)/usr/lib
+ -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libz.so*
+ $(INSTALL) -D $(@D)/libz.a $(TARGET_DIR)/usr/lib/libz.a
+ $(ZLIB_INSTALL_TARGET_HEADERS)
+endef
-zlib-source: $(DL_DIR)/$(ZLIB_SOURCE)
-
-zlib-clean:
- rm -f $(TARGET_DIR)/usr/lib/libz.* \
- $(TARGET_DIR)/usr/include/zlib.h \
- $(TARGET_DIR)/usr/include/zconf.h \
- $(STAGING_DIR)/usr/include/zlib.h \
- $(STAGING_DIR)/usr/include/zconf.h \
- $(STAGING_DIR)/usr/lib/libz.*
- -$(MAKE) -C $(ZLIB_DIR) clean
-
-zlib-dirclean:
- rm -rf $(ZLIB_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_ZLIB),y)
-TARGETS+=zlib
-endif
+$(eval $(call GENTARGETS,package,zlib))