]> git.ipfire.org Git - thirdparty/cups.git/blob - cups-config.in
Use iterator for CRL (Issue #5532)
[thirdparty/cups.git] / cups-config.in
1 #!/bin/sh
2 #
3 # CUPS configuration utility.
4 #
5 # Copyright © 2007-2018 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 imagelibdir=@libdir@
22 datarootdir=@datadir@
23 datadir=@datadir@
24 sysconfdir=@sysconfdir@
25 cups_datadir=@CUPS_DATADIR@
26 cups_serverbin=@CUPS_SERVERBIN@
27 cups_serverroot=@CUPS_SERVERROOT@
28 INSTALLSTATIC=@INSTALLSTATIC@
29
30 # flags for C++ compiler:
31 CFLAGS=""
32 LDFLAGS="@EXPORT_LDFLAGS@"
33 LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
34
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"
43 else
44 if test $includedir != /usr/include; then
45 CFLAGS="$CFLAGS -I$includedir"
46 fi
47
48 if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
49 LDFLAGS="$LDFLAGS -L$libdir"
50 fi
51 fi
52
53
54 usage ()
55 {
56 echo "Usage: cups-config --api-version"
57 echo " cups-config --build"
58 echo " cups-config --cflags"
59 echo " cups-config --datadir"
60 echo " cups-config --help"
61 echo " cups-config --ldflags"
62 echo " cups-config [--image] [--static] --libs"
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 ;;
83 --build)
84 echo $BUILD
85 ;;
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
103 libs="@EXTLINKCUPS@ $LIBS";
104 if test $image = yes; then
105 libs="@EXTLINKCUPSIMAGE@ $libs"
106 fi
107 else
108 libs="$libdir/libcups.a $LIBS";
109 if test $image = yes; then
110 libs="$libdir/libcupsimage.a $libs"
111 fi
112 fi
113 echo $libs
114 ;;
115 --serverbin)
116 echo $cups_serverbin
117 ;;
118 --serverroot)
119 echo $cups_serverroot
120 ;;
121 --static)
122 if test -z "$INSTALLSTATIC"; then
123 echo "WARNING: Static libraries not installed!" >&2
124 else
125 static=yes
126 fi
127 ;;
128 --version)
129 echo $VERSION
130 ;;
131 *)
132 usage 1
133 ;;
134 esac
135
136 shift
137 done