#
# Definitions of libraries required to build libpcp.
# Note: used elsewhere in the build to link statically with libpcp
#

ifeq "$(ENABLE_SECURE)" "true"
LIBPCP_LDLIBS += $(LIB_FOR_SSL) $(LIB_FOR_NSS) $(LIB_FOR_NSPR) $(LIB_FOR_SASL) $(LIB_FOR_LZMA)
LIBPCP_CFLAGS += $(NSSCFLAGS) $(NSPRCFLAGS) $(SASLCFLAGS)
endif

ifeq "$(ENABLE_AVAHI)" "true"
LIBPCP_LDLIBS += $(LIB_FOR_AVAHI)
LIBPCP_CFLAGS += $(AVAHICFLAGS)
endif

ifeq "$(ENABLE_LZMA)" "true"
LIBPCP_LDLIBS += $(LIB_FOR_LZMA)
LIBPCP_CFLAGS += $(LZMACFLAGS)
endif

ifeq "$(TARGET_OS)" "mingw"
LIBPCP_LDLIBS += -lpsapi -lws2_32 -liphlpapi
endif

ifeq "$(TARGET_OS)" "solaris"
# enables standards compliant thread-safe interfaces (accounts.c)
LIBPCP_CFLAGS += -D_POSIX_PTHREAD_SEMANTICS
LIBPCP_LDLIBS += $(PLDLIBS)
endif

ifeq "$(ENABLE_SYSTEMD)" "true"
LIBPCP_LDLIBS += $(SYSTEMD_LIBS)
LIBPCP_CFLAGS += $(SYSTEMD_CFLAGS) -DHAVE_SYSTEMD
endif

ifeq "$(LIB_FOR_BASENAME)" "-lpcp"
# don't need to be linked to myself in this case!
LIB_FOR_BASENAME =
endif

LIBPCP_LDLIBS	+= $(PCPLIB_EXTRAS)

