]> git.ipfire.org Git - thirdparty/cups.git/blob - cups-config.in
Load cups into easysw/current.
[thirdparty/cups.git] / cups-config.in
1 #! /bin/sh
2 #
3 # "$Id: cups-config.in 5799 2006-08-03 00:54:38Z mike $"
4 #
5 # CUPS configuration utility.
6 #
7 # Copyright 2001-2006 by Easy Software Products, all rights reserved.
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
26 VERSION="@CUPS_VERSION@"
27 APIVERSION="1.2"
28
29 prefix=@prefix@
30 exec_prefix=@exec_prefix@
31 bindir=@bindir@
32 includedir=@includedir@
33 libdir=@libdir@
34 imagelibdir=@libdir@
35 datarootdir=@datadir@
36 datadir=@datadir@
37 sysconfdir=@sysconfdir@
38 cups_datadir=@CUPS_DATADIR@
39 cups_serverbin=@CUPS_SERVERBIN@
40 cups_serverroot=@CUPS_SERVERROOT@
41 INSTALLSTATIC=@INSTALLSTATIC@
42
43 # flags for C++ compiler:
44 CFLAGS=""
45 LDFLAGS="@EXPORT_LDFLAGS@"
46 LIBS="@EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
47 IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
48
49 # Check for local invocation...
50 selfdir=`dirname $0`
51
52 if test -f "$selfdir/cups/cups.h"; then
53 CFLAGS="-I$selfdir"
54 LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
55 libdir="$selfdir/cups"
56 imagelibdir="$selfdir/filter"
57 if test ! -f "$selfdir/cups/raster.h"; then
58 ln -s ../filter/raster.h "$selfdir/cups"
59 fi
60 else
61 if test $includedir != /usr/include; then
62 CFLAGS="$CFLAGS -I$includedir"
63 fi
64
65 if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
66 LDFLAGS="$LDFLAGS -L$libdir"
67 fi
68 fi
69
70
71 usage ()
72 {
73 echo "Usage: cups-config --api-version"
74 echo " cups-config --cflags"
75 echo " cups-config --datadir"
76 echo " cups-config --help"
77 echo " cups-config --ldflags"
78 echo " cups-config [--image] [--static] --libs"
79 echo " cups-config --serverbin"
80 echo " cups-config --serverroot"
81 echo " cups-config --version"
82
83 exit $1
84 }
85
86 if test $# -eq 0; then
87 usage 1
88 fi
89
90 # Parse command line options
91 static=no
92 image=no
93
94 while test $# -gt 0; do
95 case $1 in
96 --api-version)
97 echo $APIVERSION
98 ;;
99 --cflags)
100 echo $CFLAGS
101 ;;
102 --datadir)
103 echo $cups_datadir
104 ;;
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
116 if test $image = no; then
117 echo -lcups $LIBS
118 else
119 echo -lcupsimage -lcups $IMGLIBS $LIBS
120 fi
121 else
122 if test $image = no; then
123 echo $libdir/libcups.a $LIBS
124 else
125 echo $imagelibdir/libcupsimage.a $libdir/libcups.a $IMGLIBS $LIBS
126 fi
127 fi
128 ;;
129 --serverbin)
130 echo $cups_serverbin
131 ;;
132 --serverroot)
133 echo $cups_serverroot
134 ;;
135 --static)
136 if test -z "$INSTALLSTATIC"; then
137 echo "WARNING: Static libraries not installed!" >&2
138 else
139 static=yes
140 fi
141 ;;
142 --version)
143 echo $VERSION
144 ;;
145 *)
146 usage 1
147 ;;
148 esac
149
150 shift
151 done
152
153 #
154 # End of "$Id: cups-config.in 5799 2006-08-03 00:54:38Z mike $".
155 #