]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | #! /bin/sh |
2 | # | |
f2d18633 | 3 | # "$Id$" |
a4845881 | 4 | # |
ef416fc2 | 5 | # CUPS configuration utility. |
6 | # | |
a4845881 | 7 | # Copyright 2007-2011 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@" | |
a4845881 | 18 | APIVERSION="1.6" |
e4572d57 | 19 | BUILD="@CUPS_BUILD@" |
ef416fc2 | 20 | |
21 | prefix=@prefix@ | |
22 | exec_prefix=@exec_prefix@ | |
23 | bindir=@bindir@ | |
24 | includedir=@includedir@ | |
25 | libdir=@libdir@ | |
f301802f | 26 | imagelibdir=@libdir@ |
d09495fa | 27 | datarootdir=@datadir@ |
ef416fc2 | 28 | datadir=@datadir@ |
29 | sysconfdir=@sysconfdir@ | |
30 | cups_datadir=@CUPS_DATADIR@ | |
31 | cups_serverbin=@CUPS_SERVERBIN@ | |
32 | cups_serverroot=@CUPS_SERVERROOT@ | |
bd7854cb | 33 | INSTALLSTATIC=@INSTALLSTATIC@ |
ef416fc2 | 34 | |
35 | # flags for C++ compiler: | |
36 | CFLAGS="" | |
37 | LDFLAGS="@EXPORT_LDFLAGS@" | |
a4845881 | 38 | LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@" |
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" | |
f301802f | 48 | else |
49 | if test $includedir != /usr/include; then | |
50 | CFLAGS="$CFLAGS -I$includedir" | |
51 | fi | |
ef416fc2 | 52 | |
f301802f | 53 | if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then |
54 | LDFLAGS="$LDFLAGS -L$libdir" | |
55 | fi | |
ef416fc2 | 56 | fi |
57 | ||
f301802f | 58 | |
ef416fc2 | 59 | usage () |
60 | { | |
61 | echo "Usage: cups-config --api-version" | |
e4572d57 | 62 | echo " cups-config --build" |
ef416fc2 | 63 | echo " cups-config --cflags" |
64 | echo " cups-config --datadir" | |
65 | echo " cups-config --help" | |
66 | echo " cups-config --ldflags" | |
a4845881 | 67 | echo " cups-config [--image] [--static] --libs" |
ef416fc2 | 68 | echo " cups-config --serverbin" |
69 | echo " cups-config --serverroot" | |
70 | echo " cups-config --version" | |
71 | ||
72 | exit $1 | |
73 | } | |
74 | ||
75 | if test $# -eq 0; then | |
76 | usage 1 | |
77 | fi | |
78 | ||
79 | # Parse command line options | |
80 | static=no | |
81 | image=no | |
82 | ||
83 | while test $# -gt 0; do | |
84 | case $1 in | |
85 | --api-version) | |
86 | echo $APIVERSION | |
87 | ;; | |
e4572d57 MS |
88 | --build) |
89 | echo $BUILD | |
90 | ;; | |
ef416fc2 | 91 | --cflags) |
92 | echo $CFLAGS | |
93 | ;; | |
94 | --datadir) | |
95 | echo $cups_datadir | |
96 | ;; | |
97 | --help) | |
98 | usage 0 | |
99 | ;; | |
100 | --image) | |
101 | image=yes | |
102 | ;; | |
103 | --ldflags) | |
104 | echo $LDFLAGS | |
105 | ;; | |
106 | --libs) | |
107 | if test $static = no; then | |
c7017ecc | 108 | libs="@EXTLINKCUPS@ $LIBS"; |
50fe7201 | 109 | if test $image = yes; then |
c7017ecc | 110 | libs="@EXTLINKCUPSIMAGE@ $libs" |
50fe7201 | 111 | fi |
ef416fc2 | 112 | else |
50fe7201 MS |
113 | libs="$libdir/libcups.a $LIBS"; |
114 | if test $image = yes; then | |
a4845881 | 115 | libs="$libdir/libcupsimage.a $libs" |
ef416fc2 | 116 | fi |
117 | fi | |
50fe7201 | 118 | echo $libs |
ef416fc2 | 119 | ;; |
120 | --serverbin) | |
121 | echo $cups_serverbin | |
122 | ;; | |
123 | --serverroot) | |
124 | echo $cups_serverroot | |
125 | ;; | |
126 | --static) | |
bd7854cb | 127 | if test -z "$INSTALLSTATIC"; then |
128 | echo "WARNING: Static libraries not installed!" >&2 | |
129 | else | |
130 | static=yes | |
131 | fi | |
ef416fc2 | 132 | ;; |
133 | --version) | |
134 | echo $VERSION | |
135 | ;; | |
136 | *) | |
137 | usage 1 | |
138 | ;; | |
139 | esac | |
140 | ||
141 | shift | |
142 | done | |
143 | ||
144 | # | |
f2d18633 | 145 | # End of "$Id$". |
ef416fc2 | 146 | # |