summaryrefslogtreecommitdiff
blob: 313d2ef5b6e2c889a8df9c25dace3458e69c6c99 (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
50
51
52
53
--- a/configure.in
+++ b/configure.in
@@ -13,19 +13,20 @@
 AC_PROG_LIBTOOL
 
 # Checks for --enable args
-AC_MSG_CHECKING(whether to enable FreeType2 support)
-AC_ARG_ENABLE(ttf, [  --enable-ttf		enable FreeType2 support],
-	if [[[ "$enableval" = "yes" ]]]; then
-		AC_DEFINE(TTF_SUPPORT, [1], [Define to 1 to enable FreeType2 support])
-		CFLAGS="$CFLAGS `freetype-config --cflags`"
-		FTLIB="-lfreetype"
-		ttf_support="yes"
-	else
-		ttf_support="no"
-	fi,
-	ttf_support="no"
+AC_ARG_ENABLE(ttf, [  --enable-ttf		enable FreeType2 support],,enable_ttf=no)
+AS_IF([test "x$enable_ttf" = "xyes"], [
+	PKG_PROG_PKG_CONFIG
+	PKG_CHECK_MODULES(FREETYPE, freetype2,
+		[
+			AC_DEFINE(TTF_SUPPORT, [1], [Define to 1 to enable FreeType2 support])
+			CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
+			FTLIB="$FREETYPE_LIBS"
+		],
+		AC_MSG_ERROR([Cannot find freetype2])
+	)
+],
+	AC_MSG_RESULT(No Freetype is being used)
 )
-AC_MSG_RESULT($ttf_support)
 
 # Checks for libraries.
 AC_CHECK_LIB([g15], [writePixmapToLCD], ,AC_MSG_ERROR(["libg15 not found. please install it"]))
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,3 @@
-LLIBDIR=@LIBDIR@ 
-AM_CFLAGS=@CFLAGS@ 
 lib_LTLIBRARIES = libg15render.la
 libg15render_la_SOURCES = libg15render.h text.c pixel.c screen.c font_6x4.c font_7x5.c font_8x8.c
 libg15render_la_LIBADD = @FTLIB@
@@ -7,8 +5,7 @@
 include_HEADERS= libg15render.h
 EXTRA_DIST = debian Doxyfile libg15render.3
 man3_MANS = $(top_srcdir)/libg15render.3
-docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
-doc_DATA = AUTHORS ChangeLog COPYING NEWS README
+doc_DATA = AUTHORS ChangeLog NEWS README
 
 dist-hook:
 	rm -rf `find $(distdir)/debian -name .svn`