Skip to content

Commit 9f859e9

Browse files
no1wudixiaoxiang781216
authored andcommitted
posix_spawn: Move dependencies to Kconfig
`posix_spawn` depends on these configurations: - !BINFMT_DISABLE - !DISABLE_MOUNTPOINT - BOARDCTL - BOARDCTL_APP_SYMTAB - ELF - FS_ROMFS Check them in compile time may waste some time if the dependencies are not met, move them to Kconfig to avoid this. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
1 parent 3c4ddd2 commit 9f859e9

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

examples/posix_spawn/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
config EXAMPLES_POSIXSPAWN
77
tristate "posix_spawn Unit Test"
88
default n
9+
depends on !BINFMT_DISABLE
10+
depends on !DISABLE_MOUNTPOINT
11+
depends on BOARDCTL
12+
depends on BOARDCTL_APP_SYMTAB
13+
depends on ELF
14+
depends on FS_ROMFS
915
---help---
1016
Enable the posix_spawn() unit test
1117

examples/posix_spawn/spawn_main.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,38 +45,6 @@
4545
* Pre-processor Definitions
4646
****************************************************************************/
4747

48-
/* Check configuration. This is not all of the configuration settings that
49-
* are required -- only the more obvious.
50-
*/
51-
52-
#ifdef CONFIG_BINFMT_DISABLE
53-
# error "The binary loader is disabled (CONFIG_BINFMT_DISABLE)!"
54-
#endif
55-
56-
#ifndef CONFIG_ELF
57-
# error "You must select CONFIG_ELF in your configuration file"
58-
#endif
59-
60-
#ifndef CONFIG_FS_ROMFS
61-
# error "You must select CONFIG_FS_ROMFS in your configuration file"
62-
#endif
63-
64-
#ifdef CONFIG_DISABLE_MOUNTPOINT
65-
# error "You must not disable mountpoints via CONFIG_DISABLE_MOUNTPOINT in your configuration file"
66-
#endif
67-
68-
#ifdef CONFIG_BINFMT_DISABLE
69-
# error "You must not disable loadable modules via CONFIG_BINFMT_DISABLE in your configuration file"
70-
#endif
71-
72-
#ifndef CONFIG_BOARDCTL
73-
# error "This configuration requires CONFIG_BOARDCTL"
74-
#endif
75-
76-
#ifndef CONFIG_BOARDCTL_APP_SYMTAB
77-
# error "You must enable the symobol table interface with CONFIG_BOARDCTL_APP_SYMTAB"
78-
#endif
79-
8048
/* Describe the ROMFS file system */
8149

8250
#define SECTORSIZE 512

0 commit comments

Comments
 (0)