]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-sharedlibs.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-sharedlibs.m4
1 dnl
2 dnl "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $"
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)"
36 DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
37 ;;
38 HP-UX*)
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
53 ;;
54 IRIX)
55 LIBCUPS="libcups.so.2"
56 LIBCUPSIMAGE="libcupsimage.so.2"
57 DSO="\$(CC)"
58 DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
59 ;;
60 OSF1* | Linux | GNU | *BSD*)
61 LIBCUPS="libcups.so.2"
62 LIBCUPSIMAGE="libcupsimage.so.2"
63 DSO="\$(CC)"
64 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
65 ;;
66 Darwin*)
67 LIBCUPS="libcups.2.dylib"
68 LIBCUPSIMAGE="libcupsimage.2.dylib"
69 DSO="\$(CC)"
70 DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
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)"
84 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
85 ;;
86 esac
87 else
88 PICFLAG=0
89 LIBCUPS="libcups.a"
90 LIBCUPSIMAGE="libcupsimage.a"
91 DSO=":"
92 fi
93
94 # 32-bit and 64-bit libraries need variations of the standard
95 # DSOFLAGS...
96 DSO32FLAGS="$DSOFLAGS"
97 DSO64FLAGS="$DSOFLAGS"
98
99 AC_SUBST(DSO)
100 AC_SUBST(DSOFLAGS)
101 AC_SUBST(DSO32FLAGS)
102 AC_SUBST(DSO64FLAGS)
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...
130 DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
131 IMGLIBS=""
132
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...
136 case $uname in
137 HP-UX*)
138 # HP-UX needs the path, even for /usr/lib...
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
151 LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
152 EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
153 ;;
154 SunOS*)
155 # Solaris...
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"
162 fi
163 ;;
164 *BSD*)
165 # *BSD...
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"
172 fi
173 ;;
174 IRIX | Linux | GNU)
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"
182 fi
183 ;;
184 esac
185 else
186 DSOLIBS=""
187 IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
188 fi
189
190 AC_SUBST(DSOLIBS)
191 AC_SUBST(IMGLIBS)
192 AC_SUBST(EXPORT_LDFLAGS)
193
194 dnl
195 dnl End of "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $".
196 dnl