OpenWrt BuildPackage - depend

I. Introduction

        The knowledge involved in this article comes from the OpenWrt Wiki official website

2. Syntax supported by DEPENDS field

1. +<foo>

        Indicates that the current software package needs to depend on the software package foo. When menuconfig is used, when the current software package is selected, the software package foo will also be automatically selected. When the current software package is unselected, whether the software package foo will be selected is determined by the original selected state of foo. Examples are as follows:

 <*> myapp......................... myapp
 -*- foo........................... foo
2. <foo>

        Indicates that the current software package needs to depend on the software package foo. When menuconfig is used, the options of the current software package are only visible when the software package foo is selected. Examples are as follows

foo选中前:
 < > foo......................... foo

foo选中后:
 <*> foo......................... foo
 < > myapp......................... myapp
3. @FOO

        Indicates that the current package depends on the configuration option CONFIG_FOO. When menuconfig is used, the current package option will not be visible unless CONFIG_FOO is set. This is often used to make the current software package dependent on a certain Linux version or target board. For example, @TARGET_ramips_mt7620_DEVICE_y1s will make the software package only applicable to the ramips_mt7620_DEVICE_y1s target board. You can also use Boolean expressions to express complex dependencies, for example @(!TARGET_FOO||!TARGET_BAR) will make the current package unavailable for foo and bar.

4. +FOO:<bar>

        Indicates that if the compilation option CONFIG_FOO is set, the current software package depends on the software package bar. When the current software package is selected, the software package bar will also be automatically selected. Typical applications are: For example, the current software package has a certain option. When selected, it depends on the corresponding external library. For example, the Makefile of OpenWrt's base-files has such an application.

5. @FOO:<bar>

        Indicates that if the CONFIG_FOO option is selected, the current package depends on the package bar. The current package is only visible when CONFIG_FOO is set and the package bar is selected.

6. Some typical dependency configuration symbols

TARGET_<foo>: Indicates that it depends on Target foo being selected.

TARGET_<foo>_<bar>: Indicates that the sub-Target bar that depends on Target foo is selected, which is a dependence on the sub-Target of Target foo.

TARGET_<foo>_<bar>_<baz>: This is a subgoal that depends on the subgoal of Target foo.

LINUX_3_X: The version that depends on the Linux kernel is 3.x.*.

LINUX_2_6_X: Depends on the Linux kernel version 2.6.x.*.

LINUX_2_4: Only applicable to Linux version 2.4.

USE_ULIBC, USE_GLIBC, USE_EGLIBC: Depend on a certain kind of libc.

BROKEN: Package cannot be built or run, only shown when "Show broken targets/packages" is selected. Prevent build failure from accidentally selecting a package.

IPv6: Relies on the system supporting IPv6.

三. PKG_BUILD_DEPENDS

        PKG_BUILD_DEPENDS does not use + or @. Other usages are the same as DEPENDS. PKG_BUILD_DEPENDS uses the name of PKG_NANE instead of a single software package. For example, if you want openssl to be a dependency, you can write PKG_BUILD_DEPENDS:=openssl, and when your Package depends on and select openssl. You should write DEPENDS:=+libopenssl. Note, but there is only openssl under the package. If it is a software package that the host needs to build, write it as PKG_BUILD_DEPENDS:=openssl/host.

4. Summary

        This article introduces how to use dependencies related to the OpenWrt package.

Guess you like

Origin blog.csdn.net/to_be_better_wen/article/details/132435891