[tools] use HOST_STATIC_LINKING instead of hardcoding -static
[openwrt.git] / tools / pkg-config / Makefile
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=pkg-config
10 PKG_VERSION:=0.25
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=http://pkgconfig.freedesktop.org/releases/
14 PKG_MD5SUM:=a3270bab3f4b69b7dc6dbdacbcae9745
15
16 include $(INCLUDE_DIR)/host-build.mk
17
18 HOST_LDFLAGS += $(HOST_STATIC_LINKING)
19
20 define Host/Install
21         $(MAKE) -C $(HOST_BUILD_DIR) install \
22                 AM_LDFLAGS="$(if $(HOST_STATIC_LINKING),-all-static)"
23         mv $(STAGING_DIR_HOST)/bin/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config.real
24         $(INSTALL_BIN) ./files/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config
25 endef
26
27 define Host/Clean
28         -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
29         $(call Host/Clean/Default)
30 endef
31
32 $(eval $(call HostBuild))