build system: produce link map. Rather useful when you
[oweals/busybox.git] / scripts / trylink
1 #!/bin/sh
2
3 debug=false
4
5 try() {
6     added="$1"
7     shift
8     $debug && echo "Trying: $* $added"
9     "$@" $added >busybox.map 2>busybox_ld.err \
10     && exit 0
11 }
12
13 try "" "$@"
14 try "-lm" "$@"
15 try "-lcrypt" "$@"
16 try "-Wl,--start-group -lcrypt -lm -Wl,--end-group" "$@"
17 # It failed. Let people see the error messages
18 cat busybox_ld.err