]> git.wh0rd.org - fontconfig.git/blame - fontconfig-config.in
A few autoconf build fixes
[fontconfig.git] / fontconfig-config.in
CommitLineData
2eafe090
KP
1#! /bin/sh
2
c9f55ecb
KP
3prefix="@prefix@"
4exec_prefix="@exec_prefix@"
5libdir="@libdir@"
6includedir="@includedir@"
7version="@PACKAGE_VERSION@"
2eafe090
KP
8
9usage()
10{
11 cat <<EOF
12Usage: fontconfig-config [OPTIONS] [LIBRARIES]
13Options:
14 [--prefix[=DIR]]
15 [--exec-prefix[=DIR]]
16 [--version]
17 [--libs]
18 [--cflags]
19EOF
20 exit $1
21}
22
23if test $# -eq 0 ; then
24 usage 1 1>&2
25fi
26
27while test $# -gt 0 ; do
28 case "$1" in
29 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
30 *) optarg= ;;
31 esac
32
33 case $1 in
34 --prefix=*)
35 prefix=$optarg
36 local_prefix=yes
37 ;;
38 --prefix)
39 echo_prefix=yes
40 ;;
41 --exec-prefix=*)
42 exec_prefix=$optarg
43 exec_prefix_set=yes
44 local_prefix=yes
45 ;;
46 --exec-prefix)
47 echo_exec_prefix=yes
48 ;;
49 --version)
50 echo $version
51 exit 0
52 ;;
53 --cflags)
54 echo_cflags=yes
55 ;;
56 --libs)
57 echo_libs=yes
58 ;;
59 *)
60 usage 1 1>&2
61 ;;
62 esac
63 shift
64done
65
66if test "$local_prefix" = "yes" ; then
67 if test "$exec_prefix_set" != "yes" ; then
68 exec_prefix=$prefix
69 fi
70fi
71
72if test "$echo_prefix" = "yes" ; then
73 echo $prefix
74fi
75
76if test "$echo_exec_prefix" = "yes" ; then
77 echo $exec_prefix
78fi
79
80if test "$echo_cflags" = "yes" ; then
81 cflags="-I${includedir}"
82 echo $cflags
83fi
84
85if test "$echo_libs" = "yes" ; then
86 libs="-lfontconfig"
87 if test "${libdir}" != "/usr/lib" ; then
88 echo -L${libdir} $libs
89 else
90 echo $libs
91 fi
92fi
93
94# EOF