]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-sharedlibs.m4
Remove support for AIX, HP-UX, and OSF/1.
[thirdparty/cups.git] / config-scripts / cups-sharedlibs.m4
1 dnl
2 dnl "$Id$"
3 dnl
4 dnl Shared library support for CUPS.
5 dnl
6 dnl Copyright 2007-2013 by Apple Inc.
7 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
8 dnl
9 dnl These coded instructions, statements, and computer programs are the
10 dnl property of Apple Inc. and are protected by Federal copyright
11 dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 dnl which should have been included with this file. If this file is
13 dnl file is missing or damaged, see the license at "http://www.cups.org/".
14 dnl
15
16 PICFLAG=1
17 DSOFLAGS="${DSOFLAGS:=}"
18
19 AC_ARG_ENABLE(shared, [ --disable-shared do not create shared libraries])
20
21 cupsbase="cups"
22 LIBCUPSBASE="lib$cupsbase"
23 LIBCUPSSTATIC="lib$cupsbase.a"
24
25 if test x$enable_shared != xno; then
26 case "$uname" in
27 SunOS*)
28 LIBCUPS="lib$cupsbase.so.2"
29 LIBCUPSCGI="libcupscgi.so.1"
30 LIBCUPSIMAGE="libcupsimage.so.2"
31 LIBCUPSMIME="libcupsmime.so.1"
32 LIBCUPSPPDC="libcupsppdc.so.1"
33 DSO="\$(CC)"
34 DSOXX="\$(CXX)"
35 DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
36 ;;
37 Linux | GNU | *BSD*)
38 LIBCUPS="lib$cupsbase.so.2"
39 LIBCUPSCGI="libcupscgi.so.1"
40 LIBCUPSIMAGE="libcupsimage.so.2"
41 LIBCUPSMIME="libcupsmime.so.1"
42 LIBCUPSPPDC="libcupsppdc.so.1"
43 DSO="\$(CC)"
44 DSOXX="\$(CXX)"
45 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
46 ;;
47 Darwin*)
48 LIBCUPS="lib$cupsbase.2.dylib"
49 LIBCUPSCGI="libcupscgi.1.dylib"
50 LIBCUPSIMAGE="libcupsimage.2.dylib"
51 LIBCUPSMIME="libcupsmime.1.dylib"
52 LIBCUPSPPDC="libcupsppdc.1.dylib"
53 DSO="\$(CC)"
54 DSOXX="\$(CXX)"
55 DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
56 ;;
57 *)
58 echo "Warning: shared libraries may not be supported. Trying -shared"
59 echo " option with compiler."
60 LIBCUPS="lib$cupsbase.so.2"
61 LIBCUPSCGI="libcupscgi.so.1"
62 LIBCUPSIMAGE="libcupsimage.so.2"
63 LIBCUPSMIME="libcupsmime.so.1"
64 LIBCUPSPPDC="libcupsppdc.so.1"
65 DSO="\$(CC)"
66 DSOXX="\$(CXX)"
67 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
68 ;;
69 esac
70 else
71 PICFLAG=0
72 LIBCUPS="lib$cupsbase.a"
73 LIBCUPSCGI="libcupscgi.a"
74 LIBCUPSIMAGE="libcupsimage.a"
75 LIBCUPSMIME="libcupsmime.a"
76 LIBCUPSPPDC="libcupsppdc.a"
77 DSO=":"
78 DSOXX=":"
79 fi
80
81 AC_SUBST(DSO)
82 AC_SUBST(DSOXX)
83 AC_SUBST(DSOFLAGS)
84 AC_SUBST(LIBCUPS)
85 AC_SUBST(LIBCUPSBASE)
86 AC_SUBST(LIBCUPSCGI)
87 AC_SUBST(LIBCUPSIMAGE)
88 AC_SUBST(LIBCUPSMIME)
89 AC_SUBST(LIBCUPSPPDC)
90 AC_SUBST(LIBCUPSSTATIC)
91
92 if test x$enable_shared = xno; then
93 LINKCUPS="../cups/lib$cupsbase.a"
94 LINKCUPSIMAGE="../filter/libcupsimage.a"
95
96 EXTLINKCUPS="-lcups"
97 EXTLINKCUPSIMAGE="-lcupsimage"
98 else
99 LINKCUPS="-l${cupsbase}"
100 LINKCUPSIMAGE="-lcupsimage"
101
102 EXTLINKCUPS="-lcups"
103 EXTLINKCUPSIMAGE="-lcupsimage"
104 fi
105
106 AC_SUBST(EXTLINKCUPS)
107 AC_SUBST(EXTLINKCUPSIMAGE)
108 AC_SUBST(LINKCUPS)
109 AC_SUBST(LINKCUPSIMAGE)
110
111 dnl Update libraries for DSOs...
112 EXPORT_LDFLAGS=""
113
114 if test "$DSO" != ":"; then
115 # When using DSOs the image libraries are linked to libcupsimage.so
116 # rather than to the executables. This makes things smaller if you
117 # are using any static libraries, and it also allows us to distribute
118 # a single DSO rather than a bunch...
119 DSOLIBS="\$(LIBZ)"
120 IMGLIBS=""
121
122 # Tell the run-time linkers where to find a DSO. Some platforms
123 # need this option, even when the library is installed in a
124 # standard location...
125 case $uname in
126 SunOS*)
127 # Solaris...
128 if test $exec_prefix != /usr; then
129 DSOFLAGS="-R$libdir $DSOFLAGS"
130 LDFLAGS="$LDFLAGS -R$libdir"
131 EXPORT_LDFLAGS="-R$libdir"
132 fi
133 ;;
134 *BSD*)
135 # *BSD...
136 if test $exec_prefix != /usr; then
137 DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
138 LDFLAGS="$LDFLAGS -Wl,-R$libdir"
139 EXPORT_LDFLAGS="-Wl,-R$libdir"
140 fi
141 ;;
142 Linux | GNU)
143 # Linux, and HURD...
144 if test $exec_prefix != /usr; then
145 DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
146 LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
147 EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
148 fi
149 ;;
150 esac
151 else
152 DSOLIBS=""
153 IMGLIBS="\$(LIBZ)"
154 fi
155
156 AC_SUBST(DSOLIBS)
157 AC_SUBST(IMGLIBS)
158 AC_SUBST(EXPORT_LDFLAGS)
159
160 dnl
161 dnl End of "$Id$".
162 dnl