From 71fec5341daf21a10c9daeb5244f767187380b4a Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Thu, 22 Jul 2021 13:24:38 +0300 Subject: add option to disable netcat --- configure | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'configure') 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) -- cgit v1.2.3