aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cross-pkg-config: Don't unset PKG_CONFIG_ALLOW_SYSTEM_CFLAGS/LIBS20240921James Le Cuirot2024-09-211-2/+0
| | | | | | | | | | | | | | | | | | | These variables control whether pkg-config returns flags to search directories that the toolchain would search by default anyway. Rust's pkg-config-rs enables them by default, and some crates expect flags to always be returned, even if they are technically unnecessary. Unsetting these variables in the wrapper therefore breaks some crates. Having seen how this works in detail, it would be fruitless to ask upstream to change it. These lines were originally added at a time when we expected other non-Gentoo-based distributions to use crossdev. That didn't happen. Gentoo itself doesn't set these variables anywhere that I can see. Even if they were set, they are unlikely to break anything in practise now that our cross builds are better behaved than they used to be. Bug: https://bugs.gentoo.org/939334 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* cross-pkg-config: Set PKG_CONFIG_FDO_SYSROOT_RULES=1Matt Turner2023-10-151-0/+3
| | | | | | | | | | | When cross-compiling, pkgconf behaves in a way that causes many packages to install files to ${SYSROOT}/${SYSROOT}/... without PKG_CONFIG_FDO_SYSROOT_RULES set. I'm aware of at least gobject-introspection, modemmanager, and libp11, but there are likely more. Signed-off-by: Matt Turner <mattst88@gentoo.org>
* cross-pkg-config: Properly set PKG_CONFIG_SYSTEM_*_PATH variables20230923James Le Cuirot2023-09-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | Perhaps this was a difference between pkg-config and pkgconf, but we have not set PKG_CONFIG_SYSTEM_LIBRARY_PATH correctly since we began setting it in 2014. It should include the SYSROOT. We also never set PKG_CONFIG_SYSTEM_INCLUDE_PATH at all. These variables tell pkg-config not to emit paths that the toolchain would search in anyway. This helps to reduce the noise appearing in newly-installed .pc files. This change does assume that if you have set SYSROOT differently to the toolchain's default, then you have also added the --sysroot argument to your compiler flags. Neither Portage nor Gentoo currently do this for you. cross-boss does, but it's not an officially supported solution. The change could therefore potentially break things, but it's likely you'll run into other problems if you don't add --sysroot anyway. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Closes: https://github.com/gentoo/crossdev/pull/13 Signed-off-by: Sam James <sam@gentoo.org>
* Support standalone LLVM/Clang as crosscompilerAlfred Persson Forsberg2023-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | This change makes it possible to use Clang instead of GCC in Crossdev. As LLVM is already able to target other architectures, provided that LLVM_TARGETS is set accordingly, the only thing needed to do is compile builtins (compiler-rt) for the target triple. Note that compiler-rt needs libc headers to target when building, and in turn linux-headers needs to be installed for Linux targets, so most stages except binutils and GCC are still there. Currently having both a GCC and LLVM Crossdev environment installed for the same triple is not supported since many ebuilds just use /usr/${CTARGET} as a hardcoded sysroot, but I plan adding support. Note: by standalone I mean a pure LLVM toolchain not dependent on an existing GCC toolchain. Bug: https://bugs.gentoo.org/680652 Signed-off-by: Alfred Persson Forsberg <cat@catcream.org> Closes: https://github.com/gentoo/crossdev/pull/10 Signed-off-by: Sam James <sam@gentoo.org>
* cross-pkg-config: Rework to properly support prefixJames Le Cuirot2022-12-271-36/+51
| | | | | | | | This helps with both cross-compiling into a prefix and cross-compiling within a prefix. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* cross-pkg-config: allow basic options for $1Mike Frysinger2022-01-131-0/+11
| | | | | | | | | | | Tools sometimes probe pkg-config to see if it itself works. Allow those basic options through. We specifically don't parse the full command line to keep the code simple, faster, and to avoid dealing with ugly edge cases (like `pkg-config -- --help`). Closes: https://bugs.gentoo.org/830840 Reported-by: Alexandra Parker <alex.iris.parker@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: drop old version checkMike Frysinger2022-01-131-4/+0
| | | | | | | pkg-config-0.24 was released over a decade ago. We can stop checking for it now. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: Respect PKG_CONFIG_SYSROOT_DIR if its already setJames Le Cuirot2021-01-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using --variable, pkgconf prepends PKG_CONFIG_SYSROOT_DIR to the value when it starts with /, even though the original pkg-config didn't do this. Upstream have confirmed that this is intentional [1]. The original pkg-config is no longer maintained and will probably be dropped from Gentoo. $ PKG_CONFIG_SYSROOT_DIR=/foo pkgconf --variable=udevdir udev /foo/lib/udev $ PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev /lib/udev In some contexts, we do not want the SYSROOT to be prepended here. This would normally just be a case of not setting PKG_CONFIG_SYSROOT_DIR but our wrapper uses SYSROOT to set both PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR. It will not set one without the other but we need the latter to find the right .pc file in the first place. One example where this issue arises is Gentoo's udev eclass. Packages installing udev rules call get_udevdir() to find out where to put them. With ROOT=/foo SYSROOT=/foo, this will return something like /foo/lib/udev but since ROOT is already handled by Portage when merging, the rules will actually end up in /foo/foo/lib/udev. This can be resolved by respecting PKG_CONFIG_SYSROOT_DIR, even when it is set but blank. It is unlikely to be set more widely when using cross-pkg-config so this should be safe. [1] https://github.com/pkgconf/pkgconf/issues/69#issuecomment-48434876 Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* cross-pkg-config: fix typo w/pkg_configMike Frysinger2016-01-161-1/+1
| | | | | | URL: https://bugs.gentoo.org/570762 Reported-by: Fabio Rossi <rossi.f@inwind.it> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: avoid bashismMike Frysinger2014-10-301-1/+1
| | | | | URL: https://bugs.gentoo.org/525068 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: probe pkgconfig dir directlyMike Frysinger2014-09-171-2/+2
| | | | | | | | Since we're looking for the pkgconfig dir, let's probe it directly rather than rely on specific C library files. URL: https://bugs.gentoo.org/518790 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: set up PKG_CONFIG_SYSTEM_LIBRARY_PATHMike Frysinger2014-07-291-3/+21
| | | | | | | Rather than hardcode /usr/lib, set PKG_CONFIG_SYSTEM_LIBRARY_PATH to the right libdir paths. This should handle lib vs lib64 vs lib correctly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: utilize PKG_CONFIG_SYSROOT_DIRMike Frysinger2014-07-281-15/+3
| | | | | | | | | Now that the 0.24 release has been out for a few years, we can start relying on its availability. URL: https://bugs.gentoo.org/517530 Reported-by: Mike Marineau <mike@marineau.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: minor style fix upMike Frysinger2014-03-271-5/+5
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: use SYSROOT from env if setMike Frysinger2012-02-271-17/+19
| | | | | | | | If we already have SYSROOT set in the env, just go with that. This lets us do multiple sysroots-per-target by manipulating the env. Idea based on the work in ChromiumOS. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: relax pkg-config requirementMike Frysinger2010-02-131-1/+1
| | | | | | | We don't actually require 0.23+, and some distros (like Debian) are very behind the times and lack even this version. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: tweak path updates with fewer commandsMike Frysinger2010-02-111-4/+4
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* update from ajwong@chromium.org.. : was not neededNed Ludd2010-02-111-2/+2
| | | | Signed-off-by: Ned Ludd <solar@gentoo.org>
* - take pkg-config update from (awong) Albert J. Wong @ google for the ↵Ned Ludd2010-02-111-19/+17
| | | | | | chromium/gentoo build env -> http://codereview.appspot.com/206075 Signed-off-by: Ned Ludd <solar@gentoo.org>
* cross-pkg-config: switch to PKG_CONFIG_SYSROOT_DIR (kind of)Mike Frysinger2010-01-081-2/+16
| | | | | | | | | | | | | | | The latest pkg-config supports PKG_CONFIG_SYSROOT_DIR which handles -L/-I munging on the fly, but it's slightly broken. So put all the pieces in place for the next upstream release and in the mean time, do the munging ourselves on the fly via sed. This way packages that want runtime paths compiled in don't get the build paths that were munged in the .pc file. URL: http://bugs.gentoo.org/299990 URL: https://bugs.freedesktop.org/show_bug.cgi?id=16905 Reported-by: Andrew Gaffney <agaffney@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: switch version checking to --atleast-pkgconfig-versionMike Frysinger2010-01-081-6/+3
| | | | | | Better than using our own custom version parser. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: fix typo in EXTRA_PKG_CONFIG_LIBDIR handlingMike Frysinger2010-01-081-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* drop $Header: markingsMike Frysinger2009-12-091-2/+1
| | | | | | These cause cross-scm comparisons a pita. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: add --cross-pkg-config-install optionMike Frysinger2009-03-131-1/+17
| | | | | | | This lets people copy the wrapper someplace and then nail down the dirs it works with. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: deduce /usr/$CHOST generically from $0Mike Frysinger2008-12-021-1/+7
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add pkg-config sanity checksMike Frysinger2008-11-251-0/+8
|
* cross-pkg-config: handle /usr/share/pkgconfigMike Frysinger2008-11-011-1/+1
| | | | | | | A few packages install their .pc files into /usr/share/pkgconfig. Rather than debate whether this is broken, we can handle it pretty trivially. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cross-pkg-config: unify uClinux-dist and GentooMike Frysinger2008-10-291-9/+40
| | | | | | | Touchup comments and unify variable handling so it can be used transparently in both Gentoo and the uClinux distribution. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Initial commit to crossdev repo.Robin H. Johnson2008-06-221-0/+52