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