summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype/freetype.ac
blob: 8d4d63fd386616cfaafd4d9fb2c62d5f714b805f (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
54
55
56
57
58
59
60
61
if test "$needs_freetype" = no; then
  FREETYPECPPFLAGS=
  LDFREETYPE=
  FREETYPEDEP=
else
  EXTRA_FREETYPE_INCLUDE=
  EXTRA_FREETYPE_LIBDIR=

  if test "$with_system_freetype" = yes; then
    if test "x$with_freetype_libdir" != x; then
      EXTRA_FREETYPE_LIBDIR="-L$with_freetype_libdir"
    fi
    if test "x$with_freetype_include" != x; then
      EXTRA_FREETYPE_INCLUDE="-I$with_freetype_include"
    fi
  fi

  # be sure we have a good value for CPP, since we're about to save it.
  AC_PROG_CPP
  
  OLD_LDFLAGS=$LDFLAGS
  OLD_CPP=$CPP
  OLD_LIBS=$LIBS

  LDFLAGS="$LDFLAGS $EXTRA_FREETYPE_LIBDIR"
  CPP="$CPP $EXTRA_FREETYPE_INCLUDE"

  if test "$with_system_freetype" = yes; then
    AC_CHECK_LIB(ttf, TT_Init_FreeType,,
      AC_MSG_WARN(Standard FREETYPE library not found. Compiling my own.)
      with_system_freetype=no)
  fi

  if test "$with_system_freetype" = yes; then
    AC_CHECK_HEADERS(freetype.h)
    if test "$ac_cv_header_freetype_h" != yes; then
      AC_MSG_WARN(freetype.h not found. Using my own freetype sources.)
      with_system_freetype=no
    fi
  fi

  LDFLAGS=$OLD_LDFLAGS
  CPP=$OLD_CPP
  LIBS=$OLD_LIBS

  if test "$with_system_freetype" != yes; then
    FREETYPECPPFLAGS='-I$(FREETYPEDIR)/lib -I$(FREETYPESRCDIR)/lib'
    LDFREETYPE='$(FREETYPEDIR)/lib/.libs/libttf.a'
    FREETYPEDEP='$(FREETYPEDIR)/lib/.libs/libttf.a'
    using_system_freetype=no
  else
    FREETYPECPPFLAGS="$EXTRA_FREETYPE_INCLUDE"
    LDFREETYPE="$EXTRA_FREETYPE_LIBDIR -lttf"
    FREETYPEDEP=
    using_system_freetype=yes
  fi
fi

AC_SUBST(FREETYPECPPFLAGS)
AC_SUBST(LDFREETYPE)
AC_SUBST(FREETYPEDEP)