]> git.ipfire.org Git - thirdparty/cups.git/blame - cups-config.in
Merge changes from CUPS 1.5svn-r9385.
[thirdparty/cups.git] / cups-config.in
CommitLineData
ef416fc2 1#! /bin/sh
2#
75bd9771 3# "$Id: cups-config.in 7394 2008-03-21 23:41:43Z mike $"
ef416fc2 4#
5# CUPS configuration utility.
6#
c7017ecc 7# Copyright 2007-2010 by Apple Inc.
bd7854cb 8# Copyright 2001-2006 by Easy Software Products, all rights reserved.
ef416fc2 9#
10# These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 15#
16
17VERSION="@CUPS_VERSION@"
c7017ecc 18APIVERSION="1.5"
e4572d57 19BUILD="@CUPS_BUILD@"
ef416fc2 20
21prefix=@prefix@
22exec_prefix=@exec_prefix@
23bindir=@bindir@
24includedir=@includedir@
25libdir=@libdir@
f301802f 26imagelibdir=@libdir@
d09495fa 27datarootdir=@datadir@
ef416fc2 28datadir=@datadir@
29sysconfdir=@sysconfdir@
30cups_datadir=@CUPS_DATADIR@
31cups_serverbin=@CUPS_SERVERBIN@
32cups_serverroot=@CUPS_SERVERROOT@
bd7854cb 33INSTALLSTATIC=@INSTALLSTATIC@
ef416fc2 34
35# flags for C++ compiler:
36CFLAGS=""
37LDFLAGS="@EXPORT_LDFLAGS@"
f7deaa1a 38LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
8ca02f3c 39IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
ef416fc2 40
f301802f 41# Check for local invocation...
42selfdir=`dirname $0`
43
44if test -f "$selfdir/cups/cups.h"; then
45 CFLAGS="-I$selfdir"
46 LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
47 libdir="$selfdir/cups"
48 imagelibdir="$selfdir/filter"
ed486911 49 if test ! -f "$selfdir/cups/raster.h"; then
f301802f 50 ln -s ../filter/raster.h "$selfdir/cups"
51 fi
52else
53 if test $includedir != /usr/include; then
54 CFLAGS="$CFLAGS -I$includedir"
55 fi
ef416fc2 56
f301802f 57 if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
58 LDFLAGS="$LDFLAGS -L$libdir"
59 fi
ef416fc2 60fi
61
f301802f 62
ef416fc2 63usage ()
64{
65 echo "Usage: cups-config --api-version"
e4572d57 66 echo " cups-config --build"
ef416fc2 67 echo " cups-config --cflags"
68 echo " cups-config --datadir"
69 echo " cups-config --help"
70 echo " cups-config --ldflags"
50fe7201 71 echo " cups-config [--driver] [--image] [--static] --libs"
ef416fc2 72 echo " cups-config --serverbin"
73 echo " cups-config --serverroot"
74 echo " cups-config --version"
75
76 exit $1
77}
78
79if test $# -eq 0; then
80 usage 1
81fi
82
83# Parse command line options
84static=no
85image=no
50fe7201 86driver=no
ef416fc2 87
88while test $# -gt 0; do
89 case $1 in
90 --api-version)
91 echo $APIVERSION
92 ;;
e4572d57
MS
93 --build)
94 echo $BUILD
95 ;;
ef416fc2 96 --cflags)
97 echo $CFLAGS
98 ;;
99 --datadir)
100 echo $cups_datadir
101 ;;
50fe7201
MS
102 --driver)
103 driver=yes
104 ;;
ef416fc2 105 --help)
106 usage 0
107 ;;
108 --image)
109 image=yes
110 ;;
111 --ldflags)
112 echo $LDFLAGS
113 ;;
114 --libs)
115 if test $static = no; then
c7017ecc 116 libs="@EXTLINKCUPS@ $LIBS";
50fe7201 117 if test $image = yes; then
c7017ecc 118 libs="@EXTLINKCUPSIMAGE@ $libs"
50fe7201
MS
119 fi
120 if test $driver = yes; then
c7017ecc 121 libs="@EXTLINKCUPSDRIVER@ $libs"
50fe7201 122 fi
ef416fc2 123 else
50fe7201
MS
124 libs="$libdir/libcups.a $LIBS";
125 if test $image = yes; then
126 libs="$libdir/libcupsimage.a $IMGLIBS $libs"
127 fi
128 if test $driver = yes; then
129 libs="$libdir/libcupsdriver.a $libs"
ef416fc2 130 fi
131 fi
50fe7201 132 echo $libs
ef416fc2 133 ;;
134 --serverbin)
135 echo $cups_serverbin
136 ;;
137 --serverroot)
138 echo $cups_serverroot
139 ;;
140 --static)
bd7854cb 141 if test -z "$INSTALLSTATIC"; then
142 echo "WARNING: Static libraries not installed!" >&2
143 else
144 static=yes
145 fi
ef416fc2 146 ;;
147 --version)
148 echo $VERSION
149 ;;
150 *)
151 usage 1
152 ;;
153 esac
154
155 shift
156done
157
158#
75bd9771 159# End of "$Id: cups-config.in 7394 2008-03-21 23:41:43Z mike $".
ef416fc2 160#