diff options
Diffstat (limited to 'documentation/ref-manual/faq.xml')
-rw-r--r-- | documentation/ref-manual/faq.xml | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/documentation/ref-manual/faq.xml b/documentation/ref-manual/faq.xml index bc147ce70a..72ff0d6fda 100644 --- a/documentation/ref-manual/faq.xml +++ b/documentation/ref-manual/faq.xml | |||
@@ -682,6 +682,112 @@ | |||
682 | </answer> | 682 | </answer> |
683 | </qandaentry> | 683 | </qandaentry> |
684 | 684 | ||
685 | <qandaentry> | ||
686 | <question> | ||
687 | <para> | ||
688 | Why do <filename>${bindir}</filename> and <filename>${libdir}</filename> have strange values for <filename>-native</filename> recipes? | ||
689 | </para> | ||
690 | </question> | ||
691 | <answer> | ||
692 | <para> | ||
693 | Executables and libraries might need to be used from a | ||
694 | directory other than the directory into which they were | ||
695 | initially installed. | ||
696 | Complicating this situation is the fact that sometimes these | ||
697 | executables and libraries are compiled with the expectation | ||
698 | of being run from that initial installation target directory. | ||
699 | If this is the case, moving them causes problems. | ||
700 | </para> | ||
701 | |||
702 | <para> | ||
703 | This scenario is a fundamental problem for package maintainers | ||
704 | of mainstream Linux distributions as well as for the | ||
705 | OpenEmbedded build system. | ||
706 | As such, a well-established solution exists. | ||
707 | Makefiles, Autotools configuration scripts, and other build | ||
708 | systems are expected to respect environment variables such as | ||
709 | <filename>bindir</filename>, <filename>libdir</filename>, | ||
710 | and <filename>sysconfdir</filename> that indicate where | ||
711 | executables, libraries, and data reside when a program is | ||
712 | actually run. | ||
713 | And, they are also expected to respect a | ||
714 | <filename>DESTDIR</filename> environment variable, which is | ||
715 | prepended to all the other variables when the build system | ||
716 | actually installs the files. | ||
717 | It is understood that the program does not actually run from | ||
718 | within <filename>DESTDIR</filename>. | ||
719 | </para> | ||
720 | |||
721 | <para> | ||
722 | When the OpenEmbedded build system uses a recipe to build a | ||
723 | target-architecture program (i.e. one that is intended for | ||
724 | inclusion on the image being built), that program eventually | ||
725 | runs from the root file system of that image. | ||
726 | Thus, the build system provides a value of "/usr/bin" for | ||
727 | <filename>bindir</filename>, a value of "/usr/lib" for | ||
728 | <filename>libdir</filename>, and so forth. | ||
729 | </para> | ||
730 | |||
731 | <para> | ||
732 | Meanwhile, <filename>DESTDIR</filename> is a path within the | ||
733 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
734 | However, when the recipe builds a native program (i.e. one | ||
735 | that is intended to run on the build machine), that program | ||
736 | is never installed directly to the build machine's root | ||
737 | file system. | ||
738 | Consequently, the build system uses paths within the Build | ||
739 | Directory for <filename>DESTDIR</filename>, | ||
740 | <filename>bindir</filename> and related variables. | ||
741 | To better understand this, consider the following two paths | ||
742 | where the first is relatively normal and the second is not: | ||
743 | <note> | ||
744 | Due to these lengthy examples, the paths are artificially | ||
745 | broke across lines for readability. | ||
746 | </note> | ||
747 | <literallayout class='monospaced'> | ||
748 | /home/maxtothemax/poky-bootchart2/build/tmp/work/i586-poky-linux/zlib/ | ||
749 | 1.2.8-r0/sysroot-destdir/usr/bin | ||
750 | |||
751 | /home/maxtothemax/poky-bootchart2/build/tmp/work/x86_64-linux/ | ||
752 | zlib-native/1.2.8-r0/sysroot-destdir/home/maxtothemax/poky-bootchart2/ | ||
753 | build/tmp/sysroots/x86_64-linux/usr/bin | ||
754 | </literallayout> | ||
755 | The standard <filename>DESTDIR</filename> mechanism leaves no | ||
756 | other choice. | ||
757 | </para> | ||
758 | </answer> | ||
759 | </qandaentry> | ||
760 | |||
761 | <qandaentry> | ||
762 | <question> | ||
763 | <para> | ||
764 | The files provided by my <filename>-native</filename> recipe do | ||
765 | not appear to be available to other recipes. | ||
766 | Files are missing from the native sysroot, my recipe is | ||
767 | installing to the wrong place, or I am getting permissions | ||
768 | errors during the do_install task in my recipe! What is wrong? | ||
769 | </para> | ||
770 | </question> | ||
771 | <answer> | ||
772 | <para> | ||
773 | This situation results when the OpenEmbedded build system does | ||
774 | not recognize the environment variables supplied to it by | ||
775 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>. | ||
776 | The incident that prompted this FAQ entry involved a Makefile | ||
777 | that used an environment variable named | ||
778 | <filename>BINDIR</filename> instead of the more standard | ||
779 | variable <filename>bindir</filename>. | ||
780 | The makefile's hardcoded default value of "/usr/bin" worked | ||
781 | most of the time, but not for the recipe's | ||
782 | <filename>-native</filename> variant. | ||
783 | Consequently, permissions errors might be caused by a Makefile | ||
784 | that ignores <filename>DESTDIR</filename> or uses a different | ||
785 | name for that environment variable. | ||
786 | Check the OpenEmbedded build system to see if these kinds of | ||
787 | issues exist. | ||
788 | </para> | ||
789 | </answer> | ||
790 | </qandaentry> | ||
685 | 791 | ||
686 | </qandaset> | 792 | </qandaset> |
687 | </chapter> | 793 | </chapter> |