4 dnl Shared library support for CUPS.
6 dnl Copyright 2007-2013 by Apple Inc.
7 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
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/".
17 DSOFLAGS="${DSOFLAGS:=}"
19 AC_ARG_ENABLE(shared, [ --disable-shared do not create shared libraries])
22 LIBCUPSBASE="lib$cupsbase"
23 LIBCUPSSTATIC="lib$cupsbase.a"
25 if test x$enable_shared != xno; then
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"
35 DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
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"
45 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
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"
55 DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
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"
67 DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
72 LIBCUPS="lib$cupsbase.a"
73 LIBCUPSCGI="libcupscgi.a"
74 LIBCUPSIMAGE="libcupsimage.a"
75 LIBCUPSMIME="libcupsmime.a"
76 LIBCUPSPPDC="libcupsppdc.a"
87 AC_SUBST(LIBCUPSIMAGE)
90 AC_SUBST(LIBCUPSSTATIC)
92 if test x$enable_shared = xno; then
93 LINKCUPS="../cups/lib$cupsbase.a"
94 LINKCUPSIMAGE="../filter/libcupsimage.a"
97 EXTLINKCUPSIMAGE="-lcupsimage"
99 LINKCUPS="-l${cupsbase}"
100 LINKCUPSIMAGE="-lcupsimage"
103 EXTLINKCUPSIMAGE="-lcupsimage"
106 AC_SUBST(EXTLINKCUPS)
107 AC_SUBST(EXTLINKCUPSIMAGE)
109 AC_SUBST(LINKCUPSIMAGE)
111 dnl Update libraries for DSOs...
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...
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...
128 if test $exec_prefix != /usr; then
129 DSOFLAGS="-R$libdir $DSOFLAGS"
130 LDFLAGS="$LDFLAGS -R$libdir"
131 EXPORT_LDFLAGS="-R$libdir"
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"
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"
158 AC_SUBST(EXPORT_LDFLAGS)