diff --git a/configure.ac b/configure.ac index 46162b44..14a723c6 100644 --- a/configure.ac +++ b/configure.ac @@ -327,6 +327,14 @@ AC_SUBST(MATH_LDFLAGS) # Checks for libraries. +PKG_CHECK_MODULES([LIBSODIUM], [libsodium], + [ + LIBSODIUM_FOUND="yes" + ], + [ + LIBSODIUM_FOUND="no" + ]) + if test "x$WANT_NACL" = "xyes"; then NACL_LIBS= NACL_LDFLAGS= @@ -368,7 +376,7 @@ if test "x$WANT_NACL" = "xyes"; then AC_SUBST(NACL_LDFLAGS) AC_SUBST(NACL_OBJECTS) AC_SUBST(NACL_OBJECTS_PKGCONFIG) -else +elif test "x$LIBSODIUM_FOUND" = "xno"; then LIBSODIUM_LIBS= LIBSODIUM_LDFLAGS= LDFLAGS_SAVE="$LDFLAGS" @@ -428,7 +436,7 @@ if test "x$WANT_NACL" = "xyes"; then CPPFLAGS="$CPPFLAGS_SAVE" AC_SUBST(NACL_CFLAGS) AC_DEFINE([VANILLA_NACL], [1], [use nacl instead of libsodium]) -else +elif test "x$LIBSODIUM_FOUND" = "xno"; then LIBSODIUM_CFLAGS= CFLAGS_SAVE="$CFLAGS" CPPFLAGS_SAVE="$CPPFLAGS" diff --git a/other/travis/autotools-script b/other/travis/autotools-script index 735229fb..18cb2d26 100755 --- a/other/travis/autotools-script +++ b/other/travis/autotools-script @@ -15,13 +15,4 @@ RUN ./configure \ # We use make instead of RUN $MAKE here, because the autotools build will only # ever run natively on the Linux container, never on a Windows cross compilation # docker instance or an OSX machine. -make -j`nproc` - -# This doesn't currently work on Travis, because the autotools build is broken. -# It does not look up libsodium by pkg-config, so without the --with flags it -# won't find it. We don't care that much about distcheck at this point, but we -# do care whether it configures/builds at all, which is exercised by the make -# call above. Tests are executed by the cmake build. -echo "*** make distcheck currently fails; see https://github.com/TokTok/toxcore/blob/master/other/travis/autotools-script#L16 ***" -make distcheck -j`nproc` \ - || echo "*** make distcheck has failed as expected; don't be alarmed ***" +make distcheck -j`nproc` -k