From d2530d8d9e7e19d1ae6a51dd12b88ef6bd6c5c6e Mon Sep 17 00:00:00 2001 From: Volker Grabsch Date: Mon, 13 Dec 2010 14:41:32 +0100 Subject: improved pkg-config wrapper and its documentation --- Makefile | 4 ++-- doc/index.html | 17 +++++++++++++++-- src/gcc.mk | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index cb7470c..a31609c 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,7 @@ REQUIREMENTS := autoconf automake bash bison bzip2 cmake flex \ unexport AR CC CFLAGS C_INCLUDE_PATH CPATH CPLUS_INCLUDE_PATH CPP unexport CPPFLAGS CROSS CXX CXXCPP CXXFLAGS EXEEXT EXTRA_CFLAGS unexport EXTRA_LDFLAGS LD LDFLAGS LIBRARY_PATH LIBS NM -unexport OBJC_INCLUDE_PATH PKG_CONFIG PKG_CONFIG_PATH QMAKESPEC -unexport RANLIB STRIP +unexport OBJC_INCLUDE_PATH PKG_CONFIG QMAKESPEC RANLIB STRIP SHORT_PKG_VERSION = \ $(word 1,$(subst ., ,$($(1)_VERSION))).$(word 2,$(subst ., ,$($(1)_VERSION))) @@ -237,6 +236,7 @@ dist: ) \ | $(SED) 's,\(\)[^<]*\(\),\1$(VERSION)\2,g' \ | $(SED) 's,\(\)[^<]*\(\),\1$(TARGET)\2,g' \ + | $(SED) 's,\(\)[^<]*\(\),\1$(subst -,_,$(TARGET))\2,g' \ >'$(DIST_DIR)/mingw-cross-env-$(VERSION)/doc/index.html' cp -p '$(TOP_DIR)/doc'/screenshot-* '$(DIST_DIR)/mingw-cross-env-$(VERSION)/doc/' cp -p '$(DIST_DIR)/mingw-cross-env-$(VERSION)/doc'/* '$(DIST_DIR)/web/' diff --git a/doc/index.html b/doc/index.html index 9c7b6ea..1e285b4 100644 --- a/doc/index.html +++ b/doc/index.html @@ -304,7 +304,19 @@ exit
export PATH=/where mingw-cross-env is installed/usr/bin:$PATH

- Note that any compiler related environment variables + In case you are using custom $PKG_CONFIG_PATH entries, + you can add separate entries for MinGW cross builds: +

+
export PKG_CONFIG_PATH="entries for native builds"
+
export PKG_CONFIG_PATH_i686_pc_mingw32="entries for mingw-cross-env builds"
+

+ Remember to use i686-pc-mingw32-pkg-config + instead of pkg-config for cross builds. + The Autotools do that automatically for you. +

+ +

+ Note that any other compiler related environment variables (like $CC, $LDFLAGS, etc.) may spoil your compiling pleasure, so be sure to delete or disable those. @@ -363,7 +375,8 @@ make

CC=$(CROSS)gcc
 LD=$(CROSS)ld
-AR=$(CROSS)ar
+AR=$(CROSS)ar +PKG_CONFIG=$(CROSS)pkg-config

You may have to add a few others, depending on your project.

diff --git a/src/gcc.mk b/src/gcc.mk index ea5f2dd..1d11a86 100644 --- a/src/gcc.mk +++ b/src/gcc.mk @@ -58,7 +58,7 @@ define $(PKG)_BUILD # create pkg-config script (echo '#!/bin/sh'; \ - echo 'PKG_CONFIG_PATH= PKG_CONFIG_LIBDIR='\''$(PREFIX)/$(TARGET)/lib/pkgconfig'\'' exec pkg-config --static "$$@"') \ + echo 'PKG_CONFIG_PATH="$$PKG_CONFIG_PATH_$(subst -,_,$(TARGET))" PKG_CONFIG_LIBDIR='\''$(PREFIX)/$(TARGET)/lib/pkgconfig'\'' exec pkg-config --static "$$@"') \ > '$(PREFIX)/bin/$(TARGET)-pkg-config' chmod 0755 '$(PREFIX)/bin/$(TARGET)-pkg-config' endef -- cgit v0.12