]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | #! /bin/sh |
2 | # | |
f7deaa1a | 3 | # "$Id: cups-config.in 5919 2006-08-31 04:20:45Z mike $" |
ef416fc2 | 4 | # |
5 | # CUPS configuration utility. | |
6 | # | |
bd7854cb | 7 | # Copyright 2001-2006 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | # |
9 | # These coded instructions, statements, and computer programs are the | |
10 | # property of Easy Software Products and are protected by Federal | |
11 | # copyright law. Distribution and use rights are outlined in the file | |
12 | # "LICENSE.txt" which should have been included with this file. If this | |
13 | # file is missing or damaged please contact Easy Software Products | |
14 | # at: | |
15 | # | |
16 | # Attn: CUPS Licensing Information | |
17 | # Easy Software Products | |
18 | # 44141 Airport View Drive, Suite 204 | |
19 | # Hollywood, Maryland 20636 USA | |
20 | # | |
21 | # Voice: (301) 373-9600 | |
22 | # EMail: cups-info@cups.org | |
23 | # WWW: http://www.cups.org | |
24 | # | |
25 | ||
26 | VERSION="@CUPS_VERSION@" | |
f7deaa1a | 27 | APIVERSION="1.3" |
ef416fc2 | 28 | |
29 | prefix=@prefix@ | |
30 | exec_prefix=@exec_prefix@ | |
31 | bindir=@bindir@ | |
32 | includedir=@includedir@ | |
33 | libdir=@libdir@ | |
f301802f | 34 | imagelibdir=@libdir@ |
d09495fa | 35 | datarootdir=@datadir@ |
ef416fc2 | 36 | datadir=@datadir@ |
37 | sysconfdir=@sysconfdir@ | |
38 | cups_datadir=@CUPS_DATADIR@ | |
39 | cups_serverbin=@CUPS_SERVERBIN@ | |
40 | cups_serverroot=@CUPS_SERVERROOT@ | |
bd7854cb | 41 | INSTALLSTATIC=@INSTALLSTATIC@ |
ef416fc2 | 42 | |
43 | # flags for C++ compiler: | |
44 | CFLAGS="" | |
45 | LDFLAGS="@EXPORT_LDFLAGS@" | |
f7deaa1a | 46 | LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@" |
8ca02f3c | 47 | IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@" |
ef416fc2 | 48 | |
f301802f | 49 | # Check for local invocation... |
50 | selfdir=`dirname $0` | |
51 | ||
52 | if test -f "$selfdir/cups/cups.h"; then | |
53 | CFLAGS="-I$selfdir" | |
54 | LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS" | |
55 | libdir="$selfdir/cups" | |
56 | imagelibdir="$selfdir/filter" | |
ed486911 | 57 | if test ! -f "$selfdir/cups/raster.h"; then |
f301802f | 58 | ln -s ../filter/raster.h "$selfdir/cups" |
59 | fi | |
60 | else | |
61 | if test $includedir != /usr/include; then | |
62 | CFLAGS="$CFLAGS -I$includedir" | |
63 | fi | |
ef416fc2 | 64 | |
f301802f | 65 | if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then |
66 | LDFLAGS="$LDFLAGS -L$libdir" | |
67 | fi | |
ef416fc2 | 68 | fi |
69 | ||
f301802f | 70 | |
ef416fc2 | 71 | usage () |
72 | { | |
73 | echo "Usage: cups-config --api-version" | |
74 | echo " cups-config --cflags" | |
75 | echo " cups-config --datadir" | |
76 | echo " cups-config --help" | |
77 | echo " cups-config --ldflags" | |
78 | echo " cups-config [--image] [--static] --libs" | |
79 | echo " cups-config --serverbin" | |
80 | echo " cups-config --serverroot" | |
81 | echo " cups-config --version" | |
82 | ||
83 | exit $1 | |
84 | } | |
85 | ||
86 | if test $# -eq 0; then | |
87 | usage 1 | |
88 | fi | |
89 | ||
90 | # Parse command line options | |
91 | static=no | |
92 | image=no | |
93 | ||
94 | while test $# -gt 0; do | |
95 | case $1 in | |
96 | --api-version) | |
97 | echo $APIVERSION | |
98 | ;; | |
99 | --cflags) | |
100 | echo $CFLAGS | |
101 | ;; | |
102 | --datadir) | |
103 | echo $cups_datadir | |
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 | if test $image = no; then | |
117 | echo -lcups $LIBS | |
118 | else | |
8ca02f3c | 119 | echo -lcupsimage -lcups $IMGLIBS $LIBS |
ef416fc2 | 120 | fi |
121 | else | |
122 | if test $image = no; then | |
123 | echo $libdir/libcups.a $LIBS | |
124 | else | |
8ca02f3c | 125 | echo $imagelibdir/libcupsimage.a $libdir/libcups.a $IMGLIBS $LIBS |
ef416fc2 | 126 | fi |
127 | fi | |
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 | # | |
f7deaa1a | 154 | # End of "$Id: cups-config.in 5919 2006-08-31 04:20:45Z mike $". |
ef416fc2 | 155 | # |