Bug 1996 - pkg-config tweaks for cross-compiling
Summary: pkg-config tweaks for cross-compiling
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 5.9p1
Hardware: All All
: P2 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_6_1
  Show dependency treegraph
 
Reported: 2012-04-02 20:17 AEST by Colin Watson
Modified: 2016-08-02 10:40 AEST (History)
2 users (show)

See Also:


Attachments
Allow using a cross-architecture pkg-config (1.49 KB, patch)
2012-04-02 20:17 AEST, Colin Watson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Watson 2012-04-02 20:17:00 AEST
Created attachment 2142 [details]
Allow using a cross-architecture pkg-config

When cross-compiling OpenSSH, it's useful to be able to use a cross pkg-config which is configured to return information for the architecture you're building for rather than the architecture you're building on.  The standard convention for this is to call it HOST-pkg-config, e.g. "arm-linux-gnueabi-pkg-config", just as is normally done for cross-compilers.  This implies that configure.ac should use AC_PATH_TOOL rather than AC_PATH_PROG.  (Compare with pkg.m4 shipped by pkg-config itself, which uses AC_PATH_TOOL.)

contrib/Makefile has a similar issue, but this file isn't generated by autoconf.  Perhaps it should be, but in the meantime a simple non-intrusive change is to make pkg-config a variable so that it can be overridden by the caller.

With these two changes, I've been able to cross-compile the Debian openssh package from x86-64 to ARM.
Comment 1 Darren Tucker 2012-05-19 15:25:38 AEST
applied, thanks.  it will be in the next release.
Comment 2 Damien Miller 2016-08-02 10:40:51 AEST
Close all resolved bugs after 7.3p1 release