-AC_OUTPUT([Makefile src/Makefile cipher/Makefile
-cipher/blowfish/Makefile doc/Makefile intl/Makefile lib/Makefile
-m4/Makefile po/Makefile.in redhat/Makefile debian/Makefile])
+AC_CACHE_SAVE
+
+dnl These are defined in files in m4/
+tinc_TUNTAP
+
+ use_gcrypt=0
+ use_openssl=0
+
+ AC_ARG_WITH(gcrypt,
+ [ --with-gcrypt Use GCRYPT for all cryptographic functions],
+ [
+ if test "x$withval" = "xyes" ; then
+ use_gcrypt=1
+ else
+ use_gcrypt=0
+ fi
+ ],
+ [use_gcrypt=0])
+
+ AC_ARG_WITH(openssl,
+ [ --with-openssl Use OpenSSL for all cryptographic functions],
+ [
+ if test "x$withval" = "xyes" ; then
+ use_openssl=1
+ else
+ use_openssl=0
+ fi
+ ],
+ [use_openssl=0])
+
+ if test \( $use_gcrypt -eq 0 -a $use_openssl -eq 0 \) \
+ -o \( $use_gcrypt -eq 1 -a $use_openssl -eq 1 \) ; then
+ cat << EOM
+Error: You must select exactly one of GCRYPT or OpenSSL.
+EOM
+ echo use_openssl=$use_openssl, use_gcrypt=$use_gcrypt
+ exit 1
+ fi
+
+ if test $use_gcrypt -eq 1 ; then
+ AC_MSG_RESULT([Selecting GCRYPT for crypto])
+ tinc_GCRYPT
+ AC_DEFINE(USE_GCRYPT)
+ fi
+ if test $use_openssl -eq 1 ; then
+ AC_MSG_RESULT([Selecting OpenSSL for crypto])
+ tinc_OPENSSL
+ AC_DEFINE(USE_OPENSSL)
+ fi
+
+ tinc_ZLIB
+
+dnl Check if support for jumbograms is requested
+AC_ARG_ENABLE(jumbograms,
+ [ --enable-jumbograms enable support for jumbograms (packets up to 9000 bytes)],
+ [ AC_DEFINE(ENABLE_JUMBOGRAMS) ]
+)
+
+dnl Check if checkpoint tracing has to be enabled
+AC_ARG_ENABLE(tracing,
+ [ --enable-tracing enable checkpoint tracing (debugging only)],
+ [ AC_DEFINE(ENABLE_TRACING) ]
+)
+
+AC_SUBST(INCLUDES)
+
+AC_OUTPUT(Makefile
+src/Makefile
+src/pokey/Makefile
+doc/Makefile
+doc/es/Makefile
+intl/Makefile
+lib/Makefile
+m4/Makefile
+po/Makefile.in
+)