| Both sides previous revision Previous revision Next revision | Previous revision |
| docs:guide-developer:dependencies [2018/02/17 17:21] – ↷ Page moved from doc:devel:dependencies to docs:guide-developer:dependencies bobafetthotmail | docs:guide-developer:dependencies [2022/03/21 21:43] (current) – [Bugs] why not use the same environment variable the build system uses? russellsenior |
|---|
| |
| There is also a ''default 'y' SYMBOL'' directive but the author is hazy on the details. | There is also a ''default 'y' SYMBOL'' directive but the author is hazy on the details. |
| | |
| | :!: It is important to note that using ''select bar'' in ''Package/foo/config'' directives will select ''bar'' for building, but it will not be included in the dependencies when ''opkg'' installs ''foo'', nor will it guarantee that ''bar'' will be built before ''foo''. Using ''DEPENDS'' will take care of all that. |
| |
| ===== Caveats ===== | ===== Caveats ===== |
| Dependencies MAY NOT be circular (i.e. Package A may not depend on Package B, which in turn depends on Package A). If a circular dependency is created (whether directly or through another package), strange ''make menuconfig'' behaviour will be the result. | Dependencies MAY NOT be circular (i.e. Package A may not depend on Package B, which in turn depends on Package A). If a circular dependency is created (whether directly or through another package), strange ''make menuconfig'' behaviour will be the result. |
| |
| | ==== Using boolean operators ==== |
| | |
| | - The ''DEPENDS:@SYMBOL'' and ''DEPENDS:@SYMBOL:package'' syntax have good support for boolean operators, including parentheses, negation (''!''), ''&&'' and ''%%||%%''. |
| | |
| | - The support for operators in the ''DEPENDS:+SYMBOL:package'' syntax is limited. Negation ''!'' is only supported to negate the whole condition. Parentheses are ignored, so use them only for readability. |
| | Like C, ''&&'' has a higher precedence than ''%%||%%''. So ''+(YYY%%||%%FOO&&BAR):package'' will select package if ''CONFIG_YYY'' is set or if both ''CONFIG_FOO'' and ''CONFIG_BAR'' are set. You may use ''+YYY%%||%%(FOO&&BAR):package'' for readability, but :!: writing ''+(YYY%%||%%FOO)&&BAR:package'' will **not** change the condition to select package if either YYY or FOO is selected and BAR is selected. |
| ===== Bugs ===== | ===== Bugs ===== |
| |
| There may be bugs in the OpenWrt build system wrt to dependencies. If you can confirm that you have a dependency problem, please report a bug. The developers would appreciate the following information: | There may be bugs in the OpenWrt build system wrt to dependencies. If you can confirm that you have a dependency problem, please report a bug. The developers would appreciate the following information: |
| |
| * the relevant portions of ''$ROOTDIR/tmp/.config-package.in'' (where $ROOTDIR is your OpenWrt source root dir) | * the relevant portions of ''$TOPDIR/tmp/.config-package.in'' (where $TOPDIR is the directory where you checked out OpenWrt and where you initiate your builds) |
| |
| **NB** Many apparent bugs are caused by circular dependencies. The OpenWrt build system doesn't like circular dependencies. | **NB** Many apparent bugs are caused by circular dependencies. The OpenWrt build system doesn't like circular dependencies. |