diff options
| author | Ron Yorston <rmy@pobox.com> | 2024-05-27 14:05:45 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2024-05-27 14:05:45 +0100 |
| commit | 0224cfd5e5c8157e5bc74a81027fa508687abfbf (patch) | |
| tree | 7be9b074a979a67f03e69e3c9d69ed0bde4df8e1 /miscutils | |
| parent | bb999afb2f049f1168526142a1b0f5168b864f5d (diff) | |
| download | busybox-w32-0224cfd5e5c8157e5bc74a81027fa508687abfbf.tar.gz busybox-w32-0224cfd5e5c8157e5bc74a81027fa508687abfbf.tar.bz2 busybox-w32-0224cfd5e5c8157e5bc74a81027fa508687abfbf.zip | |
make: improved support for POSIX levels
The default POSIX level to be enforced in strict mode is now a
configuration option.
Print details of supported POSIX levels in the usage message.
Adds 56-64 bytes.
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/make.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 45cdac400..056cb2909 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
| @@ -29,6 +29,19 @@ | |||
| 29 | //config: - PDPMAKE_POSIXLY_CORRECT environment variable | 29 | //config: - PDPMAKE_POSIXLY_CORRECT environment variable |
| 30 | //config: Enable this if you want to check whether your makefiles are | 30 | //config: Enable this if you want to check whether your makefiles are |
| 31 | //config: POSIX compliant. This adds about 1.7 kb. | 31 | //config: POSIX compliant. This adds about 1.7 kb. |
| 32 | //config: | ||
| 33 | //config:choice | ||
| 34 | //config: prompt "Default POSIX level to enforce" | ||
| 35 | //config: depends on FEATURE_MAKE_POSIX | ||
| 36 | //config: default FEATURE_MAKE_POSIX_2017 | ||
| 37 | //config: | ||
| 38 | //config:config FEATURE_MAKE_POSIX_2017 | ||
| 39 | //config: bool "2017" | ||
| 40 | //config: | ||
| 41 | //config:config FEATURE_MAKE_POSIX_202X | ||
| 42 | //config: bool "202X" | ||
| 43 | //config: | ||
| 44 | //config:endchoice | ||
| 32 | 45 | ||
| 33 | //applet:IF_MAKE(APPLET(make, BB_DIR_USR_BIN, BB_SUID_DROP)) | 46 | //applet:IF_MAKE(APPLET(make, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 34 | //applet:IF_PDPMAKE(APPLET_ODDNAME(pdpmake, make, BB_DIR_USR_BIN, BB_SUID_DROP, make)) | 47 | //applet:IF_PDPMAKE(APPLET_ODDNAME(pdpmake, make, BB_DIR_USR_BIN, BB_SUID_DROP, make)) |
| @@ -64,6 +77,15 @@ | |||
| 64 | //usage: "\n -s Make silently" | 77 | //usage: "\n -s Make silently" |
| 65 | //usage: "\n -S Stop on error" | 78 | //usage: "\n -S Stop on error" |
| 66 | //usage: "\n -t Touch files instead of making them" | 79 | //usage: "\n -t Touch files instead of making them" |
| 80 | //usage: IF_FEATURE_MAKE_POSIX( | ||
| 81 | //usage: "\n\nThis build supports: non-POSIX extensions, POSIX 202X, POSIX 2017" | ||
| 82 | //usage: ) | ||
| 83 | //usage: IF_FEATURE_MAKE_POSIX_2017( | ||
| 84 | //usage: "\nIn strict POSIX mode the 2017 standard is enforced by default" | ||
| 85 | //usage: ) | ||
| 86 | //usage: IF_FEATURE_MAKE_POSIX_202X( | ||
| 87 | //usage: "\nIn strict POSIX mode the 202X standard is enforced by default" | ||
| 88 | //usage: ) | ||
| 67 | 89 | ||
| 68 | #include "libbb.h" | 90 | #include "libbb.h" |
| 69 | #include "bb_archive.h" | 91 | #include "bb_archive.h" |
| @@ -76,8 +98,10 @@ | |||
| 76 | 98 | ||
| 77 | #define POSIX_2017 (posix && posix_level == STD_POSIX_2017) | 99 | #define POSIX_2017 (posix && posix_level == STD_POSIX_2017) |
| 78 | 100 | ||
| 79 | #ifndef DEFAULT_POSIX_LEVEL | 101 | #if ENABLE_FEATURE_MAKE_POSIX_2017 |
| 80 | # define DEFAULT_POSIX_LEVEL STD_POSIX_2017 | 102 | # define DEFAULT_POSIX_LEVEL STD_POSIX_2017 |
| 103 | #else | ||
| 104 | # define DEFAULT_POSIX_LEVEL STD_POSIX_202X | ||
| 81 | #endif | 105 | #endif |
| 82 | 106 | ||
| 83 | #define OPTSTR1 "eij:+knqrsSt" | 107 | #define OPTSTR1 "eij:+knqrsSt" |
