Commit Diff


commit - b93c86aa2f37e6a464d11e46caecb11dab056176
commit + 835caeb047444efa37db22ed370f88a7ea2e549f
blob - 3b66571a2374813247041b0c445fd305165a84db
blob + e97e25722132465c874f58a2eb73ac925dd3096f
--- configure.ac
+++ configure.ac
@@ -41,6 +41,33 @@ AS_IF([test "x$with_libbsd" = "xyes"], [
 	])
 ])
 
+AC_MSG_CHECKING([platform])
+case "$host_os" in
+	*darwin*)
+		PLATFORM=darwin
+		;;
+	*linux*)
+		PLATFORM=linux
+		;;
+	*freebsd*)
+		PLATFORM=freebsd
+		;;
+	*openbsd*)
+		PLATFORM=openbsd
+		;;
+	*)
+		PLATFORM=unknown
+		;;
+esac
+AC_MSG_RESULT($PLATFORM)
+AC_SUBST(PLATFORM)
+
+if test "x$PLATFORM" = "xdarwin"; then
+	export LDFLAGS="-L/opt/homebrew/opt/libressl/lib $LDFLAGS"
+	export CPPFLAGS="-I/opt/homebrew/opt/libressl/include $CPPFLAGS"
+	export PKG_CONFIG_PATH="/opt/homebrew/opt/libressl/lib/pkgconfig $PKG_CONFIG_PATH"
+fi
+
 AC_REPLACE_FUNCS([
 	asprintf \
 	err \