]> git.ipfire.org Git - thirdparty/cups.git/blob - cups-config.in
Work around undocumented side-effect of SecItemAdd...
[thirdparty/cups.git] / cups-config.in
1 #! /bin/sh
2 #
3 # "$Id$"
4 #
5 # CUPS configuration utility.
6 #
7 # Copyright 2007-2011 by Apple Inc.
8 # Copyright 2001-2006 by Easy Software Products, all rights reserved.
9 #
10 # These coded instructions, statements, and computer programs are the
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/".
15 #
16
17 VERSION="@CUPS_VERSION@"
18 APIVERSION="1.6"
19 BUILD="@CUPS_BUILD@"
20
21 prefix=@prefix@
22 exec_prefix=@exec_prefix@
23 bindir=@bindir@
24 includedir=@includedir@
25 libdir=@libdir@
26 imagelibdir=@libdir@
27 datarootdir=@datadir@
28 datadir=@datadir@
29 sysconfdir=@sysconfdir@
30 cups_datadir=@CUPS_DATADIR@
31 cups_serverbin=@CUPS_SERVERBIN@
32 cups_serverroot=@CUPS_SERVERROOT@
33 INSTALLSTATIC=@INSTALLSTATIC@
34
35 # flags for C++ compiler:
36 CFLAGS=""
37 LDFLAGS="@EXPORT_LDFLAGS@"
38 LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
39
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"
48 else
49 if test $includedir != /usr/include; then
50 CFLAGS="$CFLAGS -I$includedir"
51 fi
52
53 if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
54 LDFLAGS="$LDFLAGS -L$libdir"
55 fi
56 fi
57
58
59 usage ()
60 {
61 echo "Usage: cups-config --api-version"
62 echo " cups-config --build"
63 echo " cups-config --cflags"
64 echo " cups-config --datadir"
65 echo " cups-config --help"
66 echo " cups-config --ldflags"
67 echo " cups-config [--image] [--static] --libs"
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 ;;
88 --build)
89 echo $BUILD
90 ;;
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
108 libs="@EXTLINKCUPS@ $LIBS";
109 if test $image = yes; then
110 libs="@EXTLINKCUPSIMAGE@ $libs"
111 fi
112 else
113 libs="$libdir/libcups.a $LIBS";
114 if test $image = yes; then
115 libs="$libdir/libcupsimage.a $libs"
116 fi
117 fi
118 echo $libs
119 ;;
120 --serverbin)
121 echo $cups_serverbin
122 ;;
123 --serverroot)
124 echo $cups_serverroot
125 ;;
126 --static)
127 if test -z "$INSTALLSTATIC"; then
128 echo "WARNING: Static libraries not installed!" >&2
129 else
130 static=yes
131 fi
132 ;;
133 --version)
134 echo $VERSION
135 ;;
136 *)
137 usage 1
138 ;;
139 esac
140
141 shift
142 done
143
144 #
145 # End of "$Id$".
146 #