mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Try searching for libsodium with pkg-config in ./configure.
If libsodium can't be found with PKG_CHECK_MODULES, try AC_CHECK_LIB. If that also fails, abort configure. If a user passes --with-libsodium-libs explicitly, that overrides the pkg-config found location.
This commit is contained in:
parent
c603c8c9e7
commit
2fc5449870
12
configure.ac
12
configure.ac
|
@ -327,6 +327,14 @@ AC_SUBST(MATH_LDFLAGS)
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES([LIBSODIUM], [libsodium],
|
||||||
|
[
|
||||||
|
LIBSODIUM_FOUND="yes"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
LIBSODIUM_FOUND="no"
|
||||||
|
])
|
||||||
|
|
||||||
if test "x$WANT_NACL" = "xyes"; then
|
if test "x$WANT_NACL" = "xyes"; then
|
||||||
NACL_LIBS=
|
NACL_LIBS=
|
||||||
NACL_LDFLAGS=
|
NACL_LDFLAGS=
|
||||||
|
@ -368,7 +376,7 @@ if test "x$WANT_NACL" = "xyes"; then
|
||||||
AC_SUBST(NACL_LDFLAGS)
|
AC_SUBST(NACL_LDFLAGS)
|
||||||
AC_SUBST(NACL_OBJECTS)
|
AC_SUBST(NACL_OBJECTS)
|
||||||
AC_SUBST(NACL_OBJECTS_PKGCONFIG)
|
AC_SUBST(NACL_OBJECTS_PKGCONFIG)
|
||||||
else
|
elif test "x$LIBSODIUM_FOUND" = "xno"; then
|
||||||
LIBSODIUM_LIBS=
|
LIBSODIUM_LIBS=
|
||||||
LIBSODIUM_LDFLAGS=
|
LIBSODIUM_LDFLAGS=
|
||||||
LDFLAGS_SAVE="$LDFLAGS"
|
LDFLAGS_SAVE="$LDFLAGS"
|
||||||
|
@ -428,7 +436,7 @@ if test "x$WANT_NACL" = "xyes"; then
|
||||||
CPPFLAGS="$CPPFLAGS_SAVE"
|
CPPFLAGS="$CPPFLAGS_SAVE"
|
||||||
AC_SUBST(NACL_CFLAGS)
|
AC_SUBST(NACL_CFLAGS)
|
||||||
AC_DEFINE([VANILLA_NACL], [1], [use nacl instead of libsodium])
|
AC_DEFINE([VANILLA_NACL], [1], [use nacl instead of libsodium])
|
||||||
else
|
elif test "x$LIBSODIUM_FOUND" = "xno"; then
|
||||||
LIBSODIUM_CFLAGS=
|
LIBSODIUM_CFLAGS=
|
||||||
CFLAGS_SAVE="$CFLAGS"
|
CFLAGS_SAVE="$CFLAGS"
|
||||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||||
|
|
|
@ -15,13 +15,4 @@ RUN ./configure \
|
||||||
# We use make instead of RUN $MAKE here, because the autotools build will only
|
# 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
|
# ever run natively on the Linux container, never on a Windows cross compilation
|
||||||
# docker instance or an OSX machine.
|
# docker instance or an OSX machine.
|
||||||
make -j`nproc`
|
make distcheck -j`nproc` -k
|
||||||
|
|
||||||
# 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 ***"
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user