]> git.wh0rd.org Git - fontconfig.git/blob - fontconfig-config.in
Clean up autoconf install to obey DESTDIR
[fontconfig.git] / fontconfig-config.in
1 #! /bin/sh
2
3 prefix="@prefix@"
4 exec_prefix="@exec_prefix@"
5 libdir="@libdir@"
6 includedir="@includedir@"
7 version="@PACKAGE_VERSION@"
8
9 usage()
10 {
11   cat <<EOF
12 Usage: fontconfig-config [OPTIONS] [LIBRARIES]
13 Options:
14  [--prefix[=DIR]]
15  [--exec-prefix[=DIR]]
16  [--version]
17  [--libs]
18  [--cflags]
19 EOF
20   exit $1
21 }
22
23 if test $# -eq 0 ; then
24   usage 1 1>&2
25 fi
26
27 while 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
64 done
65
66 if test "$local_prefix" = "yes" ; then
67     if test "$exec_prefix_set" != "yes" ; then
68       exec_prefix=$prefix
69     fi
70 fi
71
72 if test "$echo_prefix" = "yes" ; then
73  echo $prefix
74 fi
75
76 if test "$echo_exec_prefix" = "yes" ; then
77  echo $exec_prefix
78 fi
79
80 if test "$echo_cflags" = "yes" ; then
81  cflags="-I${includedir}"
82  echo $cflags
83 fi
84
85 if 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
92 fi
93
94 # EOF