diff options
author | Ron Yorston <rmy@pobox.com> | 2018-03-02 13:18:18 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-03-02 13:18:18 +0000 |
commit | 99daecdac917d149f4643e090cb705df135e2ed1 (patch) | |
tree | 22b1e8d57d97d36b2c46f6c93983fc06a1cd5ba7 | |
parent | 5b726f8a78c33e117c2a968739b1b4a6964905f8 (diff) | |
download | busybox-w32-99daecdac917d149f4643e090cb705df135e2ed1.tar.gz busybox-w32-99daecdac917d149f4643e090cb705df135e2ed1.tar.bz2 busybox-w32-99daecdac917d149f4643e090cb705df135e2ed1.zip |
Minor improvements to build
Exclude source files in libbb that aren't used by busybox-w32. This
speeds up the build marginally. They can always be reinstated if
necessary.
Provide fake routines for everything in inode_hash.c so that it
can be excluded. inode_hash.c is now unchanged from upstream.
Use last_char_is in has_exe_suffix_or_dot. It doesn't save any
bytes but it makes the code neater.
-rw-r--r-- | include/libbb.h | 8 | ||||
-rw-r--r-- | include/mingw.h | 1 | ||||
-rw-r--r-- | libbb/Kbuild.src | 31 | ||||
-rw-r--r-- | libbb/inode_hash.c | 2 | ||||
-rw-r--r-- | win32/mingw.c | 3 |
5 files changed, 22 insertions, 23 deletions
diff --git a/include/libbb.h b/include/libbb.h index f8e54de54..e816a2726 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1662,11 +1662,15 @@ int bb_xioctl(int fd, unsigned request, void *argp) FAST_FUNC; | |||
1662 | #define xioctl(fd,request,argp) bb_xioctl(fd,request,argp) | 1662 | #define xioctl(fd,request,argp) bb_xioctl(fd,request,argp) |
1663 | #endif | 1663 | #endif |
1664 | 1664 | ||
1665 | char *is_in_ino_dev_hashtable(const struct stat *statbuf) FAST_FUNC; | ||
1666 | #if !ENABLE_PLATFORM_MINGW32 | 1665 | #if !ENABLE_PLATFORM_MINGW32 |
1666 | char *is_in_ino_dev_hashtable(const struct stat *statbuf) FAST_FUNC; | ||
1667 | void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST_FUNC; | 1667 | void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST_FUNC; |
1668 | #endif | ||
1669 | void reset_ino_dev_hashtable(void) FAST_FUNC; | 1668 | void reset_ino_dev_hashtable(void) FAST_FUNC; |
1669 | #else | ||
1670 | #define add_to_ino_dev_hashtable(s, n) (void)0 | ||
1671 | #define is_in_ino_dev_hashtable(s) NULL | ||
1672 | #define reset_ino_dev_hashtable() | ||
1673 | #endif | ||
1670 | #ifdef __GLIBC__ | 1674 | #ifdef __GLIBC__ |
1671 | /* At least glibc has horrendously large inline for this, so wrap it */ | 1675 | /* At least glibc has horrendously large inline for this, so wrap it */ |
1672 | unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC; | 1676 | unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC; |
diff --git a/include/mingw.h b/include/mingw.h index 1bb2032cd..09903d582 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -435,7 +435,6 @@ const char * next_path_sep(const char *path); | |||
435 | #define is_absolute_path(path) ((path)[0] == '/' || (path)[0] == '\\' || has_dos_drive_prefix(path)) | 435 | #define is_absolute_path(path) ((path)[0] == '/' || (path)[0] == '\\' || has_dos_drive_prefix(path)) |
436 | 436 | ||
437 | #define find_mount_point(n, s) find_mount_point(n) | 437 | #define find_mount_point(n, s) find_mount_point(n) |
438 | #define add_to_ino_dev_hashtable(s, n) (void)0 | ||
439 | 438 | ||
440 | /* | 439 | /* |
441 | * helpers | 440 | * helpers |
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src index 4b838ab7a..9323a8968 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src | |||
@@ -13,12 +13,10 @@ INSERT | |||
13 | lib-y += appletlib.o | 13 | lib-y += appletlib.o |
14 | lib-y += ask_confirmation.o | 14 | lib-y += ask_confirmation.o |
15 | lib-y += bb_bswap_64.o | 15 | lib-y += bb_bswap_64.o |
16 | lib-y += bb_do_delay.o | ||
17 | lib-y += bb_pwd.o | 16 | lib-y += bb_pwd.o |
18 | lib-y += bb_qsort.o | 17 | lib-y += bb_qsort.o |
19 | #lib-y += bb_strtod.o | 18 | #lib-y += bb_strtod.o |
20 | lib-y += bb_strtonum.o | 19 | lib-y += bb_strtonum.o |
21 | lib-y += change_identity.o | ||
22 | lib-y += chomp.o | 20 | lib-y += chomp.o |
23 | lib-y += compare_string_array.o | 21 | lib-y += compare_string_array.o |
24 | lib-y += concat_path_file.o | 22 | lib-y += concat_path_file.o |
@@ -27,23 +25,18 @@ lib-y += copy_file.o | |||
27 | lib-y += copyfd.o | 25 | lib-y += copyfd.o |
28 | lib-y += crc32.o | 26 | lib-y += crc32.o |
29 | lib-y += default_error_retval.o | 27 | lib-y += default_error_retval.o |
30 | lib-y += device_open.o | ||
31 | lib-y += dump.o | 28 | lib-y += dump.o |
32 | lib-y += executable.o | 29 | lib-y += executable.o |
33 | lib-y += fclose_nonstdin.o | 30 | lib-y += fclose_nonstdin.o |
34 | lib-y += fflush_stdout_and_exit.o | 31 | lib-y += fflush_stdout_and_exit.o |
35 | lib-y += fgets_str.o | 32 | lib-y += fgets_str.o |
36 | lib-y += find_pid_by_name.o | 33 | lib-y += find_pid_by_name.o |
37 | lib-y += find_root_device.o | ||
38 | lib-y += full_write.o | 34 | lib-y += full_write.o |
39 | lib-y += get_last_path_component.o | 35 | lib-y += get_last_path_component.o |
40 | lib-y += get_line_from_file.o | 36 | lib-y += get_line_from_file.o |
41 | lib-y += getopt32.o | 37 | lib-y += getopt32.o |
42 | lib-y += get_volsize.o | ||
43 | lib-y += herror_msg.o | 38 | lib-y += herror_msg.o |
44 | lib-y += human_readable.o | 39 | lib-y += human_readable.o |
45 | lib-y += inet_common.o | ||
46 | lib-y += inode_hash.o | ||
47 | lib-y += isdirectory.o | 40 | lib-y += isdirectory.o |
48 | lib-y += last_char_is.o | 41 | lib-y += last_char_is.o |
49 | lib-y += lineedit.o lineedit_ptr_hack.o | 42 | lib-y += lineedit.o lineedit_ptr_hack.o |
@@ -56,16 +49,12 @@ lib-y += messages.o | |||
56 | lib-y += mode_string.o | 49 | lib-y += mode_string.o |
57 | lib-y += parse_mode.o | 50 | lib-y += parse_mode.o |
58 | lib-y += perror_msg.o | 51 | lib-y += perror_msg.o |
59 | lib-y += perror_nomsg.o | ||
60 | lib-y += perror_nomsg_and_die.o | 52 | lib-y += perror_nomsg_and_die.o |
61 | lib-y += pidfile.o | ||
62 | lib-y += platform.o | 53 | lib-y += platform.o |
63 | lib-y += printable.o | 54 | lib-y += printable.o |
64 | lib-y += printable_string.o | 55 | lib-y += printable_string.o |
65 | lib-y += print_flags.o | ||
66 | lib-y += process_escape_sequence.o | 56 | lib-y += process_escape_sequence.o |
67 | lib-y += procps.o | 57 | lib-y += procps.o |
68 | lib-y += progress.o | ||
69 | lib-y += ptr_to_globals.o | 58 | lib-y += ptr_to_globals.o |
70 | lib-y += read.o | 59 | lib-y += read.o |
71 | lib-y += read_printf.o | 60 | lib-y += read_printf.o |
@@ -78,12 +67,9 @@ lib-y += safe_strncpy.o | |||
78 | lib-y += safe_write.o | 67 | lib-y += safe_write.o |
79 | lib-y += securetty.o | 68 | lib-y += securetty.o |
80 | lib-y += setup_environment.o | 69 | lib-y += setup_environment.o |
81 | lib-y += simplify_path.o | ||
82 | lib-y += single_argv.o | 70 | lib-y += single_argv.o |
83 | lib-y += skip_whitespace.o | 71 | lib-y += skip_whitespace.o |
84 | lib-y += speed_table.o | ||
85 | lib-y += str_tolower.o | 72 | lib-y += str_tolower.o |
86 | lib-y += strrstr.o | ||
87 | lib-y += sysconf.o | 73 | lib-y += sysconf.o |
88 | lib-y += time.o | 74 | lib-y += time.o |
89 | lib-y += trim.o | 75 | lib-y += trim.o |
@@ -91,10 +77,8 @@ lib-y += u_signal_names.o | |||
91 | lib-y += uuencode.o | 77 | lib-y += uuencode.o |
92 | lib-y += verror_msg.o | 78 | lib-y += verror_msg.o |
93 | lib-y += vfork_daemon_rexec.o | 79 | lib-y += vfork_daemon_rexec.o |
94 | lib-y += warn_ignoring_args.o | ||
95 | lib-y += wfopen.o | 80 | lib-y += wfopen.o |
96 | lib-y += wfopen_input.o | 81 | lib-y += wfopen_input.o |
97 | lib-y += write.o | ||
98 | lib-y += xatonum.o | 82 | lib-y += xatonum.o |
99 | lib-y += xconnect.o | 83 | lib-y += xconnect.o |
100 | lib-y += xfuncs.o | 84 | lib-y += xfuncs.o |
@@ -105,15 +89,30 @@ lib-y += xreadlink.o | |||
105 | lib-y += xrealloc_vector.o | 89 | lib-y += xrealloc_vector.o |
106 | 90 | ||
107 | lib-$(CONFIG_PLATFORM_POSIX) += bb_askpass.o | 91 | lib-$(CONFIG_PLATFORM_POSIX) += bb_askpass.o |
92 | lib-$(CONFIG_PLATFORM_POSIX) += bb_do_delay.o | ||
93 | lib-$(CONFIG_PLATFORM_POSIX) += change_identity.o | ||
94 | lib-$(CONFIG_PLATFORM_POSIX) += device_open.o | ||
95 | lib-$(CONFIG_PLATFORM_POSIX) += find_root_device.o | ||
108 | lib-$(CONFIG_PLATFORM_POSIX) += get_console.o | 96 | lib-$(CONFIG_PLATFORM_POSIX) += get_console.o |
109 | lib-$(CONFIG_PLATFORM_POSIX) += getpty.o | 97 | lib-$(CONFIG_PLATFORM_POSIX) += getpty.o |
98 | lib-$(CONFIG_PLATFORM_POSIX) += get_volsize.o | ||
110 | lib-$(CONFIG_PLATFORM_POSIX) += inet_common.o | 99 | lib-$(CONFIG_PLATFORM_POSIX) += inet_common.o |
100 | lib-$(CONFIG_PLATFORM_POSIX) += inode_hash.o | ||
111 | lib-$(CONFIG_PLATFORM_POSIX) += kernel_version.o | 101 | lib-$(CONFIG_PLATFORM_POSIX) += kernel_version.o |
112 | lib-$(CONFIG_PLATFORM_POSIX) += login.o | 102 | lib-$(CONFIG_PLATFORM_POSIX) += login.o |
113 | lib-$(CONFIG_PLATFORM_POSIX) += makedev.o | 103 | lib-$(CONFIG_PLATFORM_POSIX) += makedev.o |
104 | lib-$(CONFIG_PLATFORM_POSIX) += perror_nomsg.o | ||
105 | lib-$(CONFIG_PLATFORM_POSIX) += pidfile.o | ||
106 | lib-$(CONFIG_PLATFORM_POSIX) += print_flags.o | ||
107 | lib-$(CONFIG_PLATFORM_POSIX) += progress.o | ||
114 | lib-$(CONFIG_PLATFORM_POSIX) += read_key.o | 108 | lib-$(CONFIG_PLATFORM_POSIX) += read_key.o |
115 | lib-$(CONFIG_PLATFORM_POSIX) += signals.o | 109 | lib-$(CONFIG_PLATFORM_POSIX) += signals.o |
110 | lib-$(CONFIG_PLATFORM_POSIX) += simplify_path.o | ||
111 | lib-$(CONFIG_PLATFORM_POSIX) += speed_table.o | ||
112 | lib-$(CONFIG_PLATFORM_POSIX) += strrstr.o | ||
116 | lib-$(CONFIG_PLATFORM_POSIX) += udp_io.o | 113 | lib-$(CONFIG_PLATFORM_POSIX) += udp_io.o |
114 | lib-$(CONFIG_PLATFORM_POSIX) += warn_ignoring_args.o | ||
115 | lib-$(CONFIG_PLATFORM_POSIX) += write.o | ||
117 | lib-$(CONFIG_PLATFORM_POSIX) += xgethostbyname.o | 116 | lib-$(CONFIG_PLATFORM_POSIX) += xgethostbyname.o |
118 | 117 | ||
119 | lib-$(CONFIG_PLATFORM_LINUX) += match_fstype.o | 118 | lib-$(CONFIG_PLATFORM_LINUX) += match_fstype.o |
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c index 770d1a286..4142813e3 100644 --- a/libbb/inode_hash.c +++ b/libbb/inode_hash.c | |||
@@ -55,7 +55,6 @@ char* FAST_FUNC is_in_ino_dev_hashtable(const struct stat *statbuf) | |||
55 | return NULL; | 55 | return NULL; |
56 | } | 56 | } |
57 | 57 | ||
58 | #if !ENABLE_PLATFORM_MINGW32 | ||
59 | /* Add statbuf to statbuf hash table */ | 58 | /* Add statbuf to statbuf hash table */ |
60 | void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) | 59 | void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) |
61 | { | 60 | { |
@@ -77,7 +76,6 @@ void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char * | |||
77 | bucket->next = ino_dev_hashtable[i]; | 76 | bucket->next = ino_dev_hashtable[i]; |
78 | ino_dev_hashtable[i] = bucket; | 77 | ino_dev_hashtable[i] = bucket; |
79 | } | 78 | } |
80 | #endif | ||
81 | 79 | ||
82 | #if ENABLE_DU || ENABLE_FEATURE_CLEAN_UP | 80 | #if ENABLE_DU || ENABLE_FEATURE_CLEAN_UP |
83 | /* Clear statbuf hash table */ | 81 | /* Clear statbuf hash table */ |
diff --git a/win32/mingw.c b/win32/mingw.c index a58cb7b01..bedf14784 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1090,8 +1090,7 @@ int has_exe_suffix(const char *name) | |||
1090 | 1090 | ||
1091 | int has_exe_suffix_or_dot(const char *name) | 1091 | int has_exe_suffix_or_dot(const char *name) |
1092 | { | 1092 | { |
1093 | int len = strlen(name); | 1093 | return last_char_is(name, '.') || has_win_suffix(name, 0); |
1094 | return (len > 0 && name[len-1] == '.') || has_win_suffix(name, 0); | ||
1095 | } | 1094 | } |
1096 | 1095 | ||
1097 | /* check if path can be made into an executable by adding a suffix; | 1096 | /* check if path can be made into an executable by adding a suffix; |