build: Split libmd dependency due to MD5 functions from SHA requirements

To be able to rework the md5 deprecation logic, we need to detangle when
we depend on libmd due to requiring MD5 functions, which might be
otherwise provided by libc, or when we require SHA functions for the
internal getentropy() implementation.
This commit is contained in:
Guillem Jover 2021-11-28 22:40:58 +01:00
parent 500b3080a2
commit 25d35625eb
4 changed files with 5 additions and 3 deletions

View File

@ -110,7 +110,7 @@ AC_SEARCH_LIBS([dlsym], [dl], [
]) ])
AC_SEARCH_LIBS([MD5Update], [md], [ AC_SEARCH_LIBS([MD5Update], [md], [
AS_IF([test "x$ac_cv_search_MD5Update" != "xnone required"], [ AS_IF([test "x$ac_cv_search_MD5Update" != "xnone required"], [
LIBBSD_LIBS="$LIBBSD_LIBS $ac_cv_search_MD5Update" MD5_LIBS="$MD5_LIBS $ac_cv_search_MD5Update"
]) ])
], [ ], [
AC_MSG_ERROR([cannot find required MD5 functions in libc or libmd]) AC_MSG_ERROR([cannot find required MD5 functions in libc or libmd])
@ -250,6 +250,7 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
pstat_getproc sysconf]) pstat_getproc sysconf])
AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"]) AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"])
AC_SUBST([MD5_LIBS])
AC_SUBST([LIBBSD_LIBS]) AC_SUBST([LIBBSD_LIBS])
AC_CONFIG_FILES([ AC_CONFIG_FILES([

View File

@ -52,6 +52,7 @@ libbsd_la_DEPENDENCIES = \
$(libbsd_la_included_sources) \ $(libbsd_la_included_sources) \
libbsd.map libbsd.map
libbsd_la_LIBADD = \ libbsd_la_LIBADD = \
$(MD5_LIBS) \
$(LIBBSD_LIBS) \ $(LIBBSD_LIBS) \
$(nil) $(nil)
libbsd_la_LDFLAGS = \ libbsd_la_LDFLAGS = \

View File

@ -8,5 +8,5 @@ Description: Utility functions from BSD systems (overlay)
Version: @VERSION@ Version: @VERSION@
URL: https://libbsd.freedesktop.org/ URL: https://libbsd.freedesktop.org/
Libs: -L${libdir} -lbsd Libs: -L${libdir} -lbsd
Libs.private: @LIBBSD_LIBS@ Libs.private: @LIBBSD_LIBS@ @MD5_LIBS@
Cflags: -isystem ${includedir}/bsd -DLIBBSD_OVERLAY Cflags: -isystem ${includedir}/bsd -DLIBBSD_OVERLAY

View File

@ -8,5 +8,5 @@ Description: Utility functions from BSD systems
Version: @VERSION@ Version: @VERSION@
URL: https://libbsd.freedesktop.org/ URL: https://libbsd.freedesktop.org/
Libs: -L${libdir} -lbsd Libs: -L${libdir} -lbsd
Libs.private: @LIBBSD_LIBS@ Libs.private: @LIBBSD_LIBS@ @MD5_LIBS@
Cflags: -I${includedir} Cflags: -I${includedir}