aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-03-02 13:18:18 +0000
committerRon Yorston <rmy@pobox.com>2018-03-02 13:18:18 +0000
commit99daecdac917d149f4643e090cb705df135e2ed1 (patch)
tree22b1e8d57d97d36b2c46f6c93983fc06a1cd5ba7
parent5b726f8a78c33e117c2a968739b1b4a6964905f8 (diff)
downloadbusybox-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.h8
-rw-r--r--include/mingw.h1
-rw-r--r--libbb/Kbuild.src31
-rw-r--r--libbb/inode_hash.c2
-rw-r--r--win32/mingw.c3
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
1665char *is_in_ino_dev_hashtable(const struct stat *statbuf) FAST_FUNC;
1666#if !ENABLE_PLATFORM_MINGW32 1665#if !ENABLE_PLATFORM_MINGW32
1666char *is_in_ino_dev_hashtable(const struct stat *statbuf) FAST_FUNC;
1667void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST_FUNC; 1667void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST_FUNC;
1668#endif
1669void reset_ino_dev_hashtable(void) FAST_FUNC; 1668void 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 */
1672unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC; 1676unsigned 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
13lib-y += appletlib.o 13lib-y += appletlib.o
14lib-y += ask_confirmation.o 14lib-y += ask_confirmation.o
15lib-y += bb_bswap_64.o 15lib-y += bb_bswap_64.o
16lib-y += bb_do_delay.o
17lib-y += bb_pwd.o 16lib-y += bb_pwd.o
18lib-y += bb_qsort.o 17lib-y += bb_qsort.o
19#lib-y += bb_strtod.o 18#lib-y += bb_strtod.o
20lib-y += bb_strtonum.o 19lib-y += bb_strtonum.o
21lib-y += change_identity.o
22lib-y += chomp.o 20lib-y += chomp.o
23lib-y += compare_string_array.o 21lib-y += compare_string_array.o
24lib-y += concat_path_file.o 22lib-y += concat_path_file.o
@@ -27,23 +25,18 @@ lib-y += copy_file.o
27lib-y += copyfd.o 25lib-y += copyfd.o
28lib-y += crc32.o 26lib-y += crc32.o
29lib-y += default_error_retval.o 27lib-y += default_error_retval.o
30lib-y += device_open.o
31lib-y += dump.o 28lib-y += dump.o
32lib-y += executable.o 29lib-y += executable.o
33lib-y += fclose_nonstdin.o 30lib-y += fclose_nonstdin.o
34lib-y += fflush_stdout_and_exit.o 31lib-y += fflush_stdout_and_exit.o
35lib-y += fgets_str.o 32lib-y += fgets_str.o
36lib-y += find_pid_by_name.o 33lib-y += find_pid_by_name.o
37lib-y += find_root_device.o
38lib-y += full_write.o 34lib-y += full_write.o
39lib-y += get_last_path_component.o 35lib-y += get_last_path_component.o
40lib-y += get_line_from_file.o 36lib-y += get_line_from_file.o
41lib-y += getopt32.o 37lib-y += getopt32.o
42lib-y += get_volsize.o
43lib-y += herror_msg.o 38lib-y += herror_msg.o
44lib-y += human_readable.o 39lib-y += human_readable.o
45lib-y += inet_common.o
46lib-y += inode_hash.o
47lib-y += isdirectory.o 40lib-y += isdirectory.o
48lib-y += last_char_is.o 41lib-y += last_char_is.o
49lib-y += lineedit.o lineedit_ptr_hack.o 42lib-y += lineedit.o lineedit_ptr_hack.o
@@ -56,16 +49,12 @@ lib-y += messages.o
56lib-y += mode_string.o 49lib-y += mode_string.o
57lib-y += parse_mode.o 50lib-y += parse_mode.o
58lib-y += perror_msg.o 51lib-y += perror_msg.o
59lib-y += perror_nomsg.o
60lib-y += perror_nomsg_and_die.o 52lib-y += perror_nomsg_and_die.o
61lib-y += pidfile.o
62lib-y += platform.o 53lib-y += platform.o
63lib-y += printable.o 54lib-y += printable.o
64lib-y += printable_string.o 55lib-y += printable_string.o
65lib-y += print_flags.o
66lib-y += process_escape_sequence.o 56lib-y += process_escape_sequence.o
67lib-y += procps.o 57lib-y += procps.o
68lib-y += progress.o
69lib-y += ptr_to_globals.o 58lib-y += ptr_to_globals.o
70lib-y += read.o 59lib-y += read.o
71lib-y += read_printf.o 60lib-y += read_printf.o
@@ -78,12 +67,9 @@ lib-y += safe_strncpy.o
78lib-y += safe_write.o 67lib-y += safe_write.o
79lib-y += securetty.o 68lib-y += securetty.o
80lib-y += setup_environment.o 69lib-y += setup_environment.o
81lib-y += simplify_path.o
82lib-y += single_argv.o 70lib-y += single_argv.o
83lib-y += skip_whitespace.o 71lib-y += skip_whitespace.o
84lib-y += speed_table.o
85lib-y += str_tolower.o 72lib-y += str_tolower.o
86lib-y += strrstr.o
87lib-y += sysconf.o 73lib-y += sysconf.o
88lib-y += time.o 74lib-y += time.o
89lib-y += trim.o 75lib-y += trim.o
@@ -91,10 +77,8 @@ lib-y += u_signal_names.o
91lib-y += uuencode.o 77lib-y += uuencode.o
92lib-y += verror_msg.o 78lib-y += verror_msg.o
93lib-y += vfork_daemon_rexec.o 79lib-y += vfork_daemon_rexec.o
94lib-y += warn_ignoring_args.o
95lib-y += wfopen.o 80lib-y += wfopen.o
96lib-y += wfopen_input.o 81lib-y += wfopen_input.o
97lib-y += write.o
98lib-y += xatonum.o 82lib-y += xatonum.o
99lib-y += xconnect.o 83lib-y += xconnect.o
100lib-y += xfuncs.o 84lib-y += xfuncs.o
@@ -105,15 +89,30 @@ lib-y += xreadlink.o
105lib-y += xrealloc_vector.o 89lib-y += xrealloc_vector.o
106 90
107lib-$(CONFIG_PLATFORM_POSIX) += bb_askpass.o 91lib-$(CONFIG_PLATFORM_POSIX) += bb_askpass.o
92lib-$(CONFIG_PLATFORM_POSIX) += bb_do_delay.o
93lib-$(CONFIG_PLATFORM_POSIX) += change_identity.o
94lib-$(CONFIG_PLATFORM_POSIX) += device_open.o
95lib-$(CONFIG_PLATFORM_POSIX) += find_root_device.o
108lib-$(CONFIG_PLATFORM_POSIX) += get_console.o 96lib-$(CONFIG_PLATFORM_POSIX) += get_console.o
109lib-$(CONFIG_PLATFORM_POSIX) += getpty.o 97lib-$(CONFIG_PLATFORM_POSIX) += getpty.o
98lib-$(CONFIG_PLATFORM_POSIX) += get_volsize.o
110lib-$(CONFIG_PLATFORM_POSIX) += inet_common.o 99lib-$(CONFIG_PLATFORM_POSIX) += inet_common.o
100lib-$(CONFIG_PLATFORM_POSIX) += inode_hash.o
111lib-$(CONFIG_PLATFORM_POSIX) += kernel_version.o 101lib-$(CONFIG_PLATFORM_POSIX) += kernel_version.o
112lib-$(CONFIG_PLATFORM_POSIX) += login.o 102lib-$(CONFIG_PLATFORM_POSIX) += login.o
113lib-$(CONFIG_PLATFORM_POSIX) += makedev.o 103lib-$(CONFIG_PLATFORM_POSIX) += makedev.o
104lib-$(CONFIG_PLATFORM_POSIX) += perror_nomsg.o
105lib-$(CONFIG_PLATFORM_POSIX) += pidfile.o
106lib-$(CONFIG_PLATFORM_POSIX) += print_flags.o
107lib-$(CONFIG_PLATFORM_POSIX) += progress.o
114lib-$(CONFIG_PLATFORM_POSIX) += read_key.o 108lib-$(CONFIG_PLATFORM_POSIX) += read_key.o
115lib-$(CONFIG_PLATFORM_POSIX) += signals.o 109lib-$(CONFIG_PLATFORM_POSIX) += signals.o
110lib-$(CONFIG_PLATFORM_POSIX) += simplify_path.o
111lib-$(CONFIG_PLATFORM_POSIX) += speed_table.o
112lib-$(CONFIG_PLATFORM_POSIX) += strrstr.o
116lib-$(CONFIG_PLATFORM_POSIX) += udp_io.o 113lib-$(CONFIG_PLATFORM_POSIX) += udp_io.o
114lib-$(CONFIG_PLATFORM_POSIX) += warn_ignoring_args.o
115lib-$(CONFIG_PLATFORM_POSIX) += write.o
117lib-$(CONFIG_PLATFORM_POSIX) += xgethostbyname.o 116lib-$(CONFIG_PLATFORM_POSIX) += xgethostbyname.o
118 117
119lib-$(CONFIG_PLATFORM_LINUX) += match_fstype.o 118lib-$(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 */
60void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) 59void 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
1091int has_exe_suffix_or_dot(const char *name) 1091int 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;