aboutsummaryrefslogtreecommitdiff
path: root/net/quagga/scripts/configure.quagga
blob: d3a25bd7590823a592e4684f83d010a3cb56ae44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
#
# configure - quagga compile time option configurator
# by Bruce M Simpson <bms@FreeBSD.org>
#
# $FreeBSD: /tmp/pcvs/ports/net/quagga/scripts/Attic/configure.quagga,v 1.3 2003-12-03 03:22:11 bms Exp $

if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then
	exit
fi

tempfile=`mktemp -t checklist`

if [ "${QUAGGA_OPTIONS}" ]; then
	set ${QUAGGA_OPTIONS}
fi

for i; do
	eval status_$i=ON
done

if [ -z "${BATCH}" ]; then
	/usr/bin/dialog --title "Quagga configuration options" --clear \
		--checklist "\n\
Please select desired options:" -1 -1 8	\
LIBPAM		"PAM authentication for vtysh"	"$status_LIBPAM" \
OSPF_NSSA	"NSSA support (RFC1587)"	"$status_OSPF_NSSA" \
OSPF_OPAQUE_LSA	"OSPF Opaque-LSA with OSPFAPI support (RFC2370)"	"$status_OSPF_OPAQUE_LSA" \
RTADV		"IPv6 Router Advertisements"	"$status_RTADV" \
SNMP		"SNMP support"			"$status_SNMP" \
TCPSOCKETS	"Use TCP/IP sockets for protocol daemons"	"$status_TCPSOCKETS" \
2> $tempfile

	retval=$?

	if [ -s $tempfile ]; then
		set `sed 's/"//g' $tempfile`
	fi
	rm -f $tempfile

	case $retval in
		0)      if [ -z "$*" ]; then
				echo "Nothing selected"
			fi
			;;
		1)      echo "Cancel pressed."
			exit 1
			;;
	esac
fi

/bin/mkdir -p ${WRKDIRPREFIX}${CURDIR}
exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc

echo "PREFIX=   ${PREFIX}"

while [ "$1" ]; do
    case $1 in
	LIBPAM)
		echo 'CONFIGURE_ARGS+=	--with-libpam'
		;;
	OSPF_NSSA)
		echo 'CONFIGURE_ARGS+=	--enable-nssa'
		;;
	OSPF_OPAQUE_LSA)
		echo 'CONFIGURE_ARGS+=	--enable-opaque-lsa'
		;;
	RTADV)
		echo 'CONFIGURE_ARGS+=	--enable-rtadv'
		;;
	SNMP)
		echo 'CONFIGURE_ARGS+=	--enable-snmp'
		if [ "x${WITH_SNMP_4}" != "x" ]; then
			echo 'LIB_DEPENDS+=snmp.4:${PORTSDIR}/net/net-snmp4:install'
		else
			echo 'LIB_DEPENDS+=netsnmp.6:${PORTSDIR}/net/net-snmp:install'
		fi
		;;
	TCPSOCKETS)
		echo 'CONFIGURE_ARGS+=	--enable-tcp-zebra'
		;;
	*)
		echo "Unknown option(s): $*" > /dev/stderr
		rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
		exit 1
		;;
    esac
    shift
done