mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-02-03 19:30:43 +01:00
Install pkg-config link with $host- prefix
If pkg-config is used in a multiarch or cross-compiling scenario it's likely pkg-config needs to behave differently for each of them. It's possible to handle this through environment variables with one pkg-config, but another option is to have one pkg-config per platform, each with the host alias prefixed to the program. PKG_PROG_PKG_CONFIG supports this type of installation, and this is also how autoconf/libtool handle other build tools like compilers and linkers. The host-prefixed tool is installed as a hardlink where supported and a copy otherwise. This is how gcc handles it's host-prefixed versions. This feature can be turned off by passing --disable-host-tool to configure. Freedesktop #130
This commit is contained in:
parent
65e37fe303
commit
6b07296902
2 changed files with 19 additions and 0 deletions
|
|
@ -36,6 +36,12 @@ pkg_config_SOURCES= \
|
|||
parse.c \
|
||||
main.c
|
||||
|
||||
if HOST_TOOL
|
||||
host_tool = $(host)-pkg-config$(EXEEXT)
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir) && $(LN) pkg-config$(EXEEXT) $(host_tool)
|
||||
endif
|
||||
|
||||
# Various data files
|
||||
m4dir = $(datadir)/aclocal
|
||||
dist_m4_DATA = pkg.m4
|
||||
|
|
|
|||
13
configure.ac
13
configure.ac
|
|
@ -19,6 +19,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|||
|
||||
dnl Check for programs
|
||||
AC_PROG_CC
|
||||
AC_CHECK_PROG([LN], [ln], [ln], [cp -Rp])
|
||||
|
||||
dnl Check for headers
|
||||
AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h])
|
||||
|
|
@ -203,6 +204,18 @@ if test "x$with_gcov" = xyes; then
|
|||
fi
|
||||
AC_SUBST([GCOV_CFLAGS])
|
||||
|
||||
dnl See if the user wants a host- prefixed tool
|
||||
dnl (e.g. i686-pc-linux-gnu-pkg-config) to be installed.
|
||||
dnl
|
||||
AC_MSG_CHECKING([if host- prefixed tool should be installed])
|
||||
AC_ARG_ENABLE([host-tool],
|
||||
[AS_HELP_STRING([--disable-host-tool],
|
||||
[install link to pkg-config with $host- prefix @<:@default=yes@:>@])],
|
||||
[],
|
||||
[enable_host_tool=yes])
|
||||
AC_MSG_RESULT([$enable_host_tool])
|
||||
AM_CONDITIONAL([HOST_TOOL], [test "x$enable_host_tool" = xyes])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
check/Makefile
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue