From: Junio C Hamano Date: Tue, 21 Jul 2009 18:49:29 GMT Subject: Re: configure: is NEEDS_SSL_WITH_CRYPTO test correct? Message-ID: <7vk521g9c6.fsf@alter.siamese.dyndns.org> In-Reply-To: Brandon Casey writes: > From configure.ac, but re-nested: > > AC_CHECK_LIB([crypto], [SHA1_Init], > [NEEDS_SSL_WITH_CRYPTO=], > [AC_CHECK_LIB([ssl], [SHA1_Init], > [NEEDS_SSL_WITH_CRYPTO=YesPlease NEEDS_SSL_WITH_CRYPTO=], > [NO_OPENSSL=YesPlease])]) Yuck. > should it rather be: > > AC_CHECK_LIB([crypto], [SHA1_Init], > [NEEDS_SSL_WITH_CRYPTO=], > [AC_CHECK_LIB([ssl], [SHA1_Init], > [NEEDS_SSL_WITH_CRYPTO=YesPlease], > [NEEDS_SSL_WITH_CRYPTO= NO_OPENSSL=YesPlease])]) We expect to find SHA1_Init in -lcrypto, and if we find it there we do not do anything funky. If we do not find it in -lcrypto, we try -lssl and if we find it then we know we do need -lssl when saying -lcrypto. Otherwise we do not seem to have OpenSSL. That is how I read your version, and it makes perfect sense to me. > Notice the pairing of "action" parameters to the inner AC_CHECK_LIB(). > The first one seems to set, and then unset NEEDS_SSL_WITH_CRYPTO. Not > sure what is going on there. Was the unsetting of NEEDS_SSL_WITH_CRYPTO > supposed to go into the action-if-not-found section? Thanks.