Ticket #29986: freetype-config.2

File freetype-config.2, 3.7 KB (added by opus@…, 13 years ago)

destroot-x86_64 freetype-config

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