-nodist_tincd_SOURCES = \
- cipher.c crypto.c ecdh.c ecdsa.c digest.c prf.c rsa.c
-
-tinc_SOURCES = \
- utils.c getopt.c getopt1.c dropin.c \
- info.c list.c subnet_parse.c tincctl.c top.c names.c
+if OPENSSL
+tincd_SOURCES += \
+ openssl/cipher.c openssl/cipher.h \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c \
+ openssl/rsa.c \
+ openssl/log.c openssl/log.h
+tinc_SOURCES += \
+ openssl/cipher.c openssl/cipher.h \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c \
+ openssl/rsa.c \
+ openssl/rsagen.c \
+ openssl/log.c openssl/log.h
+sptps_test_SOURCES += \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c \
+ openssl/log.c openssl/log.h
+sptps_keypair_SOURCES += \
+ openssl/crypto.c
+sptps_speed_SOURCES += \
+ openssl/crypto.c \
+ openssl/digest.c openssl/digest.h \
+ openssl/prf.c \
+ openssl/log.c openssl/log.h
+else
+if GCRYPT
+tincd_SOURCES += \
+ gcrypt/cipher.c gcrypt/cipher.h \
+ gcrypt/crypto.c \
+ gcrypt/digest.c gcrypt/digest.h \
+ gcrypt/pem.c gcrypt/pem.h \
+ gcrypt/prf.c \
+ gcrypt/rsa.c gcrypt/rsa.h
+tinc_SOURCES += \
+ gcrypt/cipher.c gcrypt/cipher.h \
+ gcrypt/crypto.c \
+ gcrypt/digest.c gcrypt/digest.h \
+ gcrypt/pem.c gcrypt/pem.h \
+ gcrypt/prf.c \
+ gcrypt/rsa.c gcrypt/rsa.h \
+ gcrypt/rsagen.c
+sptps_test_SOURCES += \
+ gcrypt/cipher.c gcrypt/cipher.h \
+ gcrypt/crypto.c \
+ gcrypt/digest.c gcrypt/digest.h \
+ gcrypt/prf.c
+sptps_keypair_SOURCES += \
+ gcrypt/crypto.c
+sptps_speed_SOURCES += \
+ gcrypt/crypto.c \
+ gcrypt/digest.c gcrypt/digest.h \
+ gcrypt/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