+if OPENSSL
+tincd_SOURCES += \
+ openssl/cipher.c \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c \
+ openssl/rsa.c
+tinc_SOURCES += \
+ openssl/cipher.c \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c \
+ openssl/rsa.c \
+ openssl/rsagen.c
+sptps_test_SOURCES += \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c
+sptps_keypair_SOURCES += \
+ openssl/crypto.c
+sptps_speed_SOURCES += \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c
+else
+if GCRYPT
+tincd_SOURCES += \
+ gcrypt/cipher.c \
+ gcrypt/crypto.c \
+ gcrypt/digest.c gcrypt/digest.h \
+ gcrypt/prf.c \
+ gcrypt/rsa.c
+tinc_SOURCES += \
+ gcrypt/cipher.c \
+ gcrypt/crypto.c \
+ gcrypt/digest.c gcrypt/digest.h \
+ gcrypt/prf.c \
+ gcrypt/rsa.c \
+ gcrypt/rsagen.c
+sptps_test_SOURCES += \
+ gcrypt/cipher.c \
+ gcrypt/crypto.c \
+ gcrypt/digest.c gcrypt/digest.h \
+ gcrypt/prf.c
+sptps_keypair_SOURCES += \
+ openssl/crypto.c
+sptps_speed_SOURCES += \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c
+else
+tincd_SOURCES += \
+ nolegacy/crypto.c \
+ nolegacy/prf.c
+tinc_SOURCES += \
+ nolegacy/crypto.c \
+ nolegacy/prf.c
+sptps_test_SOURCES += \
+ nolegacy/crypto.c \
+ nolegacy/prf.c
+sptps_keypair_SOURCES += \
+ nolegacy/crypto.c
+sptps_speed_SOURCES += \
+ nolegacy/crypto.c \
+ nolegacy/prf.c
+endif
+endif
+
+if MINIUPNPC
+tincd_SOURCES += upnp.h upnp.c
+tincd_LDADD = $(MINIUPNPC_LIBS)
+tincd_LDFLAGS = -pthread
+endif
+
+tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
+sptps_speed_LDADD = -lrt
+
+LIBS = @LIBS@ -lm