I'm cross compiling open VMWare tools. I pre-compiled glib and i'm setting the PKG_CONFIG_PATH variable to link them.
I'm getting the following errors in the link stage.
libtool: link: warning: library `/u/git/extlib_vmtools/usr/local/lib/libgthread-2.0.la' was moved.
/bin/grep: /usr/local/lib/libglib-2.0.la: No such file or directory
/bin/sed: can't read /usr/local/lib/libglib-2.0.la: No such file or directory
libtool: link: `/usr/local/lib/libglib-2.0.la' is not a valid libtool archive
make[2]: *** [libhgfs.la] Error 1
make[2]: Leaving directory `/u/git/extlib_vmtools/src/open-vm-tools-11.0.0-14549434/libhgfs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/u/git/extlib_vmtools/src/open-vm-tools-11.0.0-14549434'
I followed this helpful post (DESTDIR and PREFIX of make) but I think i'm missing something.
I didn't set the --prefix for any module, since I want to use the default direcotry structure when deploying.
glib compilation (lower module):
./configure --host=${CROSS_COMPILE_HOST}
make
make install DESTDIR=/home/xport/
open-vmware-tools compilation (upper module):
export PKG_CONFIG_SYSROOT_DIR="/home/xport/"
export PKG_CONFIG_PATH="/home/xport/usr/local/lib/pkgconfig"
autoreconf -i
./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
make
make install DESTDIR=/home/xport # <-- I don't even get here
Before I set the PKG_CONFIG_PATH variable, the second make failed due to missing .h files... So I know that .pc linkage works.
What am I missing ?
Thanks !
You need to set both
--buildand--hostdues to an Autoconf bug. Assuming you are building for ARMv7l, something like:The following looks OK to me, assuming
/home/xport/usr/local/lib/pkgconfigis valid and/home/xport/usr/localis the location of theinclude/andlib/files for the arch.I'm not sure about what follows. It is also missing a
--build. And I am used to seeing a--sysrootwhen cross-compiling:CFLAGSandCXXFLAGSshould probably include--sysroot. Maybe something like:Or:
DESTDIRis intended for staging. This looks OK:If you intend to run from the
/home/xport/directory, then you should consider adding the following toLDFLAGS:So maybe something like:
$ORIGIN-based runpaths is what makes staged installs withDESTDIRwork.The double dollar sign in
$$ORIGINis 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.guessprovides you with your Autoconf triplet:If you don't have a
config.guesson-path, then check for it in/usr/share:Also see 2.2.8 Cross-Compilation in the Autoconf manual:
And a little further down:
Regarding the comment "I don't even get here":
You need to show the compile error you are encountering when you run
make.