]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-sharedlibs.m4
Merge changes from 1.1.x into 1.2 devel.
[thirdparty/cups.git] / config-scripts / cups-sharedlibs.m4
CommitLineData
74456259 1dnl
753453e4 2dnl "$Id: cups-sharedlibs.m4,v 1.6.2.1 2001/12/26 16:52:11 mike Exp $"
74456259 3dnl
4dnl Shared library support for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2001 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-3111 USA
19dnl
20dnl Voice: (301) 373-9603
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*)
753453e4 33 LIBCUPS="libcups.so.3"
34 LIBCUPSIMAGE="libcupsimage.so.3"
74456259 35 DSO="\$(CC)"
36 DSOFLAGS="$DSOFLAGS -Wl,-h,\$@ -G \$(OPTIM)"
37 ;;
38 HP-UX*)
753453e4 39 LIBCUPS="libcups.sl.3"
40 LIBCUPSIMAGE="libcupsimage.sl.3"
74456259 41 DSO="ld"
42 DSOFLAGS="$DSOFLAGS -b -z +h \$@"
43 ;;
44 OSF1* | Linux* | IRIX* | FreeBSD* | NetBSD* | OpenBSD*)
753453e4 45 LIBCUPS="libcups.so.3"
46 LIBCUPSIMAGE="libcupsimage.so.3"
74456259 47 DSO="\$(CC)"
48 DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
49 ;;
50 Darwin*)
753453e4 51 LIBCUPS="libcups.3.dylib"
52 LIBCUPSIMAGE="libcupsimage.3.dylib"
74456259 53 DSO="ld"
54 DSOFLAGS="$DSOFLAGS -dylib /usr/lib/dylib1.o -lc"
55 ;;
56 AIX*)
57 LIBCUPS="libcups_s.a"
58 LIBCUPSIMAGE="libcupsimage_s.a"
59 DSO="\$(CC)"
60 DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry"
61 ;;
62 *)
63 echo "Warning: shared libraries may not be supported. Trying -shared"
64 echo " option with compiler."
753453e4 65 LIBCUPS="libcups.so.3"
66 LIBCUPSIMAGE="libcupsimage.so.3"
74456259 67 DSO="\$(CC)"
68 DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
69 ;;
70 esac
71else
72 PICFLAG=0
73 LIBCUPS="libcups.a"
74 LIBCUPSIMAGE="libcupsimage.a"
75 DSO=":"
76fi
77
78AC_SUBST(DSO)
79AC_SUBST(DSOFLAGS)
80AC_SUBST(LIBCUPS)
81AC_SUBST(LIBCUPSIMAGE)
82
83if test x$enable_shared = xno; then
84 LINKCUPS="-L../cups -lcups"
85 LINKCUPSIMAGE="-L../filter -lcupsimage"
86 LINKCUPS="$LINKCUPS \$(SSLLIBS)"
87else
88 if test $uname = AIX; then
89
90 LINKCUPS="-L../cups -lcups_s"
91 LINKCUPSIMAGE="-L../filter -lcupsimage_s"
92 else
93 LINKCUPS="-L../cups -lcups"
94 LINKCUPSIMAGE="-L../filter -lcupsimage"
95 fi
96fi
97
98AC_SUBST(LINKCUPS)
99AC_SUBST(LINKCUPSIMAGE)
100
101dnl Update libraries for DSOs...
102if test "$DSO" != ":"; then
103 # When using DSOs the image libraries are linked to libcupsimage.so
104 # rather than to the executables. This makes things smaller if you
105 # are using any static libraries, and it also allows us to distribute
106 # a single DSO rather than a bunch...
107 DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
108 IMGLIBS=""
109
110 # The *BSD, HP-UX, and Solaris run-time linkers need help when
111 # deciding where to find a DSO. Add linker options to tell them
112 # where to find the DSO (usually in /usr/lib... duh!)
113 case $uname in
114 HP-UX*)
115 # HP-UX
116 DSOFLAGS="+b $libdir +fb $DSOFLAGS"
117 LDFLAGS="$LDFLAGS -Wl,+b,$libdir,+fb"
118 ;;
119 SunOS*)
120 # Solaris
121 DSOFLAGS="-R$libdir $DSOFLAGS"
122 LDFLAGS="$LDFLAGS -R$libdir"
123 ;;
124 FreeBSD* | NetBSD* | OpenBSD*)
125 # *BSD
126 DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
127 LDFLAGS="$LDFLAGS -Wl,-R$libdir"
128 ;;
129 Linux*)
130 # Linux
131 DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
132 LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
133 ;;
134 esac
135else
136 DSOLIBS=""
137 IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
138fi
139
140AC_SUBST(DSOLIBS)
141AC_SUBST(IMGLIBS)
142
143dnl
753453e4 144dnl End of "$Id: cups-sharedlibs.m4,v 1.6.2.1 2001/12/26 16:52:11 mike Exp $".
74456259 145dnl