]> 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
2dnl "$Id: cups-sharedlibs.m4 4800 2005-10-18 18:06:20Z mike $"
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)"
36 DSOFLAGS="$DSOFLAGS -Wl,-h,\$@ -G \$(OPTIM)"
37 ;;
38 HP-UX*)
39 LIBCUPS="libcups.sl.2"
40 LIBCUPSIMAGE="libcupsimage.sl.2"
41 DSO="ld"
42 DSOFLAGS="$DSOFLAGS -b -z +h \$@"
43 ;;
44 IRIX)
45 LIBCUPS="libcups.so.2"
46 LIBCUPSIMAGE="libcupsimage.so.2"
47 DSO="\$(CC)"
48 DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi2.6,-soname,\$@ -shared \$(OPTIM)"
49 ;;
50 OSF1* | Linux | GNU | *BSD*)
51 LIBCUPS="libcups.so.2"
52 LIBCUPSIMAGE="libcupsimage.so.2"
53 DSO="\$(CC)"
54 DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
55 ;;
56 Darwin*)
57 LIBCUPS="libcups.2.dylib"
58 LIBCUPSIMAGE="libcupsimage.2.dylib"
59 DSO="\$(CC)"
60 DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -lc"
61 ;;
62 AIX*)
63 LIBCUPS="libcups_s.a"
64 LIBCUPSIMAGE="libcupsimage_s.a"
65 DSO="\$(CC)"
66 DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)"
67 ;;
68 *)
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"
73 DSO="\$(CC)"
74 DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
75 ;;
76 esac
77else
78 PICFLAG=0
79 LIBCUPS="libcups.a"
80 LIBCUPSIMAGE="libcupsimage.a"
81 DSO=":"
82fi
83
84AC_SUBST(DSO)
85AC_SUBST(DSOFLAGS)
86AC_SUBST(LIBCUPS)
87AC_SUBST(LIBCUPSIMAGE)
88
89if test x$enable_shared = xno; then
90 LINKCUPS="../cups/libcups.a"
91 LINKCUPSIMAGE="../filter/libcupsimage.a"
92else
93 if test $uname = AIX; then
94 LINKCUPS="-lcups_s"
95 LINKCUPSIMAGE="-lcupsimage_s"
96 else
97 LINKCUPS="-lcups"
98 LINKCUPSIMAGE="-lcupsimage"
99 fi
100fi
101
102AC_SUBST(LINKCUPS)
103AC_SUBST(LINKCUPSIMAGE)
104
105dnl Update libraries for DSOs...
106EXPORT_LDFLAGS=""
107
108if test "$DSO" != ":"; then
109 # When using DSOs the image libraries are linked to libcupsimage.so
110 # rather than to the executables. This makes things smaller if you
111 # are using any static libraries, and it also allows us to distribute
112 # a single DSO rather than a bunch...
113 DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
114 IMGLIBS=""
115
116 # The *BSD, HP-UX, and Solaris run-time linkers need help when
117 # deciding where to find a DSO. Add linker options to tell them
118 # where to find the DSO (usually in /usr/lib... duh!)
119 case $uname in
120 HP-UX*)
121 # HP-UX
122 DSOFLAGS="+s +b $libdir $DSOFLAGS"
123 LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
124 EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
125 ;;
126 SunOS*)
127 # Solaris
128 DSOFLAGS="-R$libdir $DSOFLAGS"
129 LDFLAGS="$LDFLAGS -R$libdir"
130 EXPORT_LDFLAGS="-R$libdir"
131 ;;
132 *BSD*)
133 # *BSD
134 DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
135 LDFLAGS="$LDFLAGS -Wl,-R$libdir"
136 EXPORT_LDFLAGS="-Wl,-R$libdir"
137 ;;
138 Linux | GNU)
139 # Linux and HURD
140 DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
141 LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
142 EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
143 ;;
144 esac
145else
146 DSOLIBS=""
147 IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
148fi
149
150AC_SUBST(DSOLIBS)
151AC_SUBST(IMGLIBS)
152AC_SUBST(EXPORT_LDFLAGS)
153
154dnl
155dnl End of "$Id: cups-sharedlibs.m4 4800 2005-10-18 18:06:20Z mike $".
156dnl