2 dnl "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $"
4 dnl Shared library support for the Common UNIX Printing System (CUPS).
6 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
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
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
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
26 DSOFLAGS="${DSOFLAGS:=}"
28 AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries, default=yes])
30 if test x$enable_shared != xno; then
33 LIBCUPS="libcups.so.2"
34 LIBCUPSIMAGE="libcupsimage.so.2"
36 DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
41 LIBCUPS="libcups.so.2"
42 LIBCUPSIMAGE="libcupsimage.so.2"
44 DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
47 LIBCUPS="libcups.sl.2"
48 LIBCUPSIMAGE="libcupsimage.sl.2"
50 DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
55 LIBCUPS="libcups.so.2"
56 LIBCUPSIMAGE="libcupsimage.so.2"
58 DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
60 OSF1* | Linux | GNU | *BSD*)
61 LIBCUPS="libcups.so.2"
62 LIBCUPSIMAGE="libcupsimage.so.2"
64 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
67 LIBCUPS="libcups.2.dylib"
68 LIBCUPSIMAGE="libcupsimage.2.dylib"
70 DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
74 LIBCUPSIMAGE="libcupsimage_s.a"
76 DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)"
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"
84 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
90 LIBCUPSIMAGE="libcupsimage.a"
94 # 32-bit and 64-bit libraries need variations of the standard
96 DSO32FLAGS="$DSOFLAGS"
97 DSO64FLAGS="$DSOFLAGS"
104 AC_SUBST(LIBCUPSIMAGE)
106 if test x$enable_shared = xno; then
107 LINKCUPS="../cups/libcups.a"
108 LINKCUPSIMAGE="../filter/libcupsimage.a"
110 if test $uname = AIX; then
112 LINKCUPSIMAGE="-lcupsimage_s"
115 LINKCUPSIMAGE="-lcupsimage"
120 AC_SUBST(LINKCUPSIMAGE)
122 dnl Update libraries for DSOs...
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...
130 DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
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...
138 # HP-UX needs the path, even for /usr/lib...
141 DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS"
142 DSO32FLAGS="-Wl,+s,+b,$LIB32DIR $DSO32FLAGS"
143 DSO64FLAGS="-Wl,+s,+b,$LIB64DIR $DSO64FLAGS"
146 DSOFLAGS="+s +b $libdir $DSOFLAGS"
147 DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
148 DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
151 LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
152 EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
156 if test $exec_prefix != /usr; then
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"
166 if test $exec_prefix != /usr; then
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"
175 # IRIX, Linux, and HURD...
176 if test $exec_prefix != /usr; then
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"
187 IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
192 AC_SUBST(EXPORT_LDFLAGS)
195 dnl End of "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $".