Revert manifest to default one
[external/cups.git] / cups-config.in
1 #! /bin/sh
2 #
3 # "$Id: cups-config.in 9153 2010-06-16 00:48:25Z mike $"
4
5 #   CUPS configuration utility.
6 #
7 #   Copyright 2007-2010 by Apple Inc.
8 #   Copyright 2001-2006 by Easy Software Products, all rights reserved.
9 #
10 #   These coded instructions, statements, and computer programs are the
11 #   property of Apple Inc. and are protected by Federal copyright
12 #   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
13 #   which should have been included with this file.  If this file is
14 #   file is missing or damaged, see the license at "http://www.cups.org/".
15 #
16
17 VERSION="@CUPS_VERSION@"
18 APIVERSION="1.5"
19 BUILD="@CUPS_BUILD@"
20
21 prefix=@prefix@
22 exec_prefix=@exec_prefix@
23 bindir=@bindir@
24 includedir=@includedir@
25 libdir=@libdir@
26 imagelibdir=@libdir@
27 datarootdir=@datadir@
28 datadir=@datadir@
29 sysconfdir=@sysconfdir@
30 cups_datadir=@CUPS_DATADIR@
31 cups_serverbin=@CUPS_SERVERBIN@
32 cups_serverroot=@CUPS_SERVERROOT@
33 INSTALLSTATIC=@INSTALLSTATIC@
34
35 # flags for C++ compiler:
36 CFLAGS=""
37 LDFLAGS="@EXPORT_LDFLAGS@"
38 LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
39 IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
40
41 # Check for local invocation...
42 selfdir=`dirname $0`
43
44 if test -f "$selfdir/cups/cups.h"; then
45     CFLAGS="-I$selfdir"
46     LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
47     libdir="$selfdir/cups"
48     imagelibdir="$selfdir/filter"
49     if test ! -f "$selfdir/cups/raster.h"; then
50         ln -s ../filter/raster.h "$selfdir/cups"
51     fi
52 else
53     if test $includedir != /usr/include; then
54         CFLAGS="$CFLAGS -I$includedir"
55     fi
56
57     if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
58         LDFLAGS="$LDFLAGS -L$libdir"
59     fi
60 fi
61
62
63 usage ()
64 {
65     echo "Usage: cups-config --api-version"
66     echo "       cups-config --build"
67     echo "       cups-config --cflags"
68     echo "       cups-config --datadir"
69     echo "       cups-config --help"
70     echo "       cups-config --ldflags"
71     echo "       cups-config [--driver] [--image] [--static] --libs"
72     echo "       cups-config --serverbin"
73     echo "       cups-config --serverroot"
74     echo "       cups-config --version"
75
76     exit $1
77 }
78
79 if test $# -eq 0; then
80     usage 1
81 fi
82
83 # Parse command line options
84 static=no
85 image=no
86 driver=no
87
88 while test $# -gt 0; do
89     case $1 in
90         --api-version)
91             echo $APIVERSION
92             ;;
93         --build)
94             echo $BUILD
95             ;;
96         --cflags)
97             echo $CFLAGS
98             ;;
99         --datadir)
100             echo $cups_datadir
101             ;;
102         --driver)
103             driver=yes
104             ;;
105         --help)
106             usage 0
107             ;;
108         --image)
109             image=yes
110             ;;
111         --ldflags)
112             echo $LDFLAGS
113             ;;
114         --libs)
115             if test $static = no; then
116                 libs="@EXTLINKCUPS@ $LIBS";
117                 if test $image = yes; then
118                     libs="@EXTLINKCUPSIMAGE@ $libs"
119                 fi
120                 if test $driver = yes; then
121                     libs="@EXTLINKCUPSDRIVER@ $libs"
122                 fi
123             else
124                 libs="$libdir/libcups.a $LIBS";
125                 if test $image = yes; then
126                     libs="$libdir/libcupsimage.a $IMGLIBS $libs"
127                 fi
128                 if test $driver = yes; then
129                     libs="$libdir/libcupsdriver.a $libs"
130                 fi
131             fi
132             echo $libs
133             ;;
134         --serverbin)
135             echo $cups_serverbin
136             ;;
137         --serverroot)
138             echo $cups_serverroot
139             ;;
140         --static)
141             if test -z "$INSTALLSTATIC"; then
142                 echo "WARNING: Static libraries not installed!" >&2
143             else
144                 static=yes
145             fi
146             ;;
147         --version)
148             echo $VERSION
149             ;;
150         *)
151             usage 1
152             ;;
153     esac
154
155     shift
156 done
157
158 #
159 # End of "$Id: cups-config.in 9153 2010-06-16 00:48:25Z mike $".
160 #