diff --git a/config.subr b/config.subr
index ad8a521..9ff8086 100644
--- a/config.subr
+++ b/config.subr
@@ -81,8 +81,10 @@ config_include() {
echo "int main () { return 0; }" >> "$OUT"
if ${CC} ${CPPFLAGS} ${CFLAGS} "$OUT" -o /dev/null 2>/dev/null; then
echo "#define $1 1" >> "${CONFIG_H}"
+ eval "$1=Yes"
else
echo "#define $1 0" >> "${CONFIG_H}"
+ eval "$1=No"
fi
rm "$OUT"
}
diff --git a/libc3/configure b/libc3/configure
index 15e35f3..32cc7be 100755
--- a/libc3/configure
+++ b/libc3/configure
@@ -49,6 +49,10 @@ config_include sha_h sys/types.h sha.h HAVE_SHA_H
config_include sha1_h sys/types.h sha1.h HAVE_SHA1_H
update_config_h
+if [ "x${HAVE_SHA_H}" = "xYes" ]; then
+ LIBS="${LIBS} -lmd"
+fi
+
# Address Sanitizer config
CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
LDFLAGS_ASAN="$LDFLAGS"