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-06-11 20:06:01 +00:00
|
|
|
if [ $# -gt 0 ]; then
|
|
|
|
echo 'warning: this script does not process arguments' >&2
|
|
|
|
fi
|
|
|
|
|
2020-02-07 04:49:27 +00:00
|
|
|
libs='libcrypto libtls ncursesw'
|
2020-06-11 20:06:01 +00:00
|
|
|
|
2020-02-07 04:49:27 +00:00
|
|
|
pkg-config --print-errors $libs
|
2020-06-11 20:06:01 +00:00
|
|
|
exec_prefix=$(pkg-config --variable=exec_prefix openssl)
|
2020-02-07 04:49:27 +00:00
|
|
|
|
2020-05-23 18:12:07 +00:00
|
|
|
cat <<EOF
|
2020-02-07 04:49:27 +00:00
|
|
|
CFLAGS += $(pkg-config --cflags $libs)
|
2020-06-11 20:06:01 +00:00
|
|
|
CFLAGS += -D'OPENSSL_BIN="${exec_prefix}/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
|