aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2021-07-22 13:24:38 +0300
committerCem Keylan <cem@ckyln.com>2021-07-22 13:24:38 +0300
commit71fec5341daf21a10c9daeb5244f767187380b4a (patch)
tree13ced04db84c0fb307af62ef8f93c3fb2718bf4c /configure
parentf0df54362d0a06a54e40e68a5c3a747a84cef8be (diff)
downloadotools-71fec5341daf21a10c9daeb5244f767187380b4a.tar.gz
add option to disable netcat
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure31
1 files changed, 18 insertions, 13 deletions
diff --git a/configure b/configure
index 36895a2..edb7585 100755
--- a/configure
+++ b/configure
@@ -1,8 +1,5 @@
#!/bin/sh -e
-trap 'rm -f config.mk' EXIT
-trap 'rm -f config.mk; exit 1' INT
-
die() {
printf '%s: %s\n' "${0##*/}" "$*" >&2
exit 1
@@ -16,6 +13,7 @@ usage() {
" --prefix=dir Set prefix directory" \
" --bindir=dir Set directory where executables will be installed" \
" --manprefix=dir Set directory where manual pages will be installed" \
+ " --disable-netcat Don't build netcat" \
" --with-fts=option One of glibc, musl-fts, none, auto (default: auto)" \
" --with-system-zlib Use system zlib"
exit 1
@@ -29,6 +27,7 @@ prefix=/usr/local
manprefix='${PREFIX}/share/man'
}
fts=auto
+netcat=1
host=
for arg; do
@@ -39,22 +38,22 @@ for arg; do
--manprefix=*) manprefix=${arg#*=} ;;
--with-fts=*) fts=${arg#*=} ;;
--with-system-zlib) zlib=1 ;;
+ --disable-netcat) netcat=0 ;;
-*) die "Unknown flag: '$arg'" ;;
*=*) export "$arg";;
*) die "Unknown option: '$arg'"
esac
done
+trap 'rm -f config.mk' EXIT
+trap 'rm -f config.mk; exit 1' INT
+
: ${CC:=cc}
printf 'checking system type... '
[ "$host" ] || host=$($CC -dumpmachine 2>/dev/null) || die "Could not determine host"
out "$host"
-printf 'checking for libtls... '
-tlslib=$(pkgconf --static --libs libtls) || die "No tls library found"
-out "$tlslib"
-
case $host in
*linux*) ;;
*) die "Unsupported system: $host"
@@ -65,15 +64,21 @@ PREFIX = $prefix
BINDIR = $bindir
MANPREFIX = $manprefix
-AR ?= ${AR:-ar}
-CC ?= ${CC:-cc}
-RANLIB ?= ${RANLIB:-ranlib}
-RM ?= rm -f
-YACC ?= ${YACC:-yacc}
+AR = ${AR:-ar}
+CC = ${CC:-cc}
+RANLIB = ${RANLIB:-ranlib}
+RM = rm -f
+YACC = ${YACC:-yacc}
-TLSLIB = $tlslib
EOF
+[ "$netcat" = 1 ] && {
+ printf 'checking for libtls... '
+ tlslib=$(pkgconf --static --libs libtls) || die "No tls library found"
+ out "$tlslib"
+ out "TLSLIB = $tlslib" "BIN += nc" >>config.mk
+}
+
printf 'checking for zlib... '
if [ "$zlib" = 1 ]; then
zlib=$(pkgconf --static --libs zlib)