Use of DESTDIR in xeno-config
Hi everyone
I'm confused over the xeno-config use of DESTDIR and cross-compiling. In the documentation (1) it is claimed that it follows the GNU coding standards.
Snippet:
"If DESTDIR was set when installing Xenomai - typically after cross-compiling - DESTDIR must be set to the same value before calling xeno-config for accessing the target-based directories and files from the build system."
The example that is given handles install, and the GNU coding standards (2) also talks about installation. It even specifies: "DESTDIR should be supported only in the install* and uninstall* targets, as those are the only targets where it is useful."
However, xeno-config is hardly used during install.
My specific problem boils down to the following:
I have built a toolchain for Yocto/Poky that has a xeno-config in the sysroot for the target machine. When using it together with autotools used in the etherlab ethercat master i need to set DESTDIR at configure time so that when xeno-config is called the paths to bootstrap.o and dynlib.ld. This feels wrong because of the above statements.
Can anyone enlighten me of the correct way of doing this?
(1) https://xenomai.org/documentation/xenomai-3/html/man1/xeno-config/index.html
(2) https://www.gnu.org/prep/standards/standards.html
TTFN
Per Öberg
Quoted 7 lines · Per Oberg via Xenomai
Hi everyone
I'm confused over the xeno-config use of DESTDIR and cross-compiling. In the documentation (1) it is claimed that it follows the GNU coding standards.
Snippet:
"If DESTDIR was set when installing Xenomai - typically after cross-compiling - DESTDIR must be set to the same value before calling xeno-config for accessing the target-based directories and files from the build system."
Quoted 9 lines
The example that is given handles install, and the GNU coding standards (2) also talks about installation. It even specifies: "DESTDIR should be supported only in the install* and uninstall* targets, as those are the only targets where it is useful."
However, xeno-config is hardly used during install.
My specific problem boils down to the following:
I have built a toolchain for Yocto/Poky that has a xeno-config in the sysroot for the target machine. When using it together with autotools used in the etherlab ethercat master i need to set DESTDIR at configure time so that when xeno-config is called the paths to bootstrap.o and dynlib.ld. This feels wrong because of the above statements.Can anyone enlighten me of the correct way of doing this?
From my reading of both the documentation and what you did, this seems consistent: You need to set DESTDIR when you access the toolchain - including xeno-config - from within the build system. Once you are on target system (or chroot into it), DESTDIR is out of the game.
The problem when looking at Yocto-like toolchains (SDKs) is that those might be relocated (moved around, installed to different directory) after being generated. In that case, DESTDIR may actually have to be updated accordingly as well. I already received the suggestion internally to derive the necessary base path in that case for the location of the compiler, which is doable but feels not really correct to me as well.
Jan
Quoted 7 lines
(1) https://xenomai.org/documentation/xenomai-3/html/man1/xeno-config/index.html
(2) https://www.gnu.org/prep/standards/standards.htmlTTFN
Per Öberg
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
----- Den 16 nov 2018, på kl 14:29, Jan Kiszka <[email protected]> skrev:
Quoted 33 lines · Per Oberg via Xenomai
Quoted 17 lines
Hi everyone
I'm confused over the xeno-config use of DESTDIR and cross-compiling. In the documentation (1) it is claimed that it follows the GNU coding standards.
Snippet:
"If DESTDIR was set when installing Xenomai - typically after cross-compiling - DESTDIR must be set to the same value before calling xeno-config for accessing the target-based directories and files from the build system."The example that is given handles install, and the GNU coding standards (2) also talks about installation. It even specifies: "DESTDIR should be supported only in the install* and uninstall* targets, as those are the only targets where it is useful."
However, xeno-config is hardly used during install.
Quoted 8 lines
My specific problem boils down to the following:
I have built a toolchain for Yocto/Poky that has a xeno-config in the sysroot for the target machine. When using it together with autotools used in the etherlab ethercat master i need to set DESTDIR at configure time so that when xeno-config is called the paths to bootstrap.o and dynlib.ld. This feels wrong because of the above statements.Can anyone enlighten me of the correct way of doing this?
From my reading of both the documentation and what you did, this seems
consistent: You need to set DESTDIR when you access the toolchain - including xeno-config - from within the build system. Once you are on target system (or chroot into it), DESTDIR is out of the game.
Quoted 6 lines
The problem when looking at Yocto-like toolchains (SDKs) is that those might be relocated (moved around, installed to different directory) after being generated. In that case, DESTDIR may actually have to be updated accordingly as well. I already received the suggestion internally to derive the necessary base path in that case for the location of the compiler, which is doable but feels not really correct to me as well.
I see the usefulness, but I fail to see how it's complicit with the GNU standards. What worries me (a little, not much) is that I may be getting other things wrong because of it.
I'm thinking that this has to be a common problem for most stuff that is cross-compiled with distributed toolchains, and there is the "--sysroot=mysysroot" flag that will make -I=/usr/ and -L=/usr/ translate to -Isysroot/usr and -Lsysroot/usr. Are you saying that there is a hole in the way things are normally done because xenomai is special?
I will not persist, I know to little about it, but I am not convinced, yet.
I do like the idea with picking the location from the script, that would make sense i.m.h.o.
Per Öberg
Quoted 13 lines
Jan
Quoted 5 lines
(1) https://xenomai.org/documentation/xenomai-3/html/man1/xeno-config/index.html
(2) https://www.gnu.org/prep/standards/standards.htmlTTFN
Per Öberg--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux