| # -*- sh -*- |
| security_def_list="usm" |
| security_src_list="" |
| security_obj_list="" |
| security_lobj_list="" |
| if test "x$security_init_file" = "x" ; then |
| security_init_file="snmplib/snmpsm_init.h" |
| fi |
| if test "x$security_incl_file" = "x" ; then |
| security_incl_file="include/net-snmp/library/snmpv3-security-includes.h" |
| fi |
| new_with_security=`echo $with_security_modules | $SED 's/,/ /g;'` |
| new_with_out_security=`echo $with_out_security_modules | $SED 's/,/ /g;'` |
| |
| echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_init_file |
| echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_incl_file |
| |
| for i in $security_def_list; do |
| if echo " $new_with_out_security " | $GREP " $i " > /dev/null; then |
| if test "x$i" = "xusm"; then |
| echo |
| AC_MSG_ERROR(The USM security module is mandatory) |
| fi |
| else |
| new_with_security="$new_with_security $i" |
| fi |
| done |
| |
| for i in $new_with_security; do |
| cfile="snmp"$i".c" |
| hfile="snmp"$i".h" |
| |
| # make sure support exists for it |
| if test -f $srcdir"/snmplib/"$cfile -a -f $srcdir"/include/net-snmp/library/"$hfile; then |
| : |
| else |
| echo |
| AC_MSG_ERROR(No such security module: $i / $cfile / $hfile) |
| fi |
| |
| # define a bunch of stuff to enable it |
| security_src_list="$security_src_list $cfile" |
| security_hdr_list="$security_hdr_list $hfile" |
| security_obj_list="$security_obj_list snmp"$i".o" |
| security_lobj_list="$security_lobj_list snmp"$i".lo" |
| def_name="NETSNMP_SECMOD_"`echo $i | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` |
| echo "init_"$i"();" >> $security_init_file |
| echo "#include <net-snmp/library/$hfile>" >> $security_incl_file |
| AC_DEFINE_UNQUOTED($def_name) |
| done |
| |