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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
|
# -*- autoconf -*-
#
# Maybe add library extensions for thread mutex locking.
#
if test "x$with_res_locks" = "xyes"; then
AC_DEFINE(NETSNMP_REENTRANT, 1,
[Define to 1 if you want to build with reentrant/threaded
code (incomplete).])
case $target_os in
aix*)
CC_RUNTIME_ARG="$CC_RUNTIME_ARG -lpthreads"
;;
*)
;;
esac
fi
#
# Add platform-specific source files.
#
AC_MSG_CHECKING([for platform-specific source])
other_src_list=""
other_ftobjs_list=""
other_lobjs_list=""
other_objs_list=""
other_agentobjs=""
other_lagentobjs=""
other_ftagentobjs=""
other_trapd_objects=""
# Win32 service code
if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
other_src_list="$other_src_list winservice.c winservicerc.rc"
other_objs_list="$other_objs_list winservice.o winservicerc.o"
other_lobjs_list="$other_lobjs_list winservice.lo winservicerc.lo"
other_ftobjs_list="$other_ftobjs_list winservice.ft winservicerc.ft"
other_agentobjs="../snmplib/winservicerc.o"
other_lagentobjs="../snmplib/winservicerc.lo"
other_ftagentobjs="../snmplib/winservicerc.lo"
other_trapd_objects="../snmplib/winservicerc.o"
fi
# Win32 pipes
if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
other_src_list="$other_src_list winpipe.c"
other_objs_list="$other_objs_list winpipe.o"
other_lobjs_list="$other_lobjs_list winpipe.lo"
other_ftobjs_list="$other_ftobjs_list winpipe.ft"
fi
# Linux systemd
if test "x$with_systemd" = "xyes"; then
other_src_list="$other_src_list sd-daemon.c"
other_objs_list="$other_objs_list sd-daemon.o"
other_lobjs_list="$other_lobjs_list sd-daemon.lo"
other_ftobjs_list="$other_ftobjs_list sd-daemon.ft"
fi
AC_SUBST(other_src_list)
AC_SUBST(other_objs_list)
AC_SUBST(other_lobjs_list)
AC_SUBST(other_ftobjs_list)
AC_SUBST(other_agentobjs)
AC_SUBST(other_lagentobjs)
AC_SUBST(other_ftagentobjs)
AC_SUBST(other_trapd_objects)
AC_MSG_RESULT([$other_src_list $other_objs_list $other_lobjs_list])
AC_MSG_RESULT([$other_agentobjs $other_lagentobjs $other_trapd_objects])
#
# Create directory structure for build
#
if test ! -d include; then
mkdir include
fi
if test ! -d include/net-snmp; then
mkdir include/net-snmp
fi
if test ! -d include/net-snmp/agent; then
mkdir include/net-snmp/agent
fi
if test ! -d include/net-snmp/library; then
mkdir include/net-snmp/library
fi
if test ! -d include/ucd-snmp; then
mkdir include/ucd-snmp
fi
if test ! -d snmplib; then
mkdir snmplib
fi
if test ! -d snmplib/transports ; then
mkdir snmplib/transports
fi
#
# Do transport module processing.
#
AC_MSG_CHECKING([for and configuring transport modules to use])
# include the actual code checking
m4_include(configure.d/config_modules_transports)
AC_SUBST(transport_hdr_list)
AC_SUBST(transport_src_list)
AC_SUBST(transport_obj_list)
AC_SUBST(transport_lobj_list)
AC_SUBST(transport_ftobj_list)
for i in $transport_def_list; do
AC_DEFINE_UNQUOTED($i)
done
AC_MSG_RESULT($transport_result_list.)
AC_MSG_CACHE_ADD(Network transport support: $transport_result_list)
# cleanup
rm -f module_tmp_header.h
#
# Security modules to use
#
AC_MSG_CHECKING([for security modules to use])
m4_include(configure.d/config_modules_security_modules)
AC_SUBST(security_src_list)
AC_SUBST(security_hdr_list)
AC_SUBST(security_obj_list)
AC_SUBST(security_lobj_list)
AC_SUBST(security_ftobj_list)
AC_MSG_RESULT($new_with_security)
AC_MSG_CACHE_ADD(SNMPv3 Security Modules: $new_with_security)
#
# Handle the special case of KSM to see which crypto API we support
#
rebuilt_new_with_security=
already_checked_krb5=no
netsnmp_save_LIBS=$LIBS
CRYPTO_LIBS=""
for sec in $new_with_security
do
if test "x$sec" = "xksm"; then
if test "xyes" = "x$already_checked_krb5"; then
continue
else
already_checked_krb5=yes
fi
fi
if test x$sec != xksm; then
rebuilt_new_with_security="$rebuilt_new_with_security $sec"
else
if test no = $trykrb5; then
AC_MSG_NOTICE([configured not to use krb5. disabling ksm])
continue
fi
AC_PATH_PROG([krb5_config],krb5-config,[no],$krb5path/bin:$PATH)
if test no != $krb5_config; then
[
CPPFLAGS="$CPPFLAGS `$krb5_config --cflags`"
CRYPTO_LIBS="$CRYPTO_LIBS `$krb5_config --libs |
$SED 's/-flto=[^[:blank:]]*//g'`"
]
elif test $krb5path != no; then
AC_ADD_SEARCH_PATH($krb5path)
else
AC_ADD_SEARCH_PATH(/usr/kerberos)
fi
NETSNMP_SEARCH_LIBS([krb5_init_context], [krb5],
[ac_cv_have_krb5=yes], [ac_cv_have_krb5=no], [],
[CRYPTO_LIBS])
NETSNMP_SEARCH_LIBS([error_message], [com_err], [], [], [],
[CRYPTO_LIBS])
AC_MSG_CHECKING([for krb5])
if test $ac_cv_have_krb5 = no; then
if test "x$askedkrb5" = "xyes"; then
AC_MSG_ERROR(Asked to use krb5 but I couldn't find it.)
fi
AC_MSG_RESULT(no. disabling ksm)
continue
fi
AC_MSG_RESULT(yes)
rebuilt_new_with_security="$rebuilt_new_with_security ksm"
AC_MSG_CHECKING([[for heimdal]])
AC_CACHE_VAL(ac_cv_heimdal,
[AC_TRY_COMPILE(
[#include <krb5.h>],
[const char *v = heimdal_version;],
ac_cv_heimdal=yes,
ac_cv_heimdal=no
)])
AC_MSG_RESULT($ac_cv_heimdal)
if test $ac_cv_heimdal = yes; then
AC_DEFINE(NETSNMP_USE_KERBEROS_HEIMDAL, 1,
[Define this if you're using Heimdal Kerberos])
if test no = $krb5_config; then
CRYPTO_LIBS="$CRYPTO_LIBS -lkrb5 -lasn1 -lcom_err -lroken"
fi
elif test no = $krb5_config; then
CRYPTO_LIBS="$CRYPTO_LIBS -lkrb5 -lcom_err"
fi
AC_CACHE_VAL(ac_cv_NETSNMP_USE_KERBEROS_MIT,
NETSNMP_SEARCH_LIBS([krb5_init_context], [k5crypto],
[ac_cv_NETSNMP_USE_KERBEROS_MIT=yes],
[ac_cv_NETSNMP_USE_KERBEROS_MIT=no], [],
[CRYPTO_LIBS])
)
NETSNMP_SEARCH_LIBS([krb5_c_keyed_checksum_types], [k5crypto], [], [], [],
[CRYPTO_LIBS])
AC_CHECK_MEMBERS([krb5_keyblock.enctype], [],
[ac_cv_NETSNMP_USE_KERBEROS_MIT=no],
[[#include <krb5.h>]])
AC_MSG_CHECKING([to see which crypto API we need to use])
if test yes = $ac_cv_NETSNMP_USE_KERBEROS_MIT; then
AC_MSG_RESULT(new MIT crypto API)
AC_DEFINE(NETSNMP_USE_KERBEROS_MIT, 1,
[Define this if we're using the new MIT crypto API])
else
AC_MSG_RESULT(old MIT crypto API)
fi
LIBS="$CRYPTO_LIBS $netsnmp_save_LIBS"
AC_CHECK_FUNCS([krb5_auth_con_getsendsubkey krb5_auth_con_getrecvsubkey])
fi
done
LNETSNMPLIBS="$LNETSNMPLIBS $CRYPTO_LIBS"
LIBS=$netsnmp_save_LIBS
new_with_security=$rebuilt_new_with_security
#
# Detect lm_sensors version
#
if test "x$ac_cv_header_sensors_sensors_h" = "xyes"; then
AC_CHECK_DECLS([sensors_get_all_subfeatures],
[AC_DEFINE(NETSNMP_USE_SENSORS_V3, 1,
[Define this if you have lm_sensors v3 or later])],,
[[#include <sensors/sensors.h>]])
fi
|