]> git.ipfire.org Git - thirdparty/cups.git/blame_incremental - cups-config.in
Save initial work on private xform API.
[thirdparty/cups.git] / cups-config.in
... / ...
CommitLineData
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
12VERSION="@CUPS_VERSION@"
13APIVERSION="2.3"
14BUILD="@CUPS_BUILD@"
15
16prefix=@prefix@
17exec_prefix=@exec_prefix@
18bindir=@bindir@
19includedir=@includedir@
20libdir=@libdir@
21imagelibdir=@libdir@
22datarootdir=@datadir@
23datadir=@datadir@
24sysconfdir=@sysconfdir@
25cups_datadir=@CUPS_DATADIR@
26cups_serverbin=@CUPS_SERVERBIN@
27cups_serverroot=@CUPS_SERVERROOT@
28INSTALLSTATIC=@INSTALLSTATIC@
29
30# flags for C++ compiler:
31CFLAGS=""
32LDFLAGS="@EXPORT_LDFLAGS@"
33LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
34
35# Check for local invocation...
36selfdir=`dirname $0`
37
38if 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"
43else
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
51fi
52
53
54usage ()
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
70if test $# -eq 0; then
71 usage 1
72fi
73
74# Parse command line options
75static=no
76image=no
77
78while 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
137done