./configure --host=${CROSS_COMPILE_HOST} ...
You need to set both --build
and --host
dues to an Autoconf bug. Assuming you are building for ARMv7l, something like:
./configure --host=$(config.guess) --build=armv7l-unknown-linux-gnueabihf
The following looks OK to me, assuming /home/xport/usr/local/lib/pkgconfig
is valid and /home/xport/usr/local
is the location of the include/
and lib/
files for the arch.
export PKG_CONFIG_PATH="/home/xport/usr/local/lib/pkgconfig"
I'm not sure about what follows. It is also missing a --build
. And I am used to seeing a --sysroot
when cross-compiling:
./configure --host=${CROSS_COMPILE_HOST} \
--enable-lib64=no --without-kernel-modules --without-pam --disable-vgauth \
--without-x --without-gtk3 --without-gtk2 --without-gtkmm3 --without-gtkmm \
--enable-resolutionkms=no --enable-deploypkg=no
CFLAGS
and CXXFLAGS
should probably include --sysroot
. Maybe something like:
./configure --host=$(config.guess) --build=armv7l-unknown-linux-gnueabihf \
--sysroot="/home/xport/usr/local" --enable-lib64=no --without-kernel-modules ...
Or:
CFLAGS="--sysroot=/home/xport/usr/local" \
CXXFLAGS="--sysroot=/home/xport/usr/local" \
./configure --host=$(config.guess) --build=armv7l-unknown-linux-gnueabihf \
--enable-lib64=no --without-kernel-modules ...
DESTDIR
is intended for staging. This looks OK:
make install DESTDIR=/home/xport/
If you intend to run from the /home/xport/
directory, then you should consider adding the following to LDFLAGS
:
# 64-bit Fedora
-Wl,--enable-new-dtags -Wl,-R,'$$ORIGIN/../lib64'
# Most others
-Wl,--enable-new-dtags -Wl,-R,'$$ORIGIN/../lib'
So maybe something like:
CFLAGS="--sysroot=/home/xport/usr/local" \
CXXFLAGS="--sysroot=/home/xport/usr/local" \
LDFLAGS="-Wl,--enable-new-dtags -Wl,-R,'$$ORIGIN/../lib'" \
./configure --host=$(config.guess) --build=armv7l-unknown-linux-gnueabihf \
--enable-lib64=no --without-kernel-modules ...
$ORIGIN
-based runpaths is what makes staged installs with DESTDIR
work.
The double dollar sign in $$ORIGIN
is due to Makefiles. The double dollar sign is the way to escape the dollar sign so it passes through the makefile properly.
Also see How to include correctly -Wl,-rpath,$ORIGIN linker argument in a Makefile?
config.guess
provides you with your Autoconf triplet:
$ /usr/share/libtool/build-aux/config.guess
x86_64-pc-linux-gnu
If you don't have a config.guess
on-path, then check for it in /usr/share
:
$ find /usr/share -name config.guess
/usr/share/misc/config.guess
/usr/share/libtool/config/config.guess
/usr/share/automake-1.14/config.guess
Also see 2.2.8 Cross-Compilation in the Autoconf manual:
To cross-compile is to build on one platform a binary that will run on
another platform. When speaking of cross-compilation, it is important
to distinguish between the build platform on which the compilation is
performed, and the host platform on which the resulting executable is
expected to run. The following configure options are used to specify
each of them:
--build=build
The system on which the package is built.
--host=host
The system where built programs and libraries will run.
And a little further down:
The --host and --build options are usually all we need for
cross-compiling. The only exception is if the package being built is
itself a cross-compiler: we need a third option to specify its target
architecture.
--target=target
When building compiler tools: the system
for which the tools will create output.
Regarding the comment "I don't even get here":
make
make install DESTDIR=/home/xport # <-- I don't even get here
You need to show the compile error you are encountering when you run make
.