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