]> git.ipfire.org Git - thirdparty/cups.git/blame - cups-config.in
Changelog.
[thirdparty/cups.git] / cups-config.in
CommitLineData
74456259 1#! /bin/sh
2#
c9d3f842 3# "$Id$"
bf6584b2 4#
74456259 5# CUPS configuration utility.
6#
bf6584b2 7# Copyright 2007-2011 by Apple Inc.
8081be77 8# Copyright 2001-2006 by Easy Software Products, all rights reserved.
74456259 9#
10# These coded instructions, statements, and computer programs are the
4e8d321f 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/".
74456259 15#
16
18dcf583 17VERSION="@CUPS_VERSION@"
bf6584b2 18APIVERSION="1.6"
7ab3a94b 19BUILD="@CUPS_BUILD@"
74456259 20
21prefix=@prefix@
22exec_prefix=@exec_prefix@
23bindir=@bindir@
24includedir=@includedir@
25libdir=@libdir@
7671e38d 26imagelibdir=@libdir@
1ee3e396 27datarootdir=@datadir@
74456259 28datadir=@datadir@
29sysconfdir=@sysconfdir@
30cups_datadir=@CUPS_DATADIR@
31cups_serverbin=@CUPS_SERVERBIN@
32cups_serverroot=@CUPS_SERVERROOT@
8081be77 33INSTALLSTATIC=@INSTALLSTATIC@
74456259 34
35# flags for C++ compiler:
d7f7fd76 36CFLAGS=""
487a6abf 37LDFLAGS="@EXPORT_LDFLAGS@"
bf6584b2 38LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
74456259 39
7671e38d 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"
7671e38d 48else
49 if test $includedir != /usr/include; then
50 CFLAGS="$CFLAGS -I$includedir"
51 fi
74456259 52
7671e38d 53 if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
54 LDFLAGS="$LDFLAGS -L$libdir"
55 fi
74456259 56fi
57
7671e38d 58
74456259 59usage ()
60{
61 echo "Usage: cups-config --api-version"
7ab3a94b 62 echo " cups-config --build"
74456259 63 echo " cups-config --cflags"
64 echo " cups-config --datadir"
65 echo " cups-config --help"
66 echo " cups-config --ldflags"
bf6584b2 67 echo " cups-config [--image] [--static] --libs"
74456259 68 echo " cups-config --serverbin"
69 echo " cups-config --serverroot"
70 echo " cups-config --version"
71
72 exit $1
73}
74
75if test $# -eq 0; then
76 usage 1
77fi
78
79# Parse command line options
80static=no
81image=no
82
83while test $# -gt 0; do
84 case $1 in
85 --api-version)
86 echo $APIVERSION
87 ;;
7ab3a94b 88 --build)
89 echo $BUILD
90 ;;
74456259 91 --cflags)
92 echo $CFLAGS
93 ;;
94 --datadir)
95 echo $cups_datadir
96 ;;
97 --help)
98 usage 0
99 ;;
100 --image)
101 image=yes
102 ;;
103 --ldflags)
104 echo $LDFLAGS
105 ;;
106 --libs)
107 if test $static = no; then
9036e8da 108 libs="@EXTLINKCUPS@ $LIBS";
ad63a394 109 if test $image = yes; then
9036e8da 110 libs="@EXTLINKCUPSIMAGE@ $libs"
ad63a394 111 fi
74456259 112 else
ad63a394 113 libs="$libdir/libcups.a $LIBS";
114 if test $image = yes; then
bf6584b2 115 libs="$libdir/libcupsimage.a $libs"
74456259 116 fi
117 fi
ad63a394 118 echo $libs
74456259 119 ;;
120 --serverbin)
121 echo $cups_serverbin
122 ;;
123 --serverroot)
124 echo $cups_serverroot
125 ;;
126 --static)
8081be77 127 if test -z "$INSTALLSTATIC"; then
128 echo "WARNING: Static libraries not installed!" >&2
129 else
130 static=yes
131 fi
74456259 132 ;;
133 --version)
134 echo $VERSION
135 ;;
136 *)
137 usage 1
138 ;;
139 esac
140
141 shift
142done
143
144#
c9d3f842 145# End of "$Id$".
74456259 146#