summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype2.ac
blob: 0fc3780c07e416ea54fd1fa23dcbc919bea172b1 (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
if test "$needs_freetype2" = no; then
  FREETYPE2CPPFLAGS=
  LDFREETYPE2=
  FREETYPE2DEP=
else
  EXTRA_FREETYPE2_INCLUDE=
  EXTRA_FREETYPE2_LIBDIR=

  if test "$with_system_freetype2" = yes; then
    if test "x$with_freetype2_libdir" != x; then
      EXTRA_FREETYPE2_LIBDIR="-L$with_freetype2_libdir"
    fi
    if test "x$with_freetype2_include" != x; then
      EXTRA_FREETYPE2_INCLUDE="-I$with_freetype2_include -I$with_freetype2_include/freetype2"
    fi
  fi

  OLD_LDFLAGS=$LDFLAGS
  OLD_CPPFLAGS=$CPPFLAGS
  OLD_LIBS=$LIBS

  LDFLAGS="$LDFLAGS $EXTRA_FREETYPE2_LIBDIR"
  CPPFLAGS="$CPPFLAGS $EXTRA_FREETYPE2_INCLUDE"

  if test "$with_system_freetype2" = yes; then
    AC_CHECK_LIB(freetype, FT_Init_FreeType,,
      AC_MSG_WARN(Standard FreeType2 library not found. Compiling my own.)
      with_system_freetype2=no)
  fi

  if test "$with_system_freetype2" = yes; then
    AC_CHECK_HEADERS(ft2build.h)
    if test "$ac_cv_header_ft2build_h" != yes; then
      AC_MSG_WARN(ft2build.h not found. Using my own freetype2 sources.)
      with_system_freetype2=no
    fi
  fi

  LDFLAGS=$OLD_LDFLAGS
  CPPFLAGS=$OLD_CPPFLAGS
  LIBS=$OLD_LIBS

  if test "$with_system_freetype2" != yes; then
    FREETYPE2CPPFLAGS='-I$(FREETYPE2SRCDIR)/include'
    LDFREETYPE2='$(FREETYPE2DIR)/.libs/libfreetype.a'
    FREETYPE2DEP='$(FREETYPE2DIR)/.libs/libfreetype.a'
    using_system_freetype2=no
  else
    FREETYPE2CPPFLAGS="$EXTRA_FREETYPE2_INCLUDE"
    LDFREETYPE2="$EXTRA_FREETYPE2_LIBDIR -lfreetype"
    FREETYPE2DEP=
    using_system_freetype2=yes
  fi
fi

AC_SUBST(FREETYPE2CPPFLAGS)
AC_SUBST(LDFREETYPE2)
AC_SUBST(FREETYPE2DEP)