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