host-toolchain plugin: add pkgconf/pkg-config

This commit is contained in:
Tony Theodore 2016-07-15 19:04:08 +10:00
parent 109e905f56
commit e9299c0204
2 changed files with 58 additions and 0 deletions

View File

@ -48,6 +48,17 @@ terminal emulators:
Make is difficult to cross-compile so it is downloaded from the [source
recommended by the GNU Make team](http://git.savannah.gnu.org/cgit/make.git/tree/README.W32.template).
#### pkgconf/pkg-config
```
make pkgconf-host MXE_PLUGIN_DIRS=plugins/examples/host-toolchain/
```
This will cross-compile `pkgconf` and create the `pkg-config` wrapper. The
wrapper requires `/bin/sh` so one of the [MSYS2][msys2] options should be used.
Run the `usr/{target}/bin/test-pkgconf-host` script to build `libffi` test
with non-standard include paths.
#### Qt5 tools (`qmake.exe`, `rcc.exe`, etc.)
```

View File

@ -0,0 +1,47 @@
# This file is part of MXE.
# See index.html for further information.
PKG := pkgconf-host
$(PKG)_IGNORE = $(pkgconf_IGNORE)
$(PKG)_VERSION = $(pkgconf_VERSION)
$(PKG)_CHECKSUM = $(pkgconf_CHECKSUM)
$(PKG)_SUBDIR = $(pkgconf_SUBDIR)
$(PKG)_FILE = $(pkgconf_FILE)
$(PKG)_URL = $(pkgconf_URL)
$(PKG)_URL_2 = $(pkgconf_URL_2)
$(PKG)_DEPS := gcc libffi
define $(PKG)_UPDATE
echo $(pkgconf_VERSION)
endef
define $(PKG)_BUILD
cd '$(1)' && ./autogen.sh
cd '$(1)' && ./configure \
$(MXE_CONFIGURE_OPTS)
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)' -j 1 install
# create pkg-config script with relative paths
(echo '#!/bin/sh'; \
echo 'PKG_CONFIG_PATH="../qt5/lib/pkgconfig":"$$PKG_CONFIG_PATH_$(subst .,_,$(subst -,_,$(TARGET)))" \
PKG_CONFIG_LIBDIR='\''../lib/pkgconfig'\'' \
exec '../bin/pkgconf' \
$(if $(BUILD_STATIC),--static) \
--define-variable=prefix=.. \
"$$@"' \
) > '$(PREFIX)/$(TARGET)/bin/pkg-config'
chmod 0755 '$(PREFIX)/$(TARGET)/bin/pkg-config'
# test compilation on host with libffi in non-std prefix
cp '$(PWD)/src/libffi-test.c' '$(PREFIX)/$(TARGET)/bin/test-$(PKG).c'
(echo '#!/bin/sh'; \
echo 'export PATH=../bin:$PATH'; \
echo 'gcc -v \
-W -Wall -Werror -ansi -pedantic \
test-$(PKG).c -o test-$(PKG).exe \
`pkg-config --cflags --libs libffi`'; \
echo 'test-$(PKG).exe'; \
) > '$(PREFIX)/$(TARGET)/bin/test-$(PKG)'
chmod 0755 '$(PREFIX)/$(TARGET)/bin/test-$(PKG)'
endef