improved pkg-config wrapper and its documentation

This commit is contained in:
Volker Grabsch 2010-12-13 14:41:32 +01:00
parent 6cde70a5ad
commit d2530d8d9e
3 changed files with 18 additions and 5 deletions

View File

@ -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,\(<span class="version">\)[^<]*\(</span>\),\1$(VERSION)\2,g' \
| $(SED) 's,\(<span class="target">\)[^<]*\(</span>\),\1$(TARGET)\2,g' \
| $(SED) 's,\(<span class="target-underscore">\)[^<]*\(</span>\),\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/'

View File

@ -304,7 +304,19 @@ exit</pre>
<pre>export PATH=/<em>where mingw-cross-env is installed</em>/usr/bin:$PATH</pre>
<p>
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:
</p>
<pre>export PKG_CONFIG_PATH="<em>entries for native builds</em>"</pre>
<pre>export PKG_CONFIG_PATH_<span class="target-underscore">i686_pc_mingw32</span>="<em>entries for mingw-cross-env builds</em>"</pre>
<p>
Remember to use <span class="target">i686-pc-mingw32</span>-pkg-config
instead of pkg-config for cross builds.
The Autotools do that automatically for you.
</p>
<p>
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</pre>
</p>
<pre>CC=$(CROSS)gcc
LD=$(CROSS)ld
AR=$(CROSS)ar</pre>
AR=$(CROSS)ar
PKG_CONFIG=$(CROSS)pkg-config</pre>
<p>
You may have to add a few others, depending on your project.
</p>

View File

@ -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