]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
7a6a01dd | 2 | dnl "$Id$" |
ef416fc2 | 3 | dnl |
4 | dnl Shared library support for the Common UNIX Printing System (CUPS). | |
5 | dnl | |
6 | dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. | |
7 | dnl | |
8 | dnl These coded instructions, statements, and computer programs are the | |
9 | dnl property of Easy Software Products and are protected by Federal | |
10 | dnl copyright law. Distribution and use rights are outlined in the file | |
11 | dnl "LICENSE.txt" which should have been included with this file. If this | |
12 | dnl file is missing or damaged please contact Easy Software Products | |
13 | dnl at: | |
14 | dnl | |
15 | dnl Attn: CUPS Licensing Information | |
16 | dnl Easy Software Products | |
17 | dnl 44141 Airport View Drive, Suite 204 | |
18 | dnl Hollywood, Maryland 20636 USA | |
19 | dnl | |
20 | dnl Voice: (301) 373-9600 | |
21 | dnl EMail: cups-info@cups.org | |
22 | dnl WWW: http://www.cups.org | |
23 | dnl | |
24 | ||
25 | PICFLAG=1 | |
26 | DSOFLAGS="${DSOFLAGS:=}" | |
27 | ||
28 | AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries, default=yes]) | |
29 | ||
30 | if test x$enable_shared != xno; then | |
31 | case "$uname" in | |
32 | SunOS* | UNIX_S*) | |
33 | LIBCUPS="libcups.so.2" | |
34 | LIBCUPSIMAGE="libcupsimage.so.2" | |
35 | DSO="\$(CC)" | |
f301802f | 36 | DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)" |
ef416fc2 | 37 | ;; |
38 | HP-UX*) | |
39 | LIBCUPS="libcups.sl.2" | |
40 | LIBCUPSIMAGE="libcupsimage.sl.2" | |
bd7854cb | 41 | DSO="\$(LD)" |
f301802f | 42 | DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`" |
ef416fc2 | 43 | ;; |
44 | IRIX) | |
45 | LIBCUPS="libcups.so.2" | |
46 | LIBCUPSIMAGE="libcupsimage.so.2" | |
47 | DSO="\$(CC)" | |
f301802f | 48 | DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)" |
ef416fc2 | 49 | ;; |
50 | OSF1* | Linux | GNU | *BSD*) | |
51 | LIBCUPS="libcups.so.2" | |
52 | LIBCUPSIMAGE="libcupsimage.so.2" | |
53 | DSO="\$(CC)" | |
f301802f | 54 | DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)" |
ef416fc2 | 55 | ;; |
56 | Darwin*) | |
57 | LIBCUPS="libcups.2.dylib" | |
58 | LIBCUPSIMAGE="libcupsimage.2.dylib" | |
59 | DSO="\$(CC)" | |
f301802f | 60 | DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc" |
ef416fc2 | 61 | ;; |
62 | AIX*) | |
63 | LIBCUPS="libcups_s.a" | |
64 | LIBCUPSIMAGE="libcupsimage_s.a" | |
65 | DSO="\$(CC)" | |
66 | DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)" | |
67 | ;; | |
68 | *) | |
69 | echo "Warning: shared libraries may not be supported. Trying -shared" | |
70 | echo " option with compiler." | |
71 | LIBCUPS="libcups.so.2" | |
72 | LIBCUPSIMAGE="libcupsimage.so.2" | |
73 | DSO="\$(CC)" | |
f301802f | 74 | DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)" |
ef416fc2 | 75 | ;; |
76 | esac | |
77 | else | |
78 | PICFLAG=0 | |
79 | LIBCUPS="libcups.a" | |
80 | LIBCUPSIMAGE="libcupsimage.a" | |
81 | DSO=":" | |
82 | fi | |
83 | ||
f301802f | 84 | # 32-bit and 64-bit libraries need variations of the standard |
85 | # DSOFLAGS... | |
86 | DSO32FLAGS="$DSOFLAGS" | |
87 | DSO64FLAGS="$DSOFLAGS" | |
88 | ||
ef416fc2 | 89 | AC_SUBST(DSO) |
90 | AC_SUBST(DSOFLAGS) | |
f301802f | 91 | AC_SUBST(DSO32FLAGS) |
92 | AC_SUBST(DSO64FLAGS) | |
ef416fc2 | 93 | AC_SUBST(LIBCUPS) |
94 | AC_SUBST(LIBCUPSIMAGE) | |
95 | ||
96 | if test x$enable_shared = xno; then | |
97 | LINKCUPS="../cups/libcups.a" | |
98 | LINKCUPSIMAGE="../filter/libcupsimage.a" | |
99 | else | |
100 | if test $uname = AIX; then | |
101 | LINKCUPS="-lcups_s" | |
102 | LINKCUPSIMAGE="-lcupsimage_s" | |
103 | else | |
104 | LINKCUPS="-lcups" | |
105 | LINKCUPSIMAGE="-lcupsimage" | |
106 | fi | |
107 | fi | |
108 | ||
109 | AC_SUBST(LINKCUPS) | |
110 | AC_SUBST(LINKCUPSIMAGE) | |
111 | ||
112 | dnl Update libraries for DSOs... | |
113 | EXPORT_LDFLAGS="" | |
114 | ||
115 | if test "$DSO" != ":"; then | |
116 | # When using DSOs the image libraries are linked to libcupsimage.so | |
117 | # rather than to the executables. This makes things smaller if you | |
118 | # are using any static libraries, and it also allows us to distribute | |
119 | # a single DSO rather than a bunch... | |
ed486911 | 120 | DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)" |
ef416fc2 | 121 | IMGLIBS="" |
122 | ||
f301802f | 123 | # Tell the run-time linkers where to find a DSO. Some platforms |
124 | # need this option, even when the library is installed in a | |
125 | # standard location... | |
ef416fc2 | 126 | case $uname in |
127 | HP-UX*) | |
f301802f | 128 | # HP-UX needs the path, even for /usr/lib... |
ed486911 | 129 | DSOFLAGS="+s +b $libdir $DSOFLAGS" |
130 | DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS" | |
131 | DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS" | |
132 | LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir" | |
133 | EXPORT_LDFLAGS="-Wl,+s,+b,$libdir" | |
f301802f | 134 | ;; |
ef416fc2 | 135 | SunOS*) |
f301802f | 136 | # Solaris... |
137 | if test $exec_prefix != /usr; then | |
ed486911 | 138 | DSOFLAGS="-R$libdir $DSOFLAGS" |
139 | DSO32FLAGS="-R$LIB32DIR $DSO32FLAGS" | |
140 | DSO64FLAGS="-R$LIB64DIR $DSO64FLAGS" | |
141 | LDFLAGS="$LDFLAGS -R$libdir" | |
142 | EXPORT_LDFLAGS="-R$libdir" | |
f301802f | 143 | fi |
144 | ;; | |
ef416fc2 | 145 | *BSD*) |
f301802f | 146 | # *BSD... |
147 | if test $exec_prefix != /usr; then | |
ed486911 | 148 | DSOFLAGS="-Wl,-R$libdir $DSOFLAGS" |
149 | DSO32FLAGS="-Wl,-R$LIB32DIR $DSO32FLAGS" | |
150 | DSO64FLAGS="-Wl,-R$LIB64DIR $DSO64FLAGS" | |
151 | LDFLAGS="$LDFLAGS -Wl,-R$libdir" | |
152 | EXPORT_LDFLAGS="-Wl,-R$libdir" | |
f301802f | 153 | fi |
154 | ;; | |
155 | IRIX | Linux | GNU) | |
156 | # IRIX, Linux, and HURD... | |
157 | if test $exec_prefix != /usr; then | |
ed486911 | 158 | DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS" |
159 | DSO32FLAGS="-Wl,-rpath,$LIB32DIR $DSO32FLAGS" | |
160 | DSO64FLAGS="-Wl,-rpath,$LIB64DIR $DSO64FLAGS" | |
161 | LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir" | |
162 | EXPORT_LDFLAGS="-Wl,-rpath,$libdir" | |
f301802f | 163 | fi |
164 | ;; | |
ef416fc2 | 165 | esac |
166 | else | |
167 | DSOLIBS="" | |
ed486911 | 168 | IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)" |
ef416fc2 | 169 | fi |
170 | ||
171 | AC_SUBST(DSOLIBS) | |
172 | AC_SUBST(IMGLIBS) | |
173 | AC_SUBST(EXPORT_LDFLAGS) | |
174 | ||
175 | dnl | |
7a6a01dd | 176 | dnl End of "$Id$". |
ef416fc2 | 177 | dnl |