]>
Commit | Line | Data |
---|---|---|
74456259 | 1 | #! /bin/sh |
2 | # | |
c9d3f842 | 3 | # "$Id$" |
74456259 | 4 | # |
5 | # CUPS configuration utility. | |
6 | # | |
8081be77 | 7 | # Copyright 2001-2006 by Easy Software Products, all rights reserved. |
74456259 | 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 | |
c9d3f842 | 19 | # Hollywood, Maryland 20636 USA |
74456259 | 20 | # |
9639c4de | 21 | # Voice: (301) 373-9600 |
74456259 | 22 | # EMail: cups-info@cups.org |
23 | # WWW: http://www.cups.org | |
24 | # | |
25 | ||
18dcf583 | 26 | VERSION="@CUPS_VERSION@" |
7671e38d | 27 | APIVERSION="1.3" |
74456259 | 28 | |
29 | prefix=@prefix@ | |
30 | exec_prefix=@exec_prefix@ | |
31 | bindir=@bindir@ | |
32 | includedir=@includedir@ | |
33 | libdir=@libdir@ | |
7671e38d | 34 | imagelibdir=@libdir@ |
1ee3e396 | 35 | datarootdir=@datadir@ |
74456259 | 36 | datadir=@datadir@ |
37 | sysconfdir=@sysconfdir@ | |
38 | cups_datadir=@CUPS_DATADIR@ | |
39 | cups_serverbin=@CUPS_SERVERBIN@ | |
40 | cups_serverroot=@CUPS_SERVERROOT@ | |
8081be77 | 41 | INSTALLSTATIC=@INSTALLSTATIC@ |
74456259 | 42 | |
43 | # flags for C++ compiler: | |
d7f7fd76 | 44 | CFLAGS="" |
487a6abf | 45 | LDFLAGS="@EXPORT_LDFLAGS@" |
cf94bcb1 | 46 | LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@" |
b19f4b26 | 47 | IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@" |
74456259 | 48 | |
7671e38d | 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" | |
a9335d2b | 57 | if test ! -f "$selfdir/cups/raster.h"; then |
7671e38d | 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 | |
74456259 | 64 | |
7671e38d | 65 | if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then |
66 | LDFLAGS="$LDFLAGS -L$libdir" | |
67 | fi | |
74456259 | 68 | fi |
69 | ||
7671e38d | 70 | |
74456259 | 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 | |
aee1b1c1 | 116 | if test $image = no; then |
359774f6 | 117 | echo -lcups $LIBS |
aee1b1c1 | 118 | else |
b19f4b26 | 119 | echo -lcupsimage -lcups $IMGLIBS $LIBS |
aee1b1c1 | 120 | fi |
74456259 | 121 | else |
122 | if test $image = no; then | |
359774f6 | 123 | echo $libdir/libcups.a $LIBS |
74456259 | 124 | else |
b19f4b26 | 125 | echo $imagelibdir/libcupsimage.a $libdir/libcups.a $IMGLIBS $LIBS |
74456259 | 126 | fi |
127 | fi | |
128 | ;; | |
129 | --serverbin) | |
130 | echo $cups_serverbin | |
131 | ;; | |
132 | --serverroot) | |
133 | echo $cups_serverroot | |
134 | ;; | |
135 | --static) | |
8081be77 | 136 | if test -z "$INSTALLSTATIC"; then |
137 | echo "WARNING: Static libraries not installed!" >&2 | |
138 | else | |
139 | static=yes | |
140 | fi | |
74456259 | 141 | ;; |
142 | --version) | |
143 | echo $VERSION | |
144 | ;; | |
145 | *) | |
146 | usage 1 | |
147 | ;; | |
148 | esac | |
149 | ||
150 | shift | |
151 | done | |
152 | ||
153 | # | |
c9d3f842 | 154 | # End of "$Id$". |
74456259 | 155 | # |