From c876c88c2ac74255fa402c441343e8314d1fff8f Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 1 Mar 2020 19:20:23 -0500 Subject: Replace .mk files with configure script Copied and expanded from catgirl. --- configure | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 configure (limited to 'configure') diff --git a/configure b/configure new file mode 100755 index 0000000..7d1e424 --- /dev/null +++ b/configure @@ -0,0 +1,43 @@ +#!/bin/sh +set -eu + +case "$(uname)" in + (FreeBSD) + if ! pkg info -e libressl; then + echo 'LibreSSL required' + exit 1 + fi + prefix=$(pkg query '%p' libressl) + cat >config.mk <<-EOF + MANDIR = \${PREFIX}/man + CFLAGS += -I${prefix}/include + CFLAGS += -D'OPENSSL_BIN="${prefix}/bin/openssl"' + LDFLAGS += -L${prefix}/lib + EOF + exit + ;; +esac + +libs='libcrypto libtls' +pkg-config --print-errors $libs + +cat >config.mk <>config.mk + ;; + (Linux) + cat >>config.mk <<-EOF + CFLAGS += -D_GNU_SOURCE -D'CERTBOT_PATH="/etc/letsencrypt"' + LDLIBS_calico = $(pkg-config --libs-only-l libcrypto) + RCS = + DIRS = + EOF + ;; +esac -- cgit 1.4.1