]> 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
bc44d920 2dnl "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3dnl
4dnl Shared library support for the Common UNIX Printing System (CUPS).
5dnl
bc44d920 6dnl Copyright 2007 by Apple Inc.
ef416fc2 7dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
8dnl
9dnl These coded instructions, statements, and computer programs are the
bc44d920 10dnl property of Apple Inc. and are protected by Federal copyright
11dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12dnl which should have been included with this file. If this file is
13dnl file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14dnl
15
16PICFLAG=1
17DSOFLAGS="${DSOFLAGS:=}"
18
19AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries, default=yes])
20
21if test x$enable_shared != xno; then
22 case "$uname" in
23 SunOS* | UNIX_S*)
24 LIBCUPS="libcups.so.2"
25 LIBCUPSIMAGE="libcupsimage.so.2"
26 DSO="\$(CC)"
f301802f 27 DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
ef416fc2 28 ;;
29 HP-UX*)
b86bc4cf 30 case "$uarch" in
31 ia64)
32 LIBCUPS="libcups.so.2"
33 LIBCUPSIMAGE="libcupsimage.so.2"
34 DSO="\$(CC)"
35 DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
36 ;;
37 *)
38 LIBCUPS="libcups.sl.2"
39 LIBCUPSIMAGE="libcupsimage.sl.2"
40 DSO="\$(LD)"
41 DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
42 ;;
43 esac
ef416fc2 44 ;;
45 IRIX)
46 LIBCUPS="libcups.so.2"
47 LIBCUPSIMAGE="libcupsimage.so.2"
48 DSO="\$(CC)"
f301802f 49 DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
ef416fc2 50 ;;
51 OSF1* | Linux | GNU | *BSD*)
52 LIBCUPS="libcups.so.2"
53 LIBCUPSIMAGE="libcupsimage.so.2"
54 DSO="\$(CC)"
f301802f 55 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
ef416fc2 56 ;;
57 Darwin*)
58 LIBCUPS="libcups.2.dylib"
59 LIBCUPSIMAGE="libcupsimage.2.dylib"
60 DSO="\$(CC)"
f301802f 61 DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
ef416fc2 62 ;;
63 AIX*)
64 LIBCUPS="libcups_s.a"
65 LIBCUPSIMAGE="libcupsimage_s.a"
66 DSO="\$(CC)"
67 DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)"
68 ;;
69 *)
70 echo "Warning: shared libraries may not be supported. Trying -shared"
71 echo " option with compiler."
72 LIBCUPS="libcups.so.2"
73 LIBCUPSIMAGE="libcupsimage.so.2"
74 DSO="\$(CC)"
f301802f 75 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
ef416fc2 76 ;;
77 esac
78else
79 PICFLAG=0
80 LIBCUPS="libcups.a"
81 LIBCUPSIMAGE="libcupsimage.a"
82 DSO=":"
83fi
84
f301802f 85# 32-bit and 64-bit libraries need variations of the standard
86# DSOFLAGS...
87DSO32FLAGS="$DSOFLAGS"
88DSO64FLAGS="$DSOFLAGS"
89
ef416fc2 90AC_SUBST(DSO)
91AC_SUBST(DSOFLAGS)
f301802f 92AC_SUBST(DSO32FLAGS)
93AC_SUBST(DSO64FLAGS)
ef416fc2 94AC_SUBST(LIBCUPS)
95AC_SUBST(LIBCUPSIMAGE)
96
97if test x$enable_shared = xno; then
98 LINKCUPS="../cups/libcups.a"
99 LINKCUPSIMAGE="../filter/libcupsimage.a"
100else
101 if test $uname = AIX; then
102 LINKCUPS="-lcups_s"
103 LINKCUPSIMAGE="-lcupsimage_s"
104 else
105 LINKCUPS="-lcups"
106 LINKCUPSIMAGE="-lcupsimage"
107 fi
108fi
109
110AC_SUBST(LINKCUPS)
111AC_SUBST(LINKCUPSIMAGE)
112
113dnl Update libraries for DSOs...
114EXPORT_LDFLAGS=""
115
116if test "$DSO" != ":"; then
117 # When using DSOs the image libraries are linked to libcupsimage.so
118 # rather than to the executables. This makes things smaller if you
119 # are using any static libraries, and it also allows us to distribute
120 # a single DSO rather than a bunch...
ed486911 121 DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
ef416fc2 122 IMGLIBS=""
123
f301802f 124 # Tell the run-time linkers where to find a DSO. Some platforms
125 # need this option, even when the library is installed in a
126 # standard location...
ef416fc2 127 case $uname in
128 HP-UX*)
f301802f 129 # HP-UX needs the path, even for /usr/lib...
b86bc4cf 130 case "$uarch" in
131 ia64)
132 DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS"
133 DSO32FLAGS="-Wl,+s,+b,$LIB32DIR $DSO32FLAGS"
134 DSO64FLAGS="-Wl,+s,+b,$LIB64DIR $DSO64FLAGS"
135 ;;
136 *)
137 DSOFLAGS="+s +b $libdir $DSOFLAGS"
138 DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
139 DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
140 ;;
141 esac
ed486911 142 LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
143 EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
f301802f 144 ;;
ef416fc2 145 SunOS*)
f301802f 146 # Solaris...
147 if test $exec_prefix != /usr; then
ed486911 148 DSOFLAGS="-R$libdir $DSOFLAGS"
149 DSO32FLAGS="-R$LIB32DIR $DSO32FLAGS"
150 DSO64FLAGS="-R$LIB64DIR $DSO64FLAGS"
151 LDFLAGS="$LDFLAGS -R$libdir"
152 EXPORT_LDFLAGS="-R$libdir"
f301802f 153 fi
154 ;;
ef416fc2 155 *BSD*)
f301802f 156 # *BSD...
157 if test $exec_prefix != /usr; then
ed486911 158 DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
159 DSO32FLAGS="-Wl,-R$LIB32DIR $DSO32FLAGS"
160 DSO64FLAGS="-Wl,-R$LIB64DIR $DSO64FLAGS"
161 LDFLAGS="$LDFLAGS -Wl,-R$libdir"
162 EXPORT_LDFLAGS="-Wl,-R$libdir"
f301802f 163 fi
164 ;;
165 IRIX | Linux | GNU)
166 # IRIX, Linux, and HURD...
167 if test $exec_prefix != /usr; then
ed486911 168 DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
169 DSO32FLAGS="-Wl,-rpath,$LIB32DIR $DSO32FLAGS"
170 DSO64FLAGS="-Wl,-rpath,$LIB64DIR $DSO64FLAGS"
171 LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
172 EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
f301802f 173 fi
174 ;;
ef416fc2 175 esac
176else
177 DSOLIBS=""
ed486911 178 IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
ef416fc2 179fi
180
181AC_SUBST(DSOLIBS)
182AC_SUBST(IMGLIBS)
183AC_SUBST(EXPORT_LDFLAGS)
184
185dnl
bc44d920 186dnl End of "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 187dnl