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