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