Merge 25584, 25588.
[reactos.git] / reactos / dll / 3rdparty / freetype / builds / unix / freetype-config.in
1 #! /bin/sh
2 #
3 # Copyright 2000, 2001, 2002, 2003, 2004, 2005 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
12 prefix=@prefix@
13 exec_prefix=@exec_prefix@
14 exec_prefix_set=no
15 includedir=@includedir@
16 libdir=@libdir@
17 enable_shared=@enable_shared@
18 wl=@wl@
19 hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@'
20
21 usage()
22 {
23 cat <<EOF
24 Usage: freetype-config [OPTION]...
25 Get FreeType compilation and linking information.
26
27 Options:
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
40 EOF
41 exit $1
42 }
43
44 if test $# -eq 0 ; then
45 usage 1 1>&2
46 fi
47
48 while 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 @ft_version@
76 exit 0
77 ;;
78 --ftversion)
79 major=`grep define @prefix@/include/freetype2/freetype/freetype.h \
80 | grep FREETYPE_MAJOR \
81 | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
82 minor=`grep define @prefix@/include/freetype2/freetype/freetype.h \
83 | grep FREETYPE_MINOR \
84 | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
85 patch=`grep define @prefix@/include/freetype2/freetype/freetype.h \
86 | grep FREETYPE_PATCH \
87 | sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
88 echo $major.$minor.$patch
89 exit 0
90 ;;
91 --cflags)
92 echo_cflags=yes
93 ;;
94 --libs)
95 echo_libs=yes
96 ;;
97 --libtool)
98 echo_libtool=yes
99 ;;
100 *)
101 usage 1 1>&2
102 ;;
103 esac
104 shift
105 done
106
107 if test "$local_prefix" = "yes" ; then
108 if test "$exec_prefix_set" != "yes" ; then
109 exec_prefix=$prefix
110 fi
111 fi
112
113 if test "$echo_prefix" = "yes" ; then
114 echo $prefix
115 fi
116
117 if test "$echo_exec_prefix" = "yes" ; then
118 echo $exec_prefix
119 fi
120
121 if test "$exec_prefix_set" = "yes" ; then
122 libdir=$exec_prefix/lib
123 else
124 if test "$local_prefix" = "yes" ; then
125 includedir=$prefix/include
126 libdir=$prefix/lib
127 fi
128 fi
129
130 if test "$echo_cflags" = "yes" ; then
131 cflags="-I$includedir/freetype2"
132 if test "$includedir" != "/usr/include" ; then
133 echo $cflags -I$includedir
134 else
135 echo $cflags
136 fi
137 fi
138
139 if test "$echo_libs" = "yes" ; then
140 rpath=
141 if test "$enable_shared" = "yes" ; then
142 eval "rpath=\"$hardcode_libdir_flag_spec\""
143 fi
144 libs="-lfreetype @LIBZ@ @FT2_EXTRA_LIBS@"
145 if test "$libdir" != "/usr/lib" && test "$libdir" != "/usr/lib64"; then
146 echo -L$libdir $rpath $libs
147 else
148 echo $libs
149 fi
150 fi
151
152 if test "$echo_libtool" = "yes" ; then
153 convlib="libfreetype.la"
154 echo $libdir/$convlib
155 fi
156
157 # EOF