1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff --git a/tools/configure b/tools/configure
index 277436d..332de42 100755
--- a/tools/configure
+++ b/tools/configure
@@ -118,7 +118,7 @@ simcc () {
  winbuild="$crosscompile"
  GCCOPTS='-W -Wall -g -fno-builtin'
  GCCOPTIMIZE=''
- LDOPTS=''
+ LDOPTS='-lm' # button-sdl.c uses sqrt()

  # default output binary name
  output="rockboxui"
@@ -130,7 +130,7 @@ simcc () {
    CYGWIN*)
    echo "Cygwin host detected"

-   LDOPTS="-mconsole"
+   LDOPTS="$LDOPTS -mconsole"
    output="rockboxui.exe"
    winbuild="yes"
    ;;
@@ -138,21 +138,24 @@ simcc () {
    MINGW*)
    echo "MinGW host detected"

-   LDOPTS="-mconsole"
+   LDOPTS="$LDOPTS -mconsole"
    output="rockboxui.exe"
    winbuild="yes"
    ;;

    Linux)
    echo "Linux host detected"
+   LDOPTS="$LDOPTS -ldl"
    ;;

    FreeBSD)
    echo "FreeBSD host detected"
+   LDOPTS="$LDOPTS -ldl"
    ;;

    Darwin)
    echo "Darwin host detected"
+   LDOPTS="$LDOPTS -ldl"

    SHARED_FLAG="-dynamiclib -Wl\,-single_module"
    ;;
@@ -161,7 +164,6 @@ simcc () {
    echo "*Solaris host detected"

    GCCOPTS="$GCCOPTS -fPIC"
-   LDOPTS="-lm"
    ;;

    *)