summaryrefslogtreecommitdiff
path: root/dist/nsb-config
diff options
context:
space:
mode:
Diffstat (limited to 'dist/nsb-config')
-rwxr-xr-xdist/nsb-config82
1 files changed, 82 insertions, 0 deletions
diff --git a/dist/nsb-config b/dist/nsb-config
new file mode 100755
index 0000000..0944fe6
--- /dev/null
+++ b/dist/nsb-config
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# $Id$
+# Author: Robert Story <rstory@freesnmp.com>
+#
+########################################################################
+########################################################################
+
+usage()
+{
+ echo "Usage: $0 [-d|-x] [-s SRCD]"
+ echo ""
+ echo " -s SRCDIR : soure directory [$HOME/src/net-snmp-VERSION]"
+ echo ""
+ echo " -x : configure extra features for pre-release testing"
+ echo " -d : configure for binary distribution"
+ exit 1
+}
+
+#set -x
+
+
+#
+# find nsb-platform based on the path to this script
+#
+EXE_PATH=`dirname $0`
+if [ -f $EXE_PATH/nsb-functions ];then
+ . $EXE_PATH/nsb-functions
+elif [ -f $HOME/bin/nsb-functions ]; then
+ . $HOME/bin/nsb-functions
+elif [ -f nsb-functions ];then
+ . nsb-functions
+else
+ echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD"
+ exit 1
+fi
+
+
+########################################################################
+########################################################################
+NSB_CONFIG_ALL=2
+
+# x) x=$OPTARG ;;
+while getopts ds:x opt
+do
+ case "$opt" in
+ d) NSB_CONFIG_ALL=0;;
+ s) SRCD=$OPTARG ;;
+ x) NSB_CONFIG_ALL=1;;
+ \?)# unknown flag
+ usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $NSB_CONFIG_ALL -eq 2 ]; then
+ echo "You must specify -d or -x"
+ usage
+fi
+
+if [ "x$SRCD" = "x" ]; then
+ for x in . $HOME/src/net-snmp
+ do
+ if [ -f $x/configure ]; then
+ SRCD=$x
+ break
+ fi
+ done
+ if [ "x$SRCD" = "x" ]; then
+ echo "Couldn't find a source directory. Please specify one for me."
+ usage
+ fi
+fi
+
+
+########################################################################
+########################################################################
+if [ $NSB_CONFIG_ALL -eq 0 ];then
+ nsb_config_dist $SRCD
+else
+ nsb_config_all $SRCD
+fi