]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | #! /bin/sh |
2 | # | |
bc44d920 | 3 | # "$Id: cups-config.in 6649 2007-07-11 21:46:42Z mike $" |
ef416fc2 | 4 | # |
5 | # CUPS configuration utility. | |
6 | # | |
bc44d920 | 7 | # Copyright 2007 by Apple Inc. |
bd7854cb | 8 | # Copyright 2001-2006 by Easy Software Products, all rights reserved. |
ef416fc2 | 9 | # |
10 | # These coded instructions, statements, and computer programs are the | |
bc44d920 | 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/". | |
ef416fc2 | 15 | # |
16 | ||
17 | VERSION="@CUPS_VERSION@" | |
50fe7201 | 18 | APIVERSION="1.4" |
ef416fc2 | 19 | |
20 | prefix=@prefix@ | |
21 | exec_prefix=@exec_prefix@ | |
22 | bindir=@bindir@ | |
23 | includedir=@includedir@ | |
24 | libdir=@libdir@ | |
f301802f | 25 | imagelibdir=@libdir@ |
d09495fa | 26 | datarootdir=@datadir@ |
ef416fc2 | 27 | datadir=@datadir@ |
28 | sysconfdir=@sysconfdir@ | |
29 | cups_datadir=@CUPS_DATADIR@ | |
30 | cups_serverbin=@CUPS_SERVERBIN@ | |
31 | cups_serverroot=@CUPS_SERVERROOT@ | |
bd7854cb | 32 | INSTALLSTATIC=@INSTALLSTATIC@ |
ef416fc2 | 33 | |
34 | # flags for C++ compiler: | |
35 | CFLAGS="" | |
36 | LDFLAGS="@EXPORT_LDFLAGS@" | |
f7deaa1a | 37 | LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@" |
8ca02f3c | 38 | IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@" |
ef416fc2 | 39 | |
f301802f | 40 | # Check for local invocation... |
41 | selfdir=`dirname $0` | |
42 | ||
43 | if test -f "$selfdir/cups/cups.h"; then | |
44 | CFLAGS="-I$selfdir" | |
45 | LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS" | |
46 | libdir="$selfdir/cups" | |
47 | imagelibdir="$selfdir/filter" | |
ed486911 | 48 | if test ! -f "$selfdir/cups/raster.h"; then |
f301802f | 49 | ln -s ../filter/raster.h "$selfdir/cups" |
50 | fi | |
51 | else | |
52 | if test $includedir != /usr/include; then | |
53 | CFLAGS="$CFLAGS -I$includedir" | |
54 | fi | |
ef416fc2 | 55 | |
f301802f | 56 | if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then |
57 | LDFLAGS="$LDFLAGS -L$libdir" | |
58 | fi | |
ef416fc2 | 59 | fi |
60 | ||
f301802f | 61 | |
ef416fc2 | 62 | usage () |
63 | { | |
64 | echo "Usage: cups-config --api-version" | |
65 | echo " cups-config --cflags" | |
66 | echo " cups-config --datadir" | |
67 | echo " cups-config --help" | |
68 | echo " cups-config --ldflags" | |
50fe7201 | 69 | echo " cups-config [--driver] [--image] [--static] --libs" |
ef416fc2 | 70 | echo " cups-config --serverbin" |
71 | echo " cups-config --serverroot" | |
72 | echo " cups-config --version" | |
73 | ||
74 | exit $1 | |
75 | } | |
76 | ||
77 | if test $# -eq 0; then | |
78 | usage 1 | |
79 | fi | |
80 | ||
81 | # Parse command line options | |
82 | static=no | |
83 | image=no | |
50fe7201 | 84 | driver=no |
ef416fc2 | 85 | |
86 | while test $# -gt 0; do | |
87 | case $1 in | |
88 | --api-version) | |
89 | echo $APIVERSION | |
90 | ;; | |
91 | --cflags) | |
92 | echo $CFLAGS | |
93 | ;; | |
94 | --datadir) | |
95 | echo $cups_datadir | |
96 | ;; | |
50fe7201 MS |
97 | --driver) |
98 | driver=yes | |
99 | ;; | |
ef416fc2 | 100 | --help) |
101 | usage 0 | |
102 | ;; | |
103 | --image) | |
104 | image=yes | |
105 | ;; | |
106 | --ldflags) | |
107 | echo $LDFLAGS | |
108 | ;; | |
109 | --libs) | |
110 | if test $static = no; then | |
50fe7201 MS |
111 | libs="-lcups $LIBS"; |
112 | if test $image = yes; then | |
113 | libs="-lcupsimage $libs" | |
114 | fi | |
115 | if test $driver = yes; then | |
116 | libs="-lcupsdriver $libs" | |
117 | fi | |
ef416fc2 | 118 | else |
50fe7201 MS |
119 | libs="$libdir/libcups.a $LIBS"; |
120 | if test $image = yes; then | |
121 | libs="$libdir/libcupsimage.a $IMGLIBS $libs" | |
122 | fi | |
123 | if test $driver = yes; then | |
124 | libs="$libdir/libcupsdriver.a $libs" | |
ef416fc2 | 125 | fi |
126 | fi | |
50fe7201 | 127 | echo $libs |
ef416fc2 | 128 | ;; |
129 | --serverbin) | |
130 | echo $cups_serverbin | |
131 | ;; | |
132 | --serverroot) | |
133 | echo $cups_serverroot | |
134 | ;; | |
135 | --static) | |
bd7854cb | 136 | if test -z "$INSTALLSTATIC"; then |
137 | echo "WARNING: Static libraries not installed!" >&2 | |
138 | else | |
139 | static=yes | |
140 | fi | |
ef416fc2 | 141 | ;; |
142 | --version) | |
143 | echo $VERSION | |
144 | ;; | |
145 | *) | |
146 | usage 1 | |
147 | ;; | |
148 | esac | |
149 | ||
150 | shift | |
151 | done | |
152 | ||
153 | # | |
bc44d920 | 154 | # End of "$Id: cups-config.in 6649 2007-07-11 21:46:42Z mike $". |
ef416fc2 | 155 | # |