commit 5007bd0d88e88e4e812dbb82ec4cf157920f62ea from: Thomas Adam date: Fri Apr 14 16:32:39 2023 UTC portable: linux: add libmd On some systems libmd isn't explicitly implied, so detect this via pkg-config at configure time. Problem reported by @stsp commit - 9aa08a9a8daa60086d5b4b7d6e67b7a47aecb3fd commit + 5007bd0d88e88e4e812dbb82ec4cf157920f62ea blob - f99ef52dcf9bb578676c1c2f6752c7d6f526d9aa blob + 16186bb66e8b079afff510e3170158de94c44013 --- .github/README.md +++ .github/README.md @@ -22,6 +22,7 @@ Linux: * `libncurses` (for tog(1)) * `libbsd` (BSD's arc4random routines) +* `libmd` (SHA256 routines) * `libuuid` (for UUID generation) * `libz` (for Z compression) * `pkg-config` (for searching libraries) blob - f7b80f50ce049f06adf9fe9a027ce67d0d02b0a0 blob + 6951f4231018a992eef36c671b26b1e6157eac63 --- Makefile.am +++ Makefile.am @@ -11,8 +11,8 @@ LDADD += -lmd LIBS += -lmd endif -LIBS += -lm $(zlib_LIBS) $(libbsd_LIBS) -AM_CPPFLAGS += $(libbsd_CFLAGS) +LIBS += -lm $(zlib_LIBS) $(libbsd_LIBS) $(libmd_LIBS) +AM_CPPFLAGS += $(libbsd_CFLAGS) $(libmd_CFLAGS) TEST_TARGETS=compat regress-delta regress-deltify regress-fetch regress-idset \ regress-path regress-cmdline blob - 8c395bfcb915bf21e5432f187b6c7d245ae57048 blob + 62e6ce185fecdeb5d8e15244f002718e872d0823 --- README.portable +++ README.portable @@ -19,6 +19,7 @@ Linux: * `libncurses` (for tog(1)) * `libbsd` (BSD's arc4random routines) +* `libmd` (SHA256 routines) * `libuuid` (for UUID generation) * `libz` (for Z compression) * `pkg-config` (for searching libraries) blob - 86591a8da124685a8adaecf14d50e848f5747988 blob + 2c7e031eb5644e532dffb7d467b723b7fc6cf332 --- configure.ac +++ configure.ac @@ -690,6 +690,20 @@ if test "$PLATFORM" = "linux"; then # and won't be found. CFLAGS="$CFLAGS $LIBBSD_CFLAGS" LIBS="$LIBS $LIBBSD_LIBS" + + PKG_CHECK_MODULES( + LIBMD, + libmd, + [ + libmd_CFLAGS="$LIBMD_CFLAGS" + libmd_LIBS="$LIBMD_LIBS" + AC_SUBST(libmd_CFLAGS) + AC_SUBST(libmd_LIBS) + ], [] + ) + CFLAGS="$CFLAGS $LIBMD_CFLAGS" + LIBS="$LIBS $LIBMD_LIBS" + fi # Look for a suitable queue.h. We hope libbsd is enough, but that is missing blob - cb56b422d772f8bd02bc07e0df192246084d8555 blob + fccb9f202465601c758a6109d249c9eb81ad0f64 --- got/Makefile.am +++ got/Makefile.am @@ -72,11 +72,13 @@ LDADD = -L$(top_builddir)/compat -lopenbsd-compat -lm LDADD += $(libuuid_LIBS) \ $(zlib_LIBS) \ $(libbsd_LIBS) \ - $(libutil_LIBS) + $(libutil_LIBS) \ + $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif AM_CPPFLAGS += $(libuuid_CFLAGS) \ $(zlib_CFLAGS) \ - $(libbsd_CFLAGS) + $(libbsd_CFLAGS) \ + $(libmd_CLFAGS) blob - 19d299b3a98acd1563ba1ac874f211f12a6c1e18 blob + 833fd7c3c16b2e0663d06f6058f588ed3c8a19de --- gotadmin/Makefile.am +++ gotadmin/Makefile.am @@ -45,9 +45,11 @@ EXTRA_DIST = gotadmin.1 man1_MANS = gotadmin.1 LDADD = -L$(top_builddir)/compat -lopenbsd-compat -lm -LDADD += $(libbsd_LIBS) $(zlib_LIBS) $(libuuid_LIBS) $(libutil_LIBS) +LDADD += $(libbsd_LIBS) $(zlib_LIBS) $(libuuid_LIBS) $(libutil_LIBS) \ + $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(libbsd_CFLAGS) $(zlib_CFLAGS) $(libuuid_CFLAGS) +AM_CPPFLAGS += $(libbsd_CFLAGS) $(zlib_CFLAGS) $(libuuid_CFLAGS) \ + $(libmd_CFLAGS) blob - 97159001cc6ca4349365e4806bc117c10461f677 blob + 433fada066e72c2486662501e1a87858bfd961f5 --- gotwebd/Makefile.am +++ gotwebd/Makefile.am @@ -91,13 +91,14 @@ LDADD += $(libbsd_LIBS) \ $(libevent_LIBS) \ $(zlib_LIBS) \ $(libuuid_LIBS) \ - $(libutil_LIBS) + $(libutil_LIBS) \ + $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif AM_CPPFLAGS += $(libbsd_CFLAGS) $(libevent_CFLAGS) $(zlib_CFLAGS) \ - $(libuuid_CFLAGS) + $(libuuid_CFLAGS) $(libmd_CFLAGS) #realinstall: # if [ ! -d ${DESTDIR}${PUB_REPOS_DIR}/. ]; then \ blob - 69db1b62f61595b11b2453541594232eac2441ec blob + 5ff52e5004db054488c67578ed9d846a266a40a3 --- libexec/got-fetch-pack/Makefile.am +++ libexec/got-fetch-pack/Makefile.am @@ -18,9 +18,9 @@ got_fetch_pack_SOURCES = \ got_fetch_pack_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - 08963fe3894f2dbb94cd6b8a0e86fa7998b59b04 blob + 7a2b6c6ba5585559149c77be23d312bb1dedb128 --- libexec/got-index-pack/Makefile.am +++ libexec/got-index-pack/Makefile.am @@ -20,9 +20,9 @@ got_index_pack_SOURCES = got-index-pack.c \ got_index_pack_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(libbsd_LIBS) $(zlib_LIBS) $(libutil_LIBS) +LDADD += $(libbsd_LIBS) $(zlib_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(libbsd_CFLAGS) $(zlib_CFLAGS) +AM_CPPFLAGS += $(libbsd_CFLAGS) $(zlib_CFLAGS) $(libmd_CFLAGS) blob - 5e1763a7c2298cd68284b381fc7f9ffa176a01b9 blob + 0719075b173012279bad2989b10e549f066b739c --- libexec/got-read-blob/Makefile.am +++ libexec/got-read-blob/Makefile.am @@ -14,9 +14,9 @@ got_read_blob_SOURCES = got-read-blob.c \ got_read_blob_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - 7eb4daa52dbbdd30cce5f459dd32400df7fab773 blob + 54cf703e7c588b515a90bf7a78d9933df2eb03c7 --- libexec/got-read-commit/Makefile.am +++ libexec/got-read-commit/Makefile.am @@ -14,9 +14,9 @@ got_read_commit_SOURCES = got-read-commit.c \ got_read_commit_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - af3a1fe174af011007b96f738f43fa79b54be709 blob + 95c191c3a76f49279cc590cdaec7efc20bc744cd --- libexec/got-read-gitconfig/Makefile.am +++ libexec/got-read-gitconfig/Makefile.am @@ -15,9 +15,9 @@ got_read_gitconfig_SOURCES = got-read-gitconfig.c \ got_read_gitconfig_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - 4dfcd454f8b8fe0a82ed43b7200624d9eeb1748e blob + 8cd643310b7452b1c21943f2e6265277f0b0fb68 --- libexec/got-read-gotconfig/Makefile.am +++ libexec/got-read-gotconfig/Makefile.am @@ -17,9 +17,9 @@ got_read_gotconfig_SOURCES = \ got_read_gotconfig_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(libbsd_LIBS) $(zlib_LIBS) $(libutil_LIBS) +LDADD += $(libbsd_LIBS) $(zlib_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(libbsd_CFLAGS) $(zlib_CFLAGS) +AM_CPPFLAGS += $(libbsd_CFLAGS) $(zlib_CFLAGS) $(libmd_CFLAGS) blob - d05d5e2c420f75b9af95993c11631b3682820d71 blob + aa6813389e902a11187156d57670eb69f46971d1 --- libexec/got-read-object/Makefile.am +++ libexec/got-read-object/Makefile.am @@ -14,9 +14,9 @@ got_read_object_SOURCES = got-read-object.c \ got_read_object_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - 98b9000d490b932080c1fcb12680dafeca89d2c9 blob + 6c4ac32fae3afa35e62262d33fcbb7ee8e27e95e --- libexec/got-read-pack/Makefile.am +++ libexec/got-read-pack/Makefile.am @@ -20,9 +20,9 @@ got_read_pack_SOURCES = got-read-pack.c \ got_read_pack_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - cc33b5462261c6fcf82069d88a969fc43fef2545 blob + 335faa9b73af957908face2c517e22b7df4eb5f4 --- libexec/got-read-patch/Makefile.am +++ libexec/got-read-patch/Makefile.am @@ -14,9 +14,9 @@ got_read_patch_SOURCES = got-read-patch.c \ got_read_patch_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - 64c60b679bd8e405282728742e87a069a9645938 blob + e93ef493795b487d0a4801452db5f6655090034c --- libexec/got-read-tag/Makefile.am +++ libexec/got-read-tag/Makefile.am @@ -14,9 +14,9 @@ got_read_tag_SOURCES = got-read-tag.c \ got_read_tag_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - b0dbebd8f90e8b23398f7e49ddad72a38b51fbc9 blob + a09561fac19fe4a5aecabce759d01eb1d8fbd59c --- libexec/got-read-tree/Makefile.am +++ libexec/got-read-tree/Makefile.am @@ -14,9 +14,9 @@ got_read_tree_SOURCES = got-read-tree.c \ got_read_tree_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - d3f32157b24e52e3e5a8b544be4a700484256514 blob + 998034125244091b1df972f974b0e8cd5311a33b --- libexec/got-send-pack/Makefile.am +++ libexec/got-send-pack/Makefile.am @@ -19,9 +19,9 @@ got_send_pack_SOURCES = \ got_send_pack_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a LDADD = -L$(top_builddir)/compat -lopenbsd-compat -LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) +LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) +AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) blob - c37288bd51b1eba89d4abfc4df748012809f86d2 blob + 54f3785407d74ab85fd1c335ccaf38aface4a5fb --- tog/Makefile.am +++ tog/Makefile.am @@ -60,9 +60,11 @@ man1_MANS = tog.1 EXTRA_DIST = tog.1 LDADD = -L$(top_builddir)/compat -lopenbsd-compat -lpthread -lm -LDADD += $(libbsd_LIBS) $(libncurses_LIBS) $(libuuid_LIBS) $(zlib_LIBS) $(libutil_LIBS) +LDADD += $(libbsd_LIBS) $(libncurses_LIBS) $(libuuid_LIBS) $(zlib_LIBS) \ + $(libutil_LIBS) $(libmd_LIBS) if HOST_FREEBSD LDADD += -lmd endif -AM_CPPFLAGS += $(libbsd_CFLAGS) $(libncurses_CFLAGS) $(libuuid_CFLAGS) +AM_CPPFLAGS += $(libbsd_CFLAGS) $(libncurses_CFLAGS) $(libuuid_CFLAGS) \ + $(libmd_CFLAGS)