]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
build: Split libmd dependency due to MD5 functions from SHA requirements
authorGuillem Jover <guillem@hadrons.org>
Sun, 28 Nov 2021 21:40:58 +0000 (22:40 +0100)
committerGuillem Jover <guillem@hadrons.org>
Sun, 28 Nov 2021 21:40:58 +0000 (22:40 +0100)
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.

configure.ac
src/Makefile.am
src/libbsd-overlay.pc.in
src/libbsd.pc.in

index 806b7d38f69c84e6397dd36ffba2450d1f55b073..f40b1afd9318507a6b2c28049b7c136163865124 100644 (file)
@@ -110,7 +110,7 @@ AC_SEARCH_LIBS([dlsym], [dl], [
 ])
 AC_SEARCH_LIBS([MD5Update], [md], [
   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])
@@ -250,6 +250,7 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
                 pstat_getproc sysconf])
 AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"])
 
+AC_SUBST([MD5_LIBS])
 AC_SUBST([LIBBSD_LIBS])
 
 AC_CONFIG_FILES([
index fe9d1e65c952e79bd3d3b404a120344da8344ef6..d3f0162a69eaabff3175d751b38e6521f9ecdc50 100644 (file)
@@ -52,6 +52,7 @@ libbsd_la_DEPENDENCIES = \
        $(libbsd_la_included_sources) \
        libbsd.map
 libbsd_la_LIBADD = \
+       $(MD5_LIBS) \
        $(LIBBSD_LIBS) \
        $(nil)
 libbsd_la_LDFLAGS = \
index 01b7ea53767bf0afac17dac9bb846fa072140029..0455f224fade320cfb39112a60bdc6e910fe3cc8 100644 (file)
@@ -8,5 +8,5 @@ Description: Utility functions from BSD systems (overlay)
 Version: @VERSION@
 URL: https://libbsd.freedesktop.org/
 Libs: -L${libdir} -lbsd
-Libs.private: @LIBBSD_LIBS@
+Libs.private: @LIBBSD_LIBS@ @MD5_LIBS@
 Cflags: -isystem ${includedir}/bsd -DLIBBSD_OVERLAY
index 2c0ac172e32e44ad5570eaf78f422af217d82392..4bca71548239b73eb796973743819d6fe3039fbc 100644 (file)
@@ -8,5 +8,5 @@ Description: Utility functions from BSD systems
 Version: @VERSION@
 URL: https://libbsd.freedesktop.org/
 Libs: -L${libdir} -lbsd
-Libs.private: @LIBBSD_LIBS@
+Libs.private: @LIBBSD_LIBS@ @MD5_LIBS@
 Cflags: -I${includedir}