Open
Description
The #include
directives assume that the directory ./src/
or the installed directory $(PREFIX)/include/libsnark
(see Makefile
L282 at 0b928a7b
(latest on branch master
)) are on the include path. This is non-standard and complicates detecting this library with GNU autoconf
.
The zcash configure.ac
L704-L718 at 108650a5
(latest on branch zc.v0.11.2.latest
) demonstrates the difficulty of working around this issue for dependent programs that use autoconf
:
# libsnark header layout is broken unless cpp's -I is passed with the
# libsnark directory, so for now we use this hideous workaround:
echo 'Hunting for libsnark include directory...'
[LIBSNARK_INCDIR="$(echo "$CPPFLAGS" | sed 's,^.*-I\([^ ]*/include\).*$,\1/libsnark,')"]
if test -d "$LIBSNARK_INCDIR"; then
echo "Found libsnark include directory: $LIBSNARK_INCDIR"
else
AC_MSG_ERROR(libsnark include directory not found)
fi
CPPFLAGS="-I$LIBSNARK_INCDIR $CPPFLAGS"
# Now check for libsnark compilability using traditional autoconf tests:
AC_CHECK_HEADER([libsnark/gadgetlib1/gadget.hpp],,AC_MSG_ERROR(libsnark headers missing))
AC_CHECK_LIB([snark],[main],LIBSNARK_LIBS=-lsnark, [AC_MSG_ERROR(libsnark missing)], [-lgmpxx])