summaryrefslogtreecommitdiff
path: root/package/directfb/directfb-1.4.10-add-missing-lm-flag-patch.patch
blob: b07f0c5aa5f202ea9cfc1c4f20ea90ea241d7556 (plain)
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
From dbf8fd1d097420d02f0603155ca81fcc7e232a0a Mon Sep 17 00:00:00 2001
From: Lionel Landwerlin <llandwerlin@gmail.com>
Date: Sun, 7 Nov 2010 21:45:19 +0100
Subject: [PATCH] Add -lm flag when nedded

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
---
 configure.in          |   14 ++++++++++++++
 src/media/Makefile.am |    2 +-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 78c842d..aa608d4 100644
--- a/configure.in
+++ b/configure.in
@@ -533,6 +533,20 @@ AM_CONDITIONAL(DIRECTFB_BUILD_PURE_VOODOO, test "$DIRECTFB_BUILD_PURE_VOODOO" =
 
 AC_SUBST(DEP_VOODOO)
 
+dnl If we're not building a pure voodoo lib, we need the sqrt symbol
+dnl for src/media/idirectfbfont.c
+MEDIALIB=""
+if test "$enable_pure_voodoo" = "no"; then
+  AC_CHECK_LIB(m, sqrt,
+    MEDIALIB="-lm",
+    AC_MSG_ERROR([
+*** DirectFB requires libm.]))
+  if test "$enable_shared" = "yes"; then
+    DYNLIB+=" $MEDIALIB"
+    AC_SUBST(DYNLIB)
+  fi
+fi
+AC_SUBST(MEDIALIB)
 
 AM_CONDITIONAL(ENABLE_MULTI, test "$enable_multi" = "yes")
 
diff --git a/src/media/Makefile.am b/src/media/Makefile.am
index 1a39a25..a4bdb10 100644
--- a/src/media/Makefile.am
+++ b/src/media/Makefile.am
@@ -35,4 +35,4 @@ libdirectfb_media_la_SOURCES = \
 	idirectfbdatabuffer_file.c	\
 	idirectfbdatabuffer_memory.c	\
 	idirectfbdatabuffer_streamed.c
-
+libdirectfb_media_la_LDFLAGS = $(MEDIALIB)
-- 
1.7.2.3