2022-05-13 20:08:20 +08:00
|
|
|
|
dnl
|
|
|
|
|
dnl Shared library support for CUPS.
|
|
|
|
|
dnl
|
2023-01-11 16:57:48 +08:00
|
|
|
|
dnl Copyright © 2021 by OpenPrinting.
|
2022-05-13 20:08:20 +08:00
|
|
|
|
dnl Copyright © 2007-2018 by Apple Inc.
|
|
|
|
|
dnl Copyright © 1997-2005 by Easy Software Products, all rights reserved.
|
|
|
|
|
dnl
|
|
|
|
|
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
|
|
|
|
dnl information.
|
|
|
|
|
dnl
|
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
PICFLAG="1"
|
2022-05-13 20:08:20 +08:00
|
|
|
|
DSOFLAGS="${DSOFLAGS:=}"
|
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
AC_ARG_ENABLE([shared], AS_HELP_STRING([--disable-shared], [do not create shared libraries]))
|
2022-05-13 20:08:20 +08:00
|
|
|
|
|
|
|
|
|
cupsbase="cups"
|
|
|
|
|
LIBCUPSBASE="lib$cupsbase"
|
|
|
|
|
LIBCUPSIMAGE=""
|
|
|
|
|
LIBCUPSSTATIC="lib$cupsbase.a"
|
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
AS_IF([test x$enable_shared != xno], [
|
|
|
|
|
AS_CASE(["$host_os_name"], [sunos*], [
|
|
|
|
|
LIBCUPS="lib$cupsbase.so.2"
|
|
|
|
|
AS_IF([test "x$cupsimagebase" != x], [
|
|
|
|
|
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
|
|
|
|
|
])
|
|
|
|
|
DSO="\$(CC)"
|
|
|
|
|
DSOXX="\$(CXX)"
|
|
|
|
|
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G"
|
|
|
|
|
], [linux* | gnu* | *bsd*], [
|
|
|
|
|
LIBCUPS="lib$cupsbase.so.2"
|
|
|
|
|
AS_IF([test "x$cupsimagebase" != x], [
|
|
|
|
|
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
|
|
|
|
|
])
|
|
|
|
|
DSO="\$(CC)"
|
|
|
|
|
DSOXX="\$(CXX)"
|
|
|
|
|
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
|
|
|
|
|
], [darwin*], [
|
|
|
|
|
LIBCUPS="lib$cupsbase.2.dylib"
|
|
|
|
|
AS_IF([test "x$cupsimagebase" != x], [
|
|
|
|
|
LIBCUPSIMAGE="lib$cupsimagebase.2.dylib"
|
|
|
|
|
])
|
|
|
|
|
DSO="\$(CC)"
|
|
|
|
|
DSOXX="\$(CXX)"
|
|
|
|
|
DSOFLAGS="$DSOFLAGS -Wl,-no_warn_inits -dynamiclib -single_module -lc"
|
|
|
|
|
], [aix*], [
|
|
|
|
|
LIBCUPS="lib$cupsbase.so.2"
|
|
|
|
|
AS_IF([test "x$cupsimagebase" != x], [
|
|
|
|
|
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
|
|
|
|
|
])
|
|
|
|
|
DSO="\$(CC)"
|
|
|
|
|
DSOXX="\$(CXX)"
|
|
|
|
|
DSOFLAGS="$DSOFLAGS -Wl,-G -o \`basename \$@\`"
|
|
|
|
|
LDFLAGS="$LDFLAGS $TLSFLAGS -liconv -lz -lm"
|
|
|
|
|
], [*], [
|
|
|
|
|
AC_MSG_NOTICE([Warning: Shared libraries may not work, trying -shared option.])
|
|
|
|
|
LIBCUPS="lib$cupsbase.so.2"
|
|
|
|
|
AS_IF([test "x$cupsimagebase" != x], [
|
|
|
|
|
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
|
|
|
|
|
])
|
|
|
|
|
DSO="\$(CC)"
|
|
|
|
|
DSOXX="\$(CXX)"
|
|
|
|
|
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
|
|
|
|
|
])
|
|
|
|
|
], [
|
|
|
|
|
PICFLAG=0
|
|
|
|
|
LIBCUPS="lib$cupsbase.a"
|
|
|
|
|
AS_IF([test "x$cupsimagebase" != x], [
|
|
|
|
|
LIBCUPSIMAGE="lib$cupsimagebase.a"
|
|
|
|
|
])
|
|
|
|
|
DSO=":"
|
|
|
|
|
DSOXX=":"
|
|
|
|
|
])
|
2022-05-13 20:08:20 +08:00
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
AC_SUBST([DSO])
|
|
|
|
|
AC_SUBST([DSOXX])
|
|
|
|
|
AC_SUBST([DSOFLAGS])
|
|
|
|
|
AC_SUBST([LIBCUPS])
|
|
|
|
|
AC_SUBST([LIBCUPSBASE])
|
|
|
|
|
AC_SUBST([LIBCUPSIMAGE])
|
|
|
|
|
AC_SUBST([LIBCUPSSTATIC])
|
2022-05-13 20:08:20 +08:00
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
AS_IF([test x$enable_shared = xno], [
|
|
|
|
|
LINKCUPS="../cups/lib$cupsbase.a \$(LIBS)"
|
|
|
|
|
EXTLINKCUPS="-lcups \$LIBS"
|
|
|
|
|
], [
|
|
|
|
|
LINKCUPS="-L../cups -l${cupsbase}"
|
|
|
|
|
EXTLINKCUPS="-lcups"
|
|
|
|
|
])
|
2022-05-13 20:08:20 +08:00
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
AC_SUBST([EXTLINKCUPS])
|
|
|
|
|
AC_SUBST([LINKCUPS])
|
2022-05-13 20:08:20 +08:00
|
|
|
|
|
|
|
|
|
dnl Update libraries for DSOs...
|
|
|
|
|
EXPORT_LDFLAGS=""
|
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
AS_IF([test "$DSO" != ":"], [
|
|
|
|
|
# Tell the run-time linkers where to find a DSO. Some platforms
|
|
|
|
|
# need this option, even when the library is installed in a
|
|
|
|
|
# standard location...
|
|
|
|
|
AS_CASE([$host_os_name], [sunos*], [
|
|
|
|
|
# Solaris...
|
|
|
|
|
AS_IF([test $exec_prefix != /usr], [
|
|
|
|
|
DSOFLAGS="-R$libdir $DSOFLAGS"
|
|
|
|
|
LDFLAGS="$LDFLAGS -R$libdir"
|
|
|
|
|
EXPORT_LDFLAGS="-R$libdir"
|
|
|
|
|
])
|
|
|
|
|
], [*bsd*], [
|
|
|
|
|
# *BSD...
|
|
|
|
|
AS_IF([test $exec_prefix != /usr], [
|
|
|
|
|
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
|
|
|
|
|
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
|
|
|
|
|
EXPORT_LDFLAGS="-Wl,-R$libdir"
|
|
|
|
|
])
|
|
|
|
|
], [linux* | gnu*], [
|
|
|
|
|
# Linux, and HURD...
|
|
|
|
|
AS_IF([test $exec_prefix != /usr], [
|
|
|
|
|
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
|
|
|
|
|
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
|
|
|
|
|
EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
|
|
|
|
|
])
|
|
|
|
|
])
|
|
|
|
|
])
|
2022-05-13 20:08:20 +08:00
|
|
|
|
|
2023-01-11 16:57:48 +08:00
|
|
|
|
AC_SUBST([EXPORT_LDFLAGS])
|