]> git.ipfire.org Git - thirdparty/cups.git/blame - cups-config.in
Load cups into easysw/current.
[thirdparty/cups.git] / cups-config.in
CommitLineData
ef416fc2 1#! /bin/sh
2#
f301802f 3# "$Id: cups-config.in 5503 2006-05-10 18:55:39Z mike $"
ef416fc2 4#
5# CUPS configuration utility.
6#
bd7854cb 7# Copyright 2001-2006 by Easy Software Products, all rights reserved.
ef416fc2 8#
9# These coded instructions, statements, and computer programs are the
10# property of Easy Software Products and are protected by Federal
11# copyright law. Distribution and use rights are outlined in the file
12# "LICENSE.txt" which should have been included with this file. If this
13# file is missing or damaged please contact Easy Software Products
14# at:
15#
16# Attn: CUPS Licensing Information
17# Easy Software Products
18# 44141 Airport View Drive, Suite 204
19# Hollywood, Maryland 20636 USA
20#
21# Voice: (301) 373-9600
22# EMail: cups-info@cups.org
23# WWW: http://www.cups.org
24#
25
26VERSION="@CUPS_VERSION@"
f301802f 27APIVERSION="1.3"
ef416fc2 28
29prefix=@prefix@
30exec_prefix=@exec_prefix@
31bindir=@bindir@
32includedir=@includedir@
33libdir=@libdir@
f301802f 34imagelibdir=@libdir@
ef416fc2 35datadir=@datadir@
36sysconfdir=@sysconfdir@
37cups_datadir=@CUPS_DATADIR@
38cups_serverbin=@CUPS_SERVERBIN@
39cups_serverroot=@CUPS_SERVERROOT@
bd7854cb 40INSTALLSTATIC=@INSTALLSTATIC@
ef416fc2 41
42# flags for C++ compiler:
43CFLAGS=""
44LDFLAGS="@EXPORT_LDFLAGS@"
45LIBS="@EXPORT_SSLLIBS@ @LIBS@"
46IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@ @EXPORT_LIBZ@"
47
f301802f 48# Check for local invocation...
49selfdir=`dirname $0`
50
51if test -f "$selfdir/cups/cups.h"; then
52 CFLAGS="-I$selfdir"
53 LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
54 libdir="$selfdir/cups"
55 imagelibdir="$selfdir/filter"
56 if test ! -e "$selfdir/cups/raster.h"; then
57 ln -s ../filter/raster.h "$selfdir/cups"
58 fi
59else
60 if test $includedir != /usr/include; then
61 CFLAGS="$CFLAGS -I$includedir"
62 fi
ef416fc2 63
f301802f 64 if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
65 LDFLAGS="$LDFLAGS -L$libdir"
66 fi
ef416fc2 67fi
68
f301802f 69
ef416fc2 70usage ()
71{
72 echo "Usage: cups-config --api-version"
73 echo " cups-config --cflags"
74 echo " cups-config --datadir"
75 echo " cups-config --help"
76 echo " cups-config --ldflags"
77 echo " cups-config [--image] [--static] --libs"
78 echo " cups-config --serverbin"
79 echo " cups-config --serverroot"
80 echo " cups-config --version"
81
82 exit $1
83}
84
85if test $# -eq 0; then
86 usage 1
87fi
88
89# Parse command line options
90static=no
91image=no
92
93while test $# -gt 0; do
94 case $1 in
95 --api-version)
96 echo $APIVERSION
97 ;;
98 --cflags)
99 echo $CFLAGS
100 ;;
101 --datadir)
102 echo $cups_datadir
103 ;;
104 --help)
105 usage 0
106 ;;
107 --image)
108 image=yes
109 ;;
110 --ldflags)
111 echo $LDFLAGS
112 ;;
113 --libs)
114 if test $static = no; then
115 if test $image = no; then
116 echo -lcups $LIBS
117 else
118 echo -lcupsimage $IMGLIBS -lcups $LIBS
119 fi
120 else
121 if test $image = no; then
122 echo $libdir/libcups.a $LIBS
123 else
f301802f 124 echo $imagelibdir/libcupsimage.a $IMGLIBS $libdir/libcups.a $LIBS
ef416fc2 125 fi
126 fi
127 ;;
128 --serverbin)
129 echo $cups_serverbin
130 ;;
131 --serverroot)
132 echo $cups_serverroot
133 ;;
134 --static)
bd7854cb 135 if test -z "$INSTALLSTATIC"; then
136 echo "WARNING: Static libraries not installed!" >&2
137 else
138 static=yes
139 fi
ef416fc2 140 ;;
141 --version)
142 echo $VERSION
143 ;;
144 *)
145 usage 1
146 ;;
147 esac
148
149 shift
150done
151
152#
f301802f 153# End of "$Id: cups-config.in 5503 2006-05-10 18:55:39Z mike $".
ef416fc2 154#