]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-sharedlibs.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-sharedlibs.m4
CommitLineData
ef416fc2 1dnl
f7deaa1a 2dnl "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $"
ef416fc2 3dnl
4dnl Shared library support for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
7dnl
8dnl These coded instructions, statements, and computer programs are the
9dnl property of Easy Software Products and are protected by Federal
10dnl copyright law. Distribution and use rights are outlined in the file
11dnl "LICENSE.txt" which should have been included with this file. If this
12dnl file is missing or damaged please contact Easy Software Products
13dnl at:
14dnl
15dnl Attn: CUPS Licensing Information
16dnl Easy Software Products
17dnl 44141 Airport View Drive, Suite 204
18dnl Hollywood, Maryland 20636 USA
19dnl
20dnl Voice: (301) 373-9600
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25PICFLAG=1
26DSOFLAGS="${DSOFLAGS:=}"
27
28AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries, default=yes])
29
30if 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
87else
88 PICFLAG=0
89 LIBCUPS="libcups.a"
90 LIBCUPSIMAGE="libcupsimage.a"
91 DSO=":"
92fi
93
f301802f 94# 32-bit and 64-bit libraries need variations of the standard
95# DSOFLAGS...
96DSO32FLAGS="$DSOFLAGS"
97DSO64FLAGS="$DSOFLAGS"
98
ef416fc2 99AC_SUBST(DSO)
100AC_SUBST(DSOFLAGS)
f301802f 101AC_SUBST(DSO32FLAGS)
102AC_SUBST(DSO64FLAGS)
ef416fc2 103AC_SUBST(LIBCUPS)
104AC_SUBST(LIBCUPSIMAGE)
105
106if test x$enable_shared = xno; then
107 LINKCUPS="../cups/libcups.a"
108 LINKCUPSIMAGE="../filter/libcupsimage.a"
109else
110 if test $uname = AIX; then
111 LINKCUPS="-lcups_s"
112 LINKCUPSIMAGE="-lcupsimage_s"
113 else
114 LINKCUPS="-lcups"
115 LINKCUPSIMAGE="-lcupsimage"
116 fi
117fi
118
119AC_SUBST(LINKCUPS)
120AC_SUBST(LINKCUPSIMAGE)
121
122dnl Update libraries for DSOs...
123EXPORT_LDFLAGS=""
124
125if 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
185else
186 DSOLIBS=""
ed486911 187 IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
ef416fc2 188fi
189
190AC_SUBST(DSOLIBS)
191AC_SUBST(IMGLIBS)
192AC_SUBST(EXPORT_LDFLAGS)
193
194dnl
f7deaa1a 195dnl End of "$Id: cups-sharedlibs.m4 6135 2006-12-06 18:22:38Z mike $".
ef416fc2 196dnl