Ticket #41862: freetype-config(x64)

File freetype-config(x64), 3.5 KB (added by dscottj431@…, 10 years ago)
Line 
1#! /bin/sh
2#
3# Copyright 2000-2005, 2008, 2009, 2013 by
4# David Turner, Robert Wilhelm, and Werner Lemberg.
5#
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
10# fully.
11
12LC_ALL=C
13export LC_ALL
14
15prefix="/opt/local"
16exec_prefix="/opt/local"
17exec_prefix_set="no"
18includedir="/opt/local/include"
19libdir="/opt/local/lib"
20enable_shared=""
21
22usage()
23{
24  cat <<EOF
25Usage: freetype-config [OPTION]...
26Get FreeType compilation and linking information.
27
28Options:
29  --prefix               display \`--prefix' value used for building the
30                         FreeType library
31  --prefix=PREFIX        override \`--prefix' value with PREFIX
32  --exec-prefix          display \`--exec-prefix' value used for building
33                         the FreeType library
34  --exec-prefix=EPREFIX  override \`--exec-prefix' value with EPREFIX
35  --version              display libtool version of the FreeType library
36  --ftversion            display FreeType version number
37  --libs                 display flags for linking with the FreeType library
38  --libtool              display library name for linking with libtool
39  --cflags               display flags for compiling with the FreeType
40                         library
41EOF
42  exit $1
43}
44
45if test $# -eq 0 ; then
46  usage 1 1>&2
47fi
48
49while test $# -gt 0 ; do
50  case "$1" in
51  -*=*)
52    optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
53    ;;
54  *)
55    optarg=
56    ;;
57  esac
58
59  case $1 in
60  --prefix=*)
61    prefix=$optarg
62    local_prefix=yes
63    ;;
64  --prefix)
65    echo_prefix=yes
66    ;;
67  --exec-prefix=*)
68    exec_prefix=$optarg
69    exec_prefix_set=yes
70    local_prefix=yes
71    ;;
72  --exec-prefix)
73    echo_exec_prefix=yes
74    ;;
75  --version)
76    echo 17.1.11
77    exit 0
78    ;;
79  --ftversion)
80    echo_ft_version=yes
81    ;;
82  --cflags)
83    echo_cflags=yes
84    ;;
85  --libs)
86    echo_libs=yes
87    ;;
88  --libtool)
89    echo_libtool=yes
90    ;;
91  *)
92    usage 1 1>&2
93    ;;
94  esac
95  shift
96done
97
98if test "$local_prefix" = "yes" ; then
99  if test "$exec_prefix_set" != "yes" ; then
100    exec_prefix=$prefix
101  fi
102fi
103
104if test "$echo_prefix" = "yes" ; then
105  echo ${SYSROOT}$prefix
106fi
107
108if test "$echo_exec_prefix" = "yes" ; then
109  echo ${SYSROOT}$exec_prefix
110fi
111
112if test "$exec_prefix_set" = "yes" ; then
113  libdir=$exec_prefix/lib
114else
115  if test "$local_prefix" = "yes" ; then
116    includedir=$prefix/include
117    libdir=$prefix/lib
118  fi
119fi
120
121if test "$echo_ft_version" = "yes" ; then
122  major=`grep define ${SYSROOT}$includedir/freetype2/freetype.h \
123         | grep FREETYPE_MAJOR \
124         | sed 's/.*[   ]\([0-9][0-9]*\).*/\1/'`
125  minor=`grep define ${SYSROOT}$includedir/freetype2/freetype.h \
126         | grep FREETYPE_MINOR \
127         | sed 's/.*[   ]\([0-9][0-9]*\).*/\1/'`
128  patch=`grep define ${SYSROOT}$includedir/freetype2/freetype.h \
129         | grep FREETYPE_PATCH \
130         | sed 's/.*[   ]\([0-9][0-9]*\).*/\1/'`
131  echo $major.$minor.$patch
132fi
133
134if test "$echo_cflags" = "yes" ; then
135  cflags="-I${SYSROOT}$includedir/freetype2"
136  echo $cflags
137fi
138
139if test "$echo_libs" = "yes" ; then
140  libs="-lfreetype -lz -lbz2 -lpng15 "
141  if test "${SYSROOT}$libdir" != "/usr/lib"  &&
142     test "${SYSROOT}$libdir" != "/usr/lib64"; then
143    echo -L${SYSROOT}$libdir $libs
144  else
145    echo $libs
146  fi
147fi
148
149if test "$echo_libtool" = "yes" ; then
150  convlib="libfreetype.la"
151  echo ${SYSROOT}$libdir/$convlib
152fi
153
154# EOF