2020-02-07 04:49:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
|
2020-05-23 18:12:07 +00:00
|
|
|
exec >config.mk
|
2020-02-11 08:09:51 +00:00
|
|
|
|
2020-02-07 04:49:27 +00:00
|
|
|
libs='libcrypto libtls ncursesw'
|
|
|
|
pkg-config --print-errors $libs
|
|
|
|
|
2020-05-23 18:12:07 +00:00
|
|
|
cat <<EOF
|
2020-02-07 04:49:27 +00:00
|
|
|
CFLAGS += $(pkg-config --cflags $libs)
|
2020-05-23 18:12:07 +00:00
|
|
|
CFLAGS += -D'OPENSSL_BIN="$(pkg-config --variable=exec_prefix openssl)/bin/openssl"'
|
2020-02-07 04:49:27 +00:00
|
|
|
LDFLAGS += $(pkg-config --libs-only-L $libs)
|
|
|
|
LDLIBS = $(pkg-config --libs-only-l $libs)
|
|
|
|
EOF
|
2020-02-12 00:03:39 +00:00
|
|
|
|
2020-05-23 18:12:07 +00:00
|
|
|
if [ "$(uname)" = 'Linux' ]; then
|
|
|
|
cat <<-EOF
|
|
|
|
CFLAGS += -D_GNU_SOURCE
|
|
|
|
EOF
|
|
|
|
fi
|