2 dnl "$Id: cups-sharedlibs.m4 5567 2006-05-22 15:33:11Z 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)"
39 LIBCUPS="libcups.sl.2"
40 LIBCUPSIMAGE="libcupsimage.sl.2"
42 DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
45 LIBCUPS="libcups.so.2"
46 LIBCUPSIMAGE="libcupsimage.so.2"
48 DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
50 OSF1* | Linux | GNU | *BSD*)
51 LIBCUPS="libcups.so.2"
52 LIBCUPSIMAGE="libcupsimage.so.2"
54 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
57 LIBCUPS="libcups.2.dylib"
58 LIBCUPSIMAGE="libcupsimage.2.dylib"
60 DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
64 LIBCUPSIMAGE="libcupsimage_s.a"
66 DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)"
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"
74 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
80 LIBCUPSIMAGE="libcupsimage.a"
84 # 32-bit and 64-bit libraries need variations of the standard
86 DSO32FLAGS="$DSOFLAGS"
87 DSO64FLAGS="$DSOFLAGS"
94 AC_SUBST(LIBCUPSIMAGE)
96 if test x$enable_shared = xno; then
97 LINKCUPS="../cups/libcups.a"
98 LINKCUPSIMAGE="../filter/libcupsimage.a"
100 if test $uname = AIX; then
102 LINKCUPSIMAGE="-lcupsimage_s"
105 LINKCUPSIMAGE="-lcupsimage"
110 AC_SUBST(LINKCUPSIMAGE)
112 dnl Update libraries for DSOs...
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...
120 DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
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...
128 # HP-UX needs the path, even for /usr/lib...
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)"
137 if test $exec_prefix != /usr; then
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)"
147 if test $exec_prefix != /usr; then
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)"
156 # IRIX, Linux, and HURD...
157 if test $exec_prefix != /usr; then
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)"
168 IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
173 AC_SUBST(EXPORT_LDFLAGS)
176 dnl End of "$Id: cups-sharedlibs.m4 5567 2006-05-22 15:33:11Z mike $".