diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/lxdialog/check-lxdialog.sh | 6 | ||||
-rwxr-xr-x | scripts/trylink | 17 |
2 files changed, 15 insertions, 8 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 5552154cb..acabe385c 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh | |||
@@ -19,7 +19,11 @@ ldflags() | |||
19 | # Where is ncurses.h? | 19 | # Where is ncurses.h? |
20 | ccflags() | 20 | ccflags() |
21 | { | 21 | { |
22 | if [ -f /usr/include/ncurses/ncurses.h ]; then | 22 | if [ -f /usr/include/ncursesw/ncurses.h ]; then |
23 | echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>"' | ||
24 | elif [ -f /usr/include/ncursesw/curses.h ]; then | ||
25 | echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' | ||
26 | elif [ -f /usr/include/ncurses/ncurses.h ]; then | ||
23 | echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' | 27 | echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' |
24 | elif [ -f /usr/include/ncurses/curses.h ]; then | 28 | elif [ -f /usr/include/ncurses/curses.h ]; then |
25 | echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' | 29 | echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' |
diff --git a/scripts/trylink b/scripts/trylink index 8c8854679..164f5274c 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
@@ -85,6 +85,9 @@ LDLIBS="$7" | |||
85 | # The --sort-section option is not supported by older versions of ld | 85 | # The --sort-section option is not supported by older versions of ld |
86 | SORT_SECTION=`check_cc "-Wl,--sort-section,alignment" ""` | 86 | SORT_SECTION=`check_cc "-Wl,--sort-section,alignment" ""` |
87 | 87 | ||
88 | # gold may not support --sort-common (yet) | ||
89 | SORT_COMMON=`check_cc "-Wl,--sort-common" ""` | ||
90 | |||
88 | # Static linking against glibc produces buggy executables | 91 | # Static linking against glibc produces buggy executables |
89 | # (glibc does not cope well with ld --gc-sections). | 92 | # (glibc does not cope well with ld --gc-sections). |
90 | # See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 | 93 | # See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 |
@@ -114,7 +117,7 @@ l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` | |||
114 | test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group" | 117 | test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group" |
115 | try $CC $CFLAGS $LDFLAGS \ | 118 | try $CC $CFLAGS $LDFLAGS \ |
116 | -o $EXE \ | 119 | -o $EXE \ |
117 | -Wl,--sort-common \ | 120 | $SORT_COMMON \ |
118 | $SORT_SECTION \ | 121 | $SORT_SECTION \ |
119 | $GC_SECTIONS \ | 122 | $GC_SECTIONS \ |
120 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ | 123 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ |
@@ -139,7 +142,7 @@ while test "$LDLIBS"; do | |||
139 | $debug && echo "Trying -l options: '$l_list'" | 142 | $debug && echo "Trying -l options: '$l_list'" |
140 | try $CC $CFLAGS $LDFLAGS \ | 143 | try $CC $CFLAGS $LDFLAGS \ |
141 | -o $EXE \ | 144 | -o $EXE \ |
142 | -Wl,--sort-common \ | 145 | $SORT_COMMON \ |
143 | $SORT_SECTION \ | 146 | $SORT_SECTION \ |
144 | $GC_SECTIONS \ | 147 | $GC_SECTIONS \ |
145 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ | 148 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ |
@@ -171,7 +174,7 @@ test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group" | |||
171 | if ! test -f busybox_ldscript; then | 174 | if ! test -f busybox_ldscript; then |
172 | try $CC $CFLAGS $LDFLAGS \ | 175 | try $CC $CFLAGS $LDFLAGS \ |
173 | -o $EXE \ | 176 | -o $EXE \ |
174 | -Wl,--sort-common \ | 177 | $SORT_COMMON \ |
175 | $SORT_SECTION \ | 178 | $SORT_SECTION \ |
176 | $GC_SECTIONS \ | 179 | $GC_SECTIONS \ |
177 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ | 180 | -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \ |
@@ -193,7 +196,7 @@ else | |||
193 | # Hmm, "ld --sort-section alignment" should do it too. | 196 | # Hmm, "ld --sort-section alignment" should do it too. |
194 | try $CC $CFLAGS $LDFLAGS \ | 197 | try $CC $CFLAGS $LDFLAGS \ |
195 | -o $EXE \ | 198 | -o $EXE \ |
196 | -Wl,--sort-common \ | 199 | $SORT_COMMON \ |
197 | $SORT_SECTION \ | 200 | $SORT_SECTION \ |
198 | $GC_SECTIONS \ | 201 | $GC_SECTIONS \ |
199 | -Wl,-T,busybox_ldscript \ | 202 | -Wl,-T,busybox_ldscript \ |
@@ -228,7 +231,7 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then | |||
228 | -Wl,-z,combreloc \ | 231 | -Wl,-z,combreloc \ |
229 | -Wl,-soname="libbusybox.so.$BB_VER" \ | 232 | -Wl,-soname="libbusybox.so.$BB_VER" \ |
230 | -Wl,--undefined=lbb_main \ | 233 | -Wl,--undefined=lbb_main \ |
231 | -Wl,--sort-common \ | 234 | $SORT_COMMON \ |
232 | $SORT_SECTION \ | 235 | $SORT_SECTION \ |
233 | -Wl,--start-group $A_FILES -Wl,--end-group \ | 236 | -Wl,--start-group $A_FILES -Wl,--end-group \ |
234 | $l_list \ | 237 | $l_list \ |
@@ -249,7 +252,7 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then | |||
249 | EXE="$sharedlib_dir/busybox_unstripped" | 252 | EXE="$sharedlib_dir/busybox_unstripped" |
250 | try $CC $CFLAGS $LDFLAGS \ | 253 | try $CC $CFLAGS $LDFLAGS \ |
251 | -o $EXE \ | 254 | -o $EXE \ |
252 | -Wl,--sort-common \ | 255 | $SORT_COMMON \ |
253 | $SORT_SECTION \ | 256 | $SORT_SECTION \ |
254 | $GC_SECTIONS \ | 257 | $GC_SECTIONS \ |
255 | -Wl,--start-group $O_FILES -Wl,--end-group \ | 258 | -Wl,--start-group $O_FILES -Wl,--end-group \ |
@@ -288,7 +291,7 @@ int main(int argc, char **argv) | |||
288 | EXE="$sharedlib_dir/$name" | 291 | EXE="$sharedlib_dir/$name" |
289 | try $CC $CFLAGS $LDFLAGS "$sharedlib_dir/applet.c" \ | 292 | try $CC $CFLAGS $LDFLAGS "$sharedlib_dir/applet.c" \ |
290 | -o $EXE \ | 293 | -o $EXE \ |
291 | -Wl,--sort-common \ | 294 | $SORT_COMMON \ |
292 | $SORT_SECTION \ | 295 | $SORT_SECTION \ |
293 | $GC_SECTIONS \ | 296 | $GC_SECTIONS \ |
294 | -L"$sharedlib_dir" -lbusybox \ | 297 | -L"$sharedlib_dir" -lbusybox \ |