]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
f7deaa1a | 2 | dnl "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $" |
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*) | |
b86bc4cf | 39 | case "$uarch" in |
40 | ia64) | |
41 | LIBCUPS="libcups.so.2" | |
42 | LIBCUPSIMAGE="libcupsimage.so.2" | |
43 | DSO="\$(CC)" | |
44 | DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`" | |
45 | ;; | |
46 | *) | |
47 | LIBCUPS="libcups.sl.2" | |
48 | LIBCUPSIMAGE="libcupsimage.sl.2" | |
49 | DSO="\$(LD)" | |
50 | DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`" | |
51 | ;; | |
52 | esac | |
ef416fc2 | 53 | ;; |
54 | IRIX) | |
55 | LIBCUPS="libcups.so.2" | |
56 | LIBCUPSIMAGE="libcupsimage.so.2" | |
57 | DSO="\$(CC)" | |
f301802f | 58 | DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)" |
ef416fc2 | 59 | ;; |
60 | OSF1* | Linux | GNU | *BSD*) | |
61 | LIBCUPS="libcups.so.2" | |
62 | LIBCUPSIMAGE="libcupsimage.so.2" | |
63 | DSO="\$(CC)" | |
f301802f | 64 | DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)" |
ef416fc2 | 65 | ;; |
66 | Darwin*) | |
67 | LIBCUPS="libcups.2.dylib" | |
68 | LIBCUPSIMAGE="libcupsimage.2.dylib" | |
69 | DSO="\$(CC)" | |
f301802f | 70 | DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc" |
ef416fc2 | 71 | ;; |
72 | AIX*) | |
73 | LIBCUPS="libcups_s.a" | |
74 | LIBCUPSIMAGE="libcupsimage_s.a" | |
75 | DSO="\$(CC)" | |
76 | DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)" | |
77 | ;; | |
78 | *) | |
79 | echo "Warning: shared libraries may not be supported. Trying -shared" | |
80 | echo " option with compiler." | |
81 | LIBCUPS="libcups.so.2" | |
82 | LIBCUPSIMAGE="libcupsimage.so.2" | |
83 | DSO="\$(CC)" | |
f301802f | 84 | DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)" |
ef416fc2 | 85 | ;; |
86 | esac | |
87 | else | |
88 | PICFLAG=0 | |
89 | LIBCUPS="libcups.a" | |
90 | LIBCUPSIMAGE="libcupsimage.a" | |
91 | DSO=":" | |
92 | fi | |
93 | ||
f301802f | 94 | # 32-bit and 64-bit libraries need variations of the standard |
95 | # DSOFLAGS... | |
96 | DSO32FLAGS="$DSOFLAGS" | |
97 | DSO64FLAGS="$DSOFLAGS" | |
98 | ||
ef416fc2 | 99 | AC_SUBST(DSO) |
100 | AC_SUBST(DSOFLAGS) | |
f301802f | 101 | AC_SUBST(DSO32FLAGS) |
102 | AC_SUBST(DSO64FLAGS) | |
ef416fc2 | 103 | AC_SUBST(LIBCUPS) |
104 | AC_SUBST(LIBCUPSIMAGE) | |
105 | ||
106 | if test x$enable_shared = xno; then | |
107 | LINKCUPS="../cups/libcups.a" | |
108 | LINKCUPSIMAGE="../filter/libcupsimage.a" | |
109 | else | |
110 | if test $uname = AIX; then | |
111 | LINKCUPS="-lcups_s" | |
112 | LINKCUPSIMAGE="-lcupsimage_s" | |
113 | else | |
114 | LINKCUPS="-lcups" | |
115 | LINKCUPSIMAGE="-lcupsimage" | |
116 | fi | |
117 | fi | |
118 | ||
119 | AC_SUBST(LINKCUPS) | |
120 | AC_SUBST(LINKCUPSIMAGE) | |
121 | ||
122 | dnl Update libraries for DSOs... | |
123 | EXPORT_LDFLAGS="" | |
124 | ||
125 | if test "$DSO" != ":"; then | |
126 | # When using DSOs the image libraries are linked to libcupsimage.so | |
127 | # rather than to the executables. This makes things smaller if you | |
128 | # are using any static libraries, and it also allows us to distribute | |
129 | # a single DSO rather than a bunch... | |
ed486911 | 130 | DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)" |
ef416fc2 | 131 | IMGLIBS="" |
132 | ||
f301802f | 133 | # Tell the run-time linkers where to find a DSO. Some platforms |
134 | # need this option, even when the library is installed in a | |
135 | # standard location... | |
ef416fc2 | 136 | case $uname in |
137 | HP-UX*) | |
f301802f | 138 | # HP-UX needs the path, even for /usr/lib... |
b86bc4cf | 139 | case "$uarch" in |
140 | ia64) | |
141 | DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS" | |
142 | DSO32FLAGS="-Wl,+s,+b,$LIB32DIR $DSO32FLAGS" | |
143 | DSO64FLAGS="-Wl,+s,+b,$LIB64DIR $DSO64FLAGS" | |
144 | ;; | |
145 | *) | |
146 | DSOFLAGS="+s +b $libdir $DSOFLAGS" | |
147 | DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS" | |
148 | DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS" | |
149 | ;; | |
150 | esac | |
ed486911 | 151 | LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir" |
152 | EXPORT_LDFLAGS="-Wl,+s,+b,$libdir" | |
f301802f | 153 | ;; |
ef416fc2 | 154 | SunOS*) |
f301802f | 155 | # Solaris... |
156 | if test $exec_prefix != /usr; then | |
ed486911 | 157 | DSOFLAGS="-R$libdir $DSOFLAGS" |
158 | DSO32FLAGS="-R$LIB32DIR $DSO32FLAGS" | |
159 | DSO64FLAGS="-R$LIB64DIR $DSO64FLAGS" | |
160 | LDFLAGS="$LDFLAGS -R$libdir" | |
161 | EXPORT_LDFLAGS="-R$libdir" | |
f301802f | 162 | fi |
163 | ;; | |
ef416fc2 | 164 | *BSD*) |
f301802f | 165 | # *BSD... |
166 | if test $exec_prefix != /usr; then | |
ed486911 | 167 | DSOFLAGS="-Wl,-R$libdir $DSOFLAGS" |
168 | DSO32FLAGS="-Wl,-R$LIB32DIR $DSO32FLAGS" | |
169 | DSO64FLAGS="-Wl,-R$LIB64DIR $DSO64FLAGS" | |
170 | LDFLAGS="$LDFLAGS -Wl,-R$libdir" | |
171 | EXPORT_LDFLAGS="-Wl,-R$libdir" | |
f301802f | 172 | fi |
173 | ;; | |
174 | IRIX | Linux | GNU) | |
175 | # IRIX, Linux, and HURD... | |
176 | if test $exec_prefix != /usr; then | |
ed486911 | 177 | DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS" |
178 | DSO32FLAGS="-Wl,-rpath,$LIB32DIR $DSO32FLAGS" | |
179 | DSO64FLAGS="-Wl,-rpath,$LIB64DIR $DSO64FLAGS" | |
180 | LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir" | |
181 | EXPORT_LDFLAGS="-Wl,-rpath,$libdir" | |
f301802f | 182 | fi |
183 | ;; | |
ef416fc2 | 184 | esac |
185 | else | |
186 | DSOLIBS="" | |
ed486911 | 187 | IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)" |
ef416fc2 | 188 | fi |
189 | ||
190 | AC_SUBST(DSOLIBS) | |
191 | AC_SUBST(IMGLIBS) | |
192 | AC_SUBST(EXPORT_LDFLAGS) | |
193 | ||
194 | dnl | |
f7deaa1a | 195 | dnl End of "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $". |
ef416fc2 | 196 | dnl |