]> git.ipfire.org Git - thirdparty/cups.git/blame - cups-config.in
Fix .PHONY declaration
[thirdparty/cups.git] / cups-config.in
CommitLineData
24343173 1#!/bin/sh
ef416fc2 2#
503b54c9 3# CUPS configuration utility.
a4845881 4#
24343173 5# Copyright 2007-2016 by Apple Inc.
503b54c9 6# Copyright 2001-2006 by Easy Software Products, all rights reserved.
ef416fc2 7#
503b54c9
MS
8# These coded instructions, statements, and computer programs are the
9# property of Apple Inc. and are protected by Federal copyright
10# law. Distribution and use rights are outlined in the file "LICENSE.txt"
11# which should have been included with this file. If this file is
12# file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 13#
14
15VERSION="@CUPS_VERSION@"
24343173 16APIVERSION="2.2"
e4572d57 17BUILD="@CUPS_BUILD@"
ef416fc2 18
19prefix=@prefix@
20exec_prefix=@exec_prefix@
21bindir=@bindir@
22includedir=@includedir@
23libdir=@libdir@
f301802f 24imagelibdir=@libdir@
d09495fa 25datarootdir=@datadir@
ef416fc2 26datadir=@datadir@
27sysconfdir=@sysconfdir@
28cups_datadir=@CUPS_DATADIR@
29cups_serverbin=@CUPS_SERVERBIN@
30cups_serverroot=@CUPS_SERVERROOT@
bd7854cb 31INSTALLSTATIC=@INSTALLSTATIC@
ef416fc2 32
33# flags for C++ compiler:
34CFLAGS=""
35LDFLAGS="@EXPORT_LDFLAGS@"
a4845881 36LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
ef416fc2 37
f301802f 38# Check for local invocation...
39selfdir=`dirname $0`
40
41if test -f "$selfdir/cups/cups.h"; then
42 CFLAGS="-I$selfdir"
43 LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
44 libdir="$selfdir/cups"
45 imagelibdir="$selfdir/filter"
f301802f 46else
47 if test $includedir != /usr/include; then
48 CFLAGS="$CFLAGS -I$includedir"
49 fi
ef416fc2 50
f301802f 51 if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
52 LDFLAGS="$LDFLAGS -L$libdir"
53 fi
ef416fc2 54fi
55
f301802f 56
ef416fc2 57usage ()
58{
59 echo "Usage: cups-config --api-version"
e4572d57 60 echo " cups-config --build"
ef416fc2 61 echo " cups-config --cflags"
62 echo " cups-config --datadir"
63 echo " cups-config --help"
64 echo " cups-config --ldflags"
a4845881 65 echo " cups-config [--image] [--static] --libs"
ef416fc2 66 echo " cups-config --serverbin"
67 echo " cups-config --serverroot"
68 echo " cups-config --version"
69
70 exit $1
71}
72
73if test $# -eq 0; then
74 usage 1
75fi
76
77# Parse command line options
78static=no
79image=no
80
81while test $# -gt 0; do
82 case $1 in
83 --api-version)
84 echo $APIVERSION
85 ;;
e4572d57
MS
86 --build)
87 echo $BUILD
88 ;;
ef416fc2 89 --cflags)
90 echo $CFLAGS
91 ;;
92 --datadir)
93 echo $cups_datadir
94 ;;
95 --help)
96 usage 0
97 ;;
98 --image)
99 image=yes
100 ;;
101 --ldflags)
102 echo $LDFLAGS
103 ;;
104 --libs)
105 if test $static = no; then
c7017ecc 106 libs="@EXTLINKCUPS@ $LIBS";
50fe7201 107 if test $image = yes; then
c7017ecc 108 libs="@EXTLINKCUPSIMAGE@ $libs"
50fe7201 109 fi
ef416fc2 110 else
50fe7201
MS
111 libs="$libdir/libcups.a $LIBS";
112 if test $image = yes; then
a4845881 113 libs="$libdir/libcupsimage.a $libs"
ef416fc2 114 fi
115 fi
50fe7201 116 echo $libs
ef416fc2 117 ;;
118 --serverbin)
119 echo $cups_serverbin
120 ;;
121 --serverroot)
122 echo $cups_serverroot
123 ;;
124 --static)
bd7854cb 125 if test -z "$INSTALLSTATIC"; then
126 echo "WARNING: Static libraries not installed!" >&2
127 else
128 static=yes
129 fi
ef416fc2 130 ;;
131 --version)
132 echo $VERSION
133 ;;
134 *)
135 usage 1
136 ;;
137 esac
138
139 shift
140done