3 # Copyright (C) 2000-2020 by
4 # David Turner, Robert Wilhelm, and Werner Lemberg.
6 # This file is part of the FreeType project, and may only be used, modified,
7 # and distributed under the terms of the FreeType project license,
8 # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 # indicate that you have read the license and understand and accept it
16 # if `pkg-config' is available, use values from `freetype2.pc'
17 %PKG_CONFIG% --atleast-pkgconfig-version 0.24 >/dev/null 2>&1
18 if test $? -eq 0 ; then
19 # note that option `--variable' is not affected by the
20 # PKG_CONFIG_SYSROOT_DIR environment variable
21 if test "x$SYSROOT" != "x" ; then
22 PKG_CONFIG_SYSROOT_DIR="$SYSROOT"
23 export PKG_CONFIG_SYSROOT_DIR
26 prefix=`%PKG_CONFIG% --variable prefix freetype2`
27 exec_prefix=`%PKG_CONFIG% --variable exec_prefix freetype2`
29 includedir=`%PKG_CONFIG% --variable includedir freetype2`
30 libdir=`%PKG_CONFIG% --variable libdir freetype2`
32 version=`%PKG_CONFIG% --modversion freetype2`
34 cflags=`%PKG_CONFIG% --cflags freetype2`
35 dynamic_libs=`%PKG_CONFIG% --libs freetype2`
36 static_libs=`%PKG_CONFIG% --static --libs freetype2`
39 exec_prefix="%exec_prefix%"
41 includedir="%includedir%"
46 cflags="-I${SYSROOT}$includedir/freetype2"
47 dynamic_libs="-lfreetype"
48 static_libs="%LIBSSTATIC_CONFIG%"
49 if test "${SYSROOT}$libdir" != "/usr/lib" &&
50 test "${SYSROOT}$libdir" != "/usr/lib64" ; then
51 libs_L="-L${SYSROOT}$libdir"
56 orig_exec_prefix=$exec_prefix
58 orig_includedir=$includedir
61 include_suffix=`echo $includedir | sed "s|$prefix||"`
62 lib_suffix=`echo $libdir | sed "s|$exec_prefix||"`
68 Usage: freetype-config [OPTION]...
69 Get FreeType compilation and linking information.
72 --prefix display \`--prefix' value used for building the
74 --prefix=PREFIX override \`--prefix' value with PREFIX
75 --exec-prefix display \`--exec-prefix' value used for building
77 --exec-prefix=EPREFIX override \`--exec-prefix' value with EPREFIX
78 --version display libtool version of the FreeType library
79 --ftversion display FreeType version number
80 --libs display flags for linking with the FreeType library
81 --libtool display library name for linking with libtool
82 --cflags display flags for compiling with the FreeType
84 --static make command line options display flags
86 --help display this help and exit
92 if test $# -eq 0 ; then
97 while test $# -gt 0 ; do
100 optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
153 if test "$local_prefix" = "yes" ; then
154 if test "$exec_prefix_set" != "yes" ; then
159 if test "$local_prefix" = "yes" ; then
160 includedir=${prefix}${include_suffix}
161 if test "$exec_prefix_set" = "yes" ; then
162 libdir=${exec_prefix}${lib_suffix}
164 libdir=${prefix}${lib_suffix}
169 if test "$echo_version" = "yes" ; then
173 if test "$echo_prefix" = "yes" ; then
174 echo ${SYSROOT}$prefix
177 if test "$echo_exec_prefix" = "yes" ; then
178 echo ${SYSROOT}$exec_prefix
181 if test "$echo_ft_version" = "yes" ; then
182 major=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
183 | grep FREETYPE_MAJOR \
184 | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
185 minor=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
186 | grep FREETYPE_MINOR \
187 | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
188 patch=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
189 | grep FREETYPE_PATCH \
190 | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
191 echo $major.$minor.$patch
194 if test "$echo_cflags" = "yes" ; then
195 echo $cflags | sed "s|$orig_includedir/freetype2|$includedir/freetype2|"
198 if test "$echo_libs" = "yes" ; then
199 if test "$show_static" = "yes" ; then
200 libs="$libs_L $static_libs"
202 libs="$libs_L $dynamic_libs"
204 echo $libs | sed "s|$orig_libdir|$libdir|"
207 if test "$echo_libtool" = "yes" ; then
208 echo ${SYSROOT}$libdir/libfreetype.la