1
# Portions of this file are subject to the following copyright. See
2
# the Net-SNMP's COPYING file for more details and other copyrights
5
# Portions Copyright � 2003 Sun Microsystems, Inc. All rights reserved.
6
# Use is subject to license terms specified in the COPYING file
7
# distributed with the Net-SNMP package.
11
# Process this file with autoconf to produce a configure script.
13
AC_INIT([Net-SNMP], [5.4.3], [net-snmp-coders@lists.sourceforge.net])
15
AC_CONFIG_SRCDIR([agent/mibgroup/ucd-snmp/extensible.c])
16
AC_REVISION([$Revision: 18816 $])
18
AC_CONFIG_HEADER(include/net-snmp/net-snmp-config.h)
23
# save the configure arguments
25
AC_DEFINE_UNQUOTED(NETSNMP_CONFIGURE_OPTIONS,"$ac_configure_args")
26
CONFIGURE_OPTIONS="\"$ac_configure_args"\"
27
AC_SUBST(CONFIGURE_OPTIONS)
34
--with-cc=CC use CC to compile (default=gcc).],
35
[CC=$with_cc;export CC])
38
--with-linkcc=CC use CC to link (default=gcc).],
39
[LINKCC=$with_linkcc;export LINKCC])
42
[ --with-ar=AR use AR as the archiver.],
43
[AR=$with_ar; export AR])
45
AC_ARG_WITH(endianness,
46
[ --with-endianness=big|little define endianness of target platform when
48
[if test $with_endianness != "big" -a $with_endianness != "little" ; then
49
AC_MSG_ERROR([Endianness must be big or little, not "$with_endianness".]);
54
[ --with-cflags=CFLAGS use CFLAGS as compile time arguments.],
55
[CFLAGS=$with_cflags; export CFLAGS])
58
[ --with-ldflags=LDFLAGS use LDFLAGS as link time arguments to ld.],
59
[LDFLAGS=$with_ldflags; export LDFLAGS])
61
AC_ARG_ENABLE(as-needed,
62
[ --enable-as-needed Link libperl against Net-SNMP libraries
63
rather than applications. We recommend to
64
use this option if it works.])
67
[ --with-libs=LIBS use LIBS as link time arguments to ld.],
68
[LIBS=$with_libs; export LIBS])
70
AC_ARG_ENABLE(silent-libtool,
71
[ --enable-silent-libtool Pass --silent to libtool.],
72
LIBTOOLFLAGS=--silent)
73
AC_SUBST(LIBTOOLFLAGS)
75
AC_ARG_WITH(install-prefix,
76
[ --with-install-prefix=PATH Just for installing, prefix all
77
directories with PATH. This is known not
78
to work on some systems with shared
79
libraries (eg, HPUX)],
80
INSTALL_PREFIX="$withval")
82
if test "x$INSTALL_PREFIX" = "xyes" ; then
83
AC_MSG_ERROR([--with-install-prefix requires an argument])
85
if test "x$INSTALL_PREFIX" = "xno" ; then
88
AC_SUBST(INSTALL_PREFIX)
90
# check for errors in args that run after module processing here, so
91
# they fail before module processing...
92
AC_ARG_ENABLE(libwrap,,
93
AC_MSG_ERROR([ Invalid option. Use --with-libwrap/--without-libwrap instead ]) )
95
AC_MSG_ERROR([ Invalid option. Use --with-zlib/--without-zlib instead ]) )
97
AC_ARG_ENABLE(mini_agent,
98
[ --enable-mini-agent Build a minimal agent.])
99
if test "x$enable_mini_agent" = "xyes"; then
104
AC_ARG_WITH(mini_agent,,
105
AC_MSG_ERROR([ Invalid option. Use --enable-mini-agent/--disable-mini-agent instead ]) )
106
AC_ARG_WITH(miniagent,,
107
AC_MSG_ERROR([ Invalid option. Use --enable-mini-agent/--disable-mini-agent instead ]) )
108
AC_ARG_ENABLE(miniagent,,
109
AC_MSG_ERROR([ Invalid option. Use --enable-mini-agent/--disable-mini-agent instead ]) )
112
[ --disable-agent Do not build the agent (snmpd).])
113
if test "x$enable_agent" != "xno"; then
114
SNMPD='snmpd$(EXEEXT)'
115
MAINSUBS="$MAINSUBS agent"
116
TRAPLIBS='$(TRAPDWITHAGENT)'
117
USETRAPLIBS='$(USEAGENTLIBS)'
120
# we still need/want the agentlibs (for subagents, e.g. snmptrapd)
121
MAINSUBS="$MAINSUBS agent"
122
# building snmptrapd w/o agentlibs doesn't work atm
123
#TRAPLIBS='$(TRAPDWITHOUTAGENT)'
124
#USETRAPLIBS='$(USELIBS)'
125
TRAPLIBS='$(TRAPDWITHAGENT)'
126
USETRAPLIBS='$(USEAGENTLIBS)'
130
AC_SUBST(USETRAPLIBS)
132
AC_MSG_ERROR([ Invalid option. Use --enable-agent/--disable-agent instead ]) )
134
AC_ARG_ENABLE(applications,
135
[ --disable-applications Do not build the apps (snmpget, ...).])
136
if test "x$enable_applications" != "xno"; then
137
MAINSUBS="$MAINSUBS apps"
140
AC_ARG_WITH(applications,,
141
AC_MSG_ERROR([ Invalid option. Use --enable-applications/--disable-applications instead ]) )
143
AC_ARG_ENABLE(manuals,
144
[ --disable-manuals Do not install the manuals.])
145
if test "x$enable_manuals" != "xno"; then
146
MAINSUBS="$MAINSUBS man"
148
AC_ARG_WITH(manuals,,
149
AC_MSG_ERROR([ Invalid option. Use --enable-manuals/--disable-manuals instead ]) )
151
AC_ARG_ENABLE(scripts,
152
[ --disable-scripts Do not install the scripts (mib2c, ...).])
153
if test "x$enable_scripts" != "xno"; then
154
MAINSUBS="$MAINSUBS local"
156
AC_ARG_WITH(scripts,,
157
AC_MSG_ERROR([ Invalid option. Use --enable-scripts/--disable-scripts instead ]) )
160
[ --disable-mibs Do not install the mib files.])
161
if test "x$enable_mibs" != "xno"; then
162
MAINSUBS="$MAINSUBS mibs"
164
# with-mibs is valid too, but means something else
167
AC_MSG_CHECKING([what to build and install])
168
AC_MSG_RESULT([$MAINSUBS])
170
AC_ARG_ENABLE(mib-loading,
171
[ --disable-mib-loading Do not include code that parses and
172
manipulates the mib files.])
173
if test "x$enable_mib_loading" = "xno"; then
174
AC_DEFINE([NETSNMP_DISABLE_MIB_LOADING], 1,
175
[Define if mib loading and parsing code should not be included])
177
AC_ARG_WITH(mib-loading,,
178
AC_MSG_ERROR([ Invalid option. Use --enable-mib-loading/--disable-mib-loading instead ]) )
182
AC_ARG_ENABLE(snmpv1,
183
[ --disable-snmpv1 Do not include code that implements SNMPv1.])
184
if test "x$enable_snmpv1" = "xno"; then
185
AC_DEFINE([NETSNMP_DISABLE_SNMPV1], 1,
186
[Define if SNMPv1 code should not be included])
188
SNMP_VERSIONS="$SNMP_VERSIONS 1"
191
AC_MSG_ERROR([ Invalid option. Use --enable-snmpv1/--disable-snmpv1 instead ]) )
193
AC_ARG_ENABLE(snmpv2c,
194
[ --disable-snmpv2c Do not include code that implements SNMPv2c.])
195
if test "x$enable_snmpv2c" = "xno"; then
196
AC_DEFINE([NETSNMP_DISABLE_SNMPV2C], 1,
197
[Define if SNMPv2c code should not be included])
199
SNMP_VERSIONS="$SNMP_VERSIONS 2c"
201
AC_ARG_WITH(snmpv2c,,
202
AC_MSG_ERROR([ Invalid option. Use --enable-snmpv2c/--disable-snmpv2c instead ]) )
204
SNMP_VERSIONS="$SNMP_VERSIONS 3"
205
AC_MSG_CACHE_ADD(SNMP Versions Supported: $SNMP_VERSIONS)
207
AC_ARG_ENABLE(set-support,
208
[ --disable-set-support Do not allow SNMP set requests.])
209
if test "x$enable_set_support" = "xno"; then
210
AC_DEFINE([NETSNMP_DISABLE_SET_SUPPORT], 1,
211
[Define if SNMP SET support should be disabled])
213
AC_ARG_WITH(set-support,,
214
AC_MSG_ERROR([ Invalid option. Use --enable-set-support/--disable-set-support instead ]) )
217
[ --disable-des Do not support DES encryption.])
218
if test "x$enable_des" = "xno"; then
219
AC_DEFINE([NETSNMP_DISABLE_DES], 1,
220
[Define if DES encryption should not be supported])
223
AC_MSG_ERROR([ Invalid option. Use --enable-des/--disable-des instead ]) )
225
AC_ARG_ENABLE(privacy,
226
[ --disable-privacy Don't compile in support for privacy (encryption).])
227
if test "x$enable_privacy" != "xno"; then
228
AC_DEFINE(NETSNMP_ENABLE_SCAPI_AUTHPRIV)
230
AC_ARG_WITH(privacy,,
231
AC_MSG_ERROR([ Invalid option. Use --enable-privacy/--disable-privacy instead ]) )
234
[ --disable-md5 Do not support MD5 authentication.])
235
if test "x$enable_md5" = "xno"; then
236
AC_DEFINE([NETSNMP_DISABLE_MD5], 1,
237
[Define if MD5 authentication should not be supported])
240
AC_MSG_ERROR([ Invalid option. Use --enable-md5/--disable-md5 instead ]) )
242
AC_ARG_ENABLE(internal-md5,
243
[ --enable-internal-md5 Use the internal MD5 support.])
244
if test "x$enable_internal_md5" = "xyes"; then
245
if test "x$enable_md5" = "xno"; then
246
AC_MSG_ERROR(You can not specify both --enable-internal-md5 and --disable-md5)
248
AC_DEFINE(NETSNMP_USE_INTERNAL_MD5)
251
AC_ARG_WITH(internal-md5,,
252
AC_MSG_ERROR([ Invalid option. Use --enable-internal-md5/--disable-internal-md5 instead ]) )
255
[ --enable-ipv6 Generate IPv6 ready version.],
256
[if test "x$enable_ipv6" = "xyes"; then
257
AC_DEFINE(NETSNMP_ENABLE_IPV6)
260
AC_MSG_ERROR([ Invalid option. Use --enable-ipv6/--disable-ipv6 instead ]) )
262
AC_ARG_ENABLE(local-smux,
263
[ --enable-local-smux Restrict SMUX connections to localhost (by default).],
264
[if test "x$enable_local_smux" = "xyes"; then
265
AC_DEFINE(NETSNMP_ENABLE_LOCAL_SMUX)
267
AC_ARG_WITH(local-smux,,
268
AC_MSG_ERROR([ Invalid option. Use --enable-local-smux/--disable-local-smux instead ]) )
270
AC_ARG_ENABLE(debugging,
271
[ --enable-debugging Outputs extra debugging information at all
272
times. Normally, you should not enable this,
273
but instead use the -D flag of the commands,
274
which toggles debuging output at runtime.
275
--disable-debugging Disallows debugging code to be built in.
276
This might provide some speed benefits.],
277
AC_DEFINE(NETSNMP_ALWAYS_DEBUG))
278
AC_ARG_WITH(debugging,,
279
AC_MSG_ERROR([ Invalid option. Use --enable-debugging/--disable-debugging instead ]) )
281
AC_ARG_ENABLE(developer,
282
[ --enable-developer Turns on super-duper-extra-compile-warnings
285
AC_ARG_WITH(developer,,
286
AC_MSG_ERROR([ Invalid option. Use --enable-developer/--disable-developer instead ]) )
288
if test "x$enable_debugging" = "xno"; then
289
AC_DEFINE(NETSNMP_NO_DEBUGGING)
293
[ --with-dmalloc=PATH Use dmalloc library (www.dmalloc.com)],
294
if test "x$withval" = "xyes"; then
295
LIBS="$LIBS -ldmalloc"
296
AC_DEFINE(HAVE_DMALLOC_H)
297
elif test -d "$withval"; then
298
AC_ADD_SEARCH_PATH($withval)
299
LIBS="$LIBS -ldmalloc"
300
AC_DEFINE(HAVE_DMALLOC_H)
303
AC_SUBST(HAVE_DMALLOC_H)
304
AC_ARG_ENABLE(dmalloc,,
305
AC_MSG_ERROR([ Invalid option. Use --with-dmalloc/--without-dmalloc instead ]) )
308
[ --with-efence Look for and use libefence (malloc).],
309
use_efence="$withval")
310
AC_ARG_ENABLE(efence,,
311
AC_MSG_ERROR([ Invalid option. Use --with-efence/--without-efence instead ]) )
315
[ --with-rsaref=PATH Look for librsaref in PATH/lib.],
316
if test "x$withval" = "xyes"; then
318
elif test "x$withval" = "xno"; then
320
elif test -d "$withval"; then
321
AC_ADD_SEARCH_PATH($withval)
325
AC_ARG_ENABLE(rsaref,,
326
AC_MSG_ERROR([ Invalid option. Use --with-rsaref/--without-rsaref instead ]) )
328
tryopenssl=defaultyes
331
[ --with-openssl=PATH Look for openssl in PATH/lib.],
332
if test "x$withval" = "xyes"; then
335
elif test "x$withval" = "xno"; then
337
elif test -d "$withval"; then
338
AC_ADD_SEARCH_PATH($withval)
343
if test "x$tryopenssl" = "xdefaultyes"; then
344
AC_ADD_SEARCH_PATH(/usr/local/ssl)
347
AC_ARG_ENABLE(openssl,,
348
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
350
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
352
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
357
[ --with-krb5=PATH Look for krb5 in PATH/lib.],
358
if test "x$withval" = "xyes"; then
362
elif test "x$withval" = "xno"; then
365
elif test -d "$withval"; then
371
if test "x$trykrb5" = "xdefaultyes"; then
373
krb5path=/usr/kerberos
376
AC_MSG_ERROR([ Invalid option. Use --with-krb5/--without-krb5 instead ]) )
379
[ --without-rpm Don't include support for the RPM package
380
management system when building the host MIB
383
AC_MSG_ERROR([ Invalid option. Use --with-rpm/--without-rpm instead ]) )
385
AC_ARG_ENABLE(agentx-dom-sock-only,
386
[ --enable-agentx-dom-sock-only Disable UDP/TCP transports for agentx.],
387
AC_DEFINE(NETSNMP_AGENTX_DOM_SOCK_ONLY))
388
AC_ARG_WITH(agentx-dom-sock-only,,
389
AC_MSG_ERROR([ Invalid option. Use --enable-agentx-dom-sock-only/--disable-agentx-dom-sock-only instead ]) )
391
AC_ARG_ENABLE(snmptrapd-subagent,
392
[ --disable-snmptrapd-subagent Disable agentx subagent code in snmptrapd.])
393
if test "x$enable_snmptrapd_subagent" = "xno"; then
394
AC_DEFINE(NETSNMP_SNMPTRAPD_DISABLE_AGENTX)
396
AC_ARG_WITH(snmptrapd-subagent,,
397
AC_MSG_ERROR([ Invalid option. Use --enable-snmptrapd-subagent/--disable-snmptrapd-subagent instead ]) )
399
AC_ARG_WITH(opaque-special-types,
400
[ --without-opaque-special-types Don't use special opaque encodings.
401
SNMP normally cannot handle
402
floating numbers, nor large 64 bit
403
integers well. By default, the
404
net-snmp package compiles in
405
support for these extra datatypes
407
AC_ARG_ENABLE(opaque-special-types,,
408
AC_MSG_ERROR([ Invalid option. Use --with-opaque-special-types/--without-opaque-special-types instead ]) )
411
[ --with-mibdirs="dir1:dir2:" Default directories to look for mibs.
412
(Default: \$HOME/.snmp/mibs:DATADIR/snmp/mibs)],
413
[NETSNMP_DEFAULT_MIBDIRS="$with_mibdirs"
414
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBDIRS,"$with_mibdirs")])
415
AC_ARG_ENABLE(mibdirs,,
416
AC_MSG_ERROR([ Invalid option. Use --with-mibdirs/--without-mibdirs instead ]) )
419
[ --with-mibs="item1:item2:" Default mib IDs to read.
420
(The default list is "IP-MIB:IF-MIB:
421
TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB"
422
with the addition of any mibs used
423
by the mib modules the agent is
425
NETSNMP_DEFAULT_MIBS="$with_mibs")
426
# enable-mibs is valid too, but means something else
428
AC_ARG_WITH(mibfiles,
429
[ --with-mibfiles="file1:file2" Default mib files to load.
430
(Default: none. uses IDs above instead.)],
431
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBFILES,"$with_mibfiles"))
432
AC_ARG_ENABLE(mibfiles,,
433
AC_MSG_ERROR([ Invalid option. Use --with-mibfiles/--without-mibfiles instead ]) )
435
AC_ARG_ENABLE(mib-config-checking,
436
[ --enable-mib-config-checking Turns on extra checks during configuration
437
of mib modules. Any conflicts will cause
438
configure to abort (default is to issue a
439
warning and continue.)],
440
with_mib_cfg_checks="yes",with_mib_cfg_checks="no")
441
AC_ARG_WITH(mib-config-checking,,
442
AC_MSG_ERROR([ Invalid option. Use --enable-mib-config-checking/--disable-mib-config-checking instead ]) )
444
AC_ARG_ENABLE(mib-config-debug,
445
[ --enable-mib-config-debug Turns on verbose output during mib module
446
configure processing.)],
447
with_mib_cfg_debug="yes",with_mib_cfg_debug="no")
448
AC_ARG_WITH(mib-config-checking,,
449
AC_MSG_ERROR([ Invalid option. Use --enable-mib-config-checking/--disable-mib-config-checking instead ]) )
451
AC_ARG_ENABLE(mfd-rewrites,
452
[ --enable-mfd-rewrites Use new MFD rewrites of mib modules,
453
where available. (default is to use
454
original mib module code).])
455
if test "x$enable_mfd_rewrites" = "xyes"; then
456
AC_DEFINE(NETSNMP_ENABLE_MFD_REWRITES)
458
AC_ARG_WITH(mfd-rewrites,,
459
AC_MSG_ERROR([ Invalid option. Use --enable-mfd-rewrites/--disable-mfd-rewrites instead ]) )
463
[ --with-pkcs=PATH Look for pkcs11 in PATH/lib.],
464
if test "x$withval" = "xyes"; then
466
elif test "x$withval" = "xno"; then
468
elif test -d "$withval"; then
469
AC_ADD_SEARCH_PATH($withval)
474
AC_MSG_ERROR([ Invalid option. Use --with-pkcs/--without-pkcs instead ]) )
476
AC_ARG_ENABLE(testing-code,
477
[ --enable-testing-code Enables some code sections that should
478
only be used for testing of certain
479
SNMP functionalities. This should *not*
480
be turned on for production use. Ever.],
481
AC_DEFINE(NETSNMP_ENABLE_TESTING_CODE))
482
AC_ARG_WITH(testing-code,,
483
AC_MSG_ERROR([ Invalid option. Use --enable-testing-code/--disable-testing-code instead ]) )
485
AC_ARG_ENABLE(reentrant,
486
[ --enable-reentrant Enables locking functions that protect
487
library resources in some multi-threading
488
environments. This does not guarantee
489
thread-safe operation.
490
Currently an experimental setting.],
491
with_res_locks="yes",with_res_locks="no")
492
AC_ARG_WITH(reentrant,,
493
AC_MSG_ERROR([ Invalid option. Use --enable-reentrant/--disable-reentrant instead ]) )
495
AC_ARG_WITH(root-access,
497
Configuring the agent:
498
--without-root-access The snmpd agent won't require root access to
499
run it. The information it returns in the
500
mib-II tree may not be correct, however.])
501
AC_ARG_ENABLE(root-access,,
502
AC_MSG_ERROR([ Invalid option. Use --with-root-access/--without-root-access instead ]) )
504
AC_ARG_WITH(kmem-usage,
505
[ --without-kmem-usage Do not include any code related to the use
507
AC_ARG_ENABLE(kmem-usage,,
508
AC_MSG_ERROR([ Invalid option. Use --with-kmem-usage/--without-kmem-usage instead ]) )
510
AC_ARG_WITH(dummy-values,
511
[ --with-dummy-values Provide 'placeholder' dummy values where
512
the necessary information is not available.
513
This is technically not compliant with the
514
SNMP specifications, but was how the agent
515
operated for versions < 4.0.])
516
AC_ARG_ENABLE(dummy-values,,
517
AC_MSG_ERROR([ Invalid option. Use --with-dummy-values/--without-dummy-values instead ]) )
519
AC_ARG_WITH(persistent-directory,
520
[ --with-persistent-directory="directory"
521
Default directory for persistent data storage.],ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY="$with_persistent_directory")
522
AC_ARG_ENABLE(persistent-directory,,
523
AC_MSG_ERROR([ Invalid option. Use --with-persistent-directory/--without-persistent-directory instead ]) )
525
default_persistent_mask=077
526
AC_ARG_WITH(persistent-mask,
527
[ --with-persistent-mask="mask" Default mask for persistent data storage.
529
if test "$withval" = yes; then
530
AC_MSG_ERROR([ Please provide a mask value ]);
532
AC_MSG_RESULT(using default persistent mask $withval)
533
AC_DEFINE_UNQUOTED(NETSNMP_PERSISTENT_MASK,$withval)
535
AC_MSG_RESULT(using default persistent mask $default_persistent_mask)
536
AC_DEFINE_UNQUOTED(NETSNMP_PERSISTENT_MASK,$default_persistent_mask)
538
AC_ARG_ENABLE(persistent-mask,,
539
AC_MSG_ERROR([ Invalid option. Use --with-persistent-mask instead ]) )
541
AC_ARG_WITH(copy_persistent_files,
542
[ --with-copy-persistent-files="no" Don't copy persistent files
543
(or use "yes" to copy them).
545
ac_cv_user_prompt_COPY_PERSISTENT_FILES="$with_copy_persistent_files")
546
AC_ARG_ENABLE(copy_persistent_files,,
547
AC_MSG_ERROR([ Invalid option. Use --with-copy_persistent_files/--without-copy_persistent_files instead ]) )
549
default_temp_file_pattern="/tmp/snmpdXXXXXX"
550
AC_ARG_WITH(temp-file-pattern,
551
[ --with-temp-file-pattern=PATTERN Pattern of temporary files (Default: /tmp/snmpdXXXXXX)],[
552
if test "$withval" = yes; then
553
AC_MSG_ERROR([ Please provide a pattern ]);
555
AC_MSG_RESULT(using temporary file pattern $withval)
556
AC_DEFINE_UNQUOTED(NETSNMP_TEMP_FILE_PATTERN,"$withval",[Pattern of temporary files])
558
AC_MSG_RESULT(using default temporary file pattern $default_temp_file_pattern)
559
AC_DEFINE_UNQUOTED(NETSNMP_TEMP_FILE_PATTERN,"$default_temp_file_pattern",[Pattern of temporary files])
561
AC_ARG_ENABLE(temp-file-pattern,,
562
AC_MSG_ERROR([ Invalid option. Use --with-temp-file-pattern instead ]) )
564
default_agentx_socket="/var/agentx/master"
565
AC_ARG_WITH(agentx-socket,
566
[ --with-agentx-socket=FILE AgentX socket (Default: /var/agentx/master as specified in RFC2741)],[
567
if test "$withval" = yes; then
568
AC_MSG_ERROR([ Please provide a full path ]);
570
AC_MSG_RESULT(using AgentX socket $withval)
571
AC_DEFINE_UNQUOTED(NETSNMP_AGENTX_SOCKET,"$withval",[Unix domain socket for AgentX master-subagent communication])
573
AC_MSG_RESULT(using default AgentX socket $default_agentx_socket)
574
AC_DEFINE_UNQUOTED(NETSNMP_AGENTX_SOCKET,"$default_agentx_socket",[Unix domain socket for AgentX master-subagent communication])
576
AC_ARG_ENABLE(agentx-socket,,
577
AC_MSG_ERROR([ Invalid option. Use --with-agentx-socket instead ]) )
579
AC_ARG_WITH(default-snmp-version,
580
[ --with-default-snmp-version="3" Default version of SNMP to use.
582
Legal values: 1, 2 (for SNMPv2c) or 3.],
583
ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION="$with_default_snmp_version")
584
AC_ARG_ENABLE(default-snmp-version,,
585
AC_MSG_ERROR([ Invalid option. Use --with-default-snmp-version/--without-default-snmp-version instead ]) )
587
# we test this now and later as well. we test it now so configure can die
588
# early on with an error rather than waiting till the end of the script.
589
if test "x$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "x"; then
590
if test "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" = "2c"; then
591
ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION="2"
593
if test "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "1" -a "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "2" -a "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "3"; then
594
AC_MSG_ERROR(Illegal version number passed to --with-default-snmp-version)
598
AC_ARG_WITH(sys_contact,
599
[ --with-sys-contact="who@where" Default system contact.
600
(Default: LOGIN@DOMAINNAME)],
601
ac_cv_user_prompt_NETSNMP_SYS_CONTACT="$with_sys_contact")
602
AC_ARG_ENABLE(sys_contact,,
603
AC_MSG_ERROR([ Invalid option. Use --with-sys-contact/--without-sys-contact instead ]) )
605
AC_ARG_WITH(sys_location,
606
[ --with-sys-location="location" Default system location.
608
ac_cv_user_prompt_NETSNMP_SYS_LOC="$with_sys_location")
609
AC_ARG_ENABLE(sys_location,,
610
AC_MSG_ERROR([ Invalid option. Use --with-sys-location/--without-sys-location instead ]) )
613
[ --with-logfile="location" Default log file location for snmpd.],
614
ac_cv_user_prompt_NETSNMP_LOGFILE="$with_logfile")
615
AC_ARG_ENABLE(logfile,,
616
AC_MSG_ERROR([ Invalid option. Use --with-logfile/--without-logfile instead ]) )
617
if test "$ac_cv_user_prompt_NETSNMP_LOGFILE" = "no"; then
618
ac_cv_user_prompt_NETSNMP_LOGFILE="none"
621
AC_ARG_WITH(transports,
622
[ --with-transports="t1 t2 ..." Compile in the given SNMP transport
623
modules (space separated list).])
624
AC_ARG_WITH(out_transports,
625
[ --with-out-transports="t1 ..." Exclude listed SNMP transports
626
(space separated list).
628
Available SNMP transport modules are:
630
UDP support for SNMP over UDP/IP.
631
This transport is always compiled in.
632
UDPIPv6 support for SNMP over UDP/IPv6.
633
This transport is available for Linux, Solaris and
635
It is never compiled in by default.
636
TCPIPv6 support for SNMP over UDP/IPv6.
637
This transport is available for Linux, Solaris and
639
It is never compiled in by default.
640
TCP support for SNMP over TCP/IP.
641
This transport is compiled in by default, but may be omitted.
642
Unix support for SNMP over Unix domain protocols.
643
This transport is compiled in by default except on Win32
644
platforms, and may be omitted.
645
Callback support for SNMP over an internal locally connected pair
647
AAL5PVC support for SNMP over AAL5 PVCs.
648
This transport is presently only available for Linux,
649
is never compiled in by default and may be omitted.
650
IPX support for SNMP over IPX per RFC 1420.
651
This transport is presently only available for Linux,
652
is never compiled in by default and may be omitted.
656
# Catch common mistakes in transport options
658
AC_ARG_WITH(transport,, AC_MSG_ERROR([ Invalid option. Use --with-transports/--without-transports instead ]) )
659
AC_ARG_WITH(out-transport,,AC_MSG_ERROR([ Invalid option. Use --with-out-transports/--without-out-transports instead ]) )
665
AC_ARG_WITH(security-modules,
666
[ --with-security-modules="s1 s2 ..." Compile in the given SNMP security
667
module services (space separated list).
669
Available SNMP security services:
671
usm support for user based SNMP security
672
(required and always compiled in)
673
ksm support for kerberos based SNMP security
675
AC_ARG_ENABLE(security-modules,,
676
AC_MSG_ERROR([ Invalid option. Use --with-security-modules/--without-security-modules instead ]) )
682
AC_ARG_WITH(mib_modules,
683
[ --with-mib-modules="item1 ..." Compile with additional mib modules
684
(Space separated list).])
685
AC_ARG_ENABLE(mib_modules,,
686
AC_MSG_ERROR([ Invalid option. Use --with-mib-modules/--without-mib-modules instead ]) )
688
AC_ARG_WITH(out_mib_modules,
689
[ --with-out-mib-modules="list" Compile without these mib modules.
691
Default mib modules compiled into the agent (which can be removed):
693
mibII support for the mib-II tree.
694
snmpv3mibs support for the snmpv3 mib modules.
695
ucd_snmp UCD-SNMP-MIB specific extensions.
696
agent_mibs NET-SNMP-AGENT-MIB extensions
697
agentx AgentX support (see below)
698
notification mibs supporting specification of trap destinations.
699
target Support for the SNMP WGs TARGET-MIB.
700
utilities general agent configuration utilities.
701
disman/event support for the DISMAN-EVENT-MIB
702
(supports self monitoring and notification
703
delivery when error conditions are found)
704
disman/schedule support for the DISMAN-SCHEDULE-MIB
705
(trigger SET requests at specified times)
706
host host resources mib support.
707
(only on major supported platforms)
709
Optional mib modules that can be built into the agent include:
710
smux smux support to allow subagents to attach to snmpd.
711
mibII/mta_sendmail Sendmail statistics monitoring (MTA-MIB)
712
ucd-snmp/diskio Table of io-devices and how much data they have
713
read/written. (only tested on Solaris, Linux)
714
disman/old-event-mib previous implementation of the DISMAN-EVENT-MIB
716
Optional modules for specific platforms
718
ucd-snmp/lmSensors hardware monitoring (LM-SENSORS-MIB)
719
ip-mib/ipv4InterfaceTable (experimental)
720
ip-mib/ipv6InterfaceTable (experimental)
721
tunnel Linux TUNNEL-MIB support (ifTable extension)
722
mibII/interfaces (old ifTable implementation)
723
misc/ipfwacc accounting rules IP firewall information
724
ipfwchains/ipfwchains firewall chains under ipfw
725
(See agent/mibgroup/ipfwchains/README)
726
sctp-mib support for the SCTP-MIB
729
ucd-snmp/lmSensors hardware monitoring (LM-SENSORS-MIB)
730
if-mib IF-MIB rewrite (add --enable-mfd-rewrites)
731
tcp-mib TCP-MIB rewrite (tcpConnectionTable and
732
tcpListenerTable; add --enable-mfd-rewrites)
733
udp-mib UDP-MIB rewrite (udpEndpointTable;
734
add --enable-mfd-rewrites)
737
if-mib IF-MIB rewrite (add --enable-mfd-rewrites)
740
agentx/subagent allows the agent to run as either a snmp agent
741
or as an agentX sub-agent.
742
agentx/master makes the agent run as an agentX master agent
743
as well as a normal snmp agent.
744
agentx includes both agentx/master and agentx/client.
746
Optional modules for C coders to look at and/or include as extension examples:
748
examples/ucdDemoPublic SNMPv3 interoperability testing mib.
749
examples/example example C code extension.])
750
AC_ARG_ENABLE(out_mib_modules,,
751
AC_MSG_ERROR([ Invalid option. Use --with-out-mib-modules/--without-out-mib-modules instead ]) )
755
AC_ARG_WITH(enterprise-oid,
756
[Enterprise OIDs: (warning: this should be used with caution.)
758
--with-enterprise-oid The enterprise number assigned to the
760
http://www.iana.org/cgi-bin/enterprise.pl
761
to get one, though using the default is
762
probably the right choice is most cases.
763
(default 8072 = "enterprise.net-snmp")],[
764
if test "$withval" = yes; then
765
AC_MSG_ERROR([ Please provide a value for the enterprise number ]);
767
AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_OID, $withval)
768
ent_oid="1,3,6,1,4,1,$withval"
769
AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_MIB, $ent_oid)
770
ent_dot_oid="1.3.6.1.4.1.$withval"
771
AC_DEFINE_UNQUOTED(NETSNMP_ENTERPRISE_DOT_MIB, $ent_dot_oid)
772
AC_MSG_RESULT(using enterprise number $withval)
774
AC_MSG_RESULT(using default "enterprise.net-snmp")
776
AC_ARG_ENABLE(enterprise-oid,,
777
AC_MSG_ERROR([ Invalid option. Use --with-enterprise-oid/--without-enterprise-oid instead ]) )
779
AC_ARG_WITH(enterprise-sysoid,
781
--with-enterprise-sysoid The base OID for the sysObjectID
783
(default .1.3.6.1.4.1.8072.3.2... =
784
"netSnmpAgentOIDs...")],[
785
if test "$withval" = yes; then
786
AC_MSG_ERROR([ Please provide a base OID value ]);
788
sys_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
789
AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_MIB, $sys_oid)
790
sys_dot_oid=`echo "$withval" | sed 's/^\.//'`
791
AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_DOT_MIB, $sys_dot_oid)
792
sysoid_len=`echo "$withval" | sed 's/[^\.]//g' | awk -F\. '{ print NF }'`
793
AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_DOT_MIB_LENGTH, $sysoid_len)
794
AC_MSG_RESULT(using enterprise sysOID $withval ....)
796
AC_MSG_RESULT(using default enterprise sysOID "NET-SNMP-MIB::netSnmpAgentOIDs...")
798
AC_ARG_ENABLE(enterprise-sysoid,,
799
AC_MSG_ERROR([ Invalid option. Use --with-enterprise-sysoid/--without-enterprise-sysoid instead ]) )
801
AC_ARG_WITH(enterprise-notification-oid,
803
--with-enterprise-notification-oid The OID used for the root of
804
enterprise specific notifications.
805
(default .1.3.6.1.4.1.8072.4 =
806
"netSnmpNotificationPrefix")],[
807
if test "$withval" = yes; then
808
AC_MSG_ERROR([ Please provide a base OID value ]);
810
notification_oid=`echo "$withval" | sed 's/^\.//' | sed 's/\./\,/g'`
811
AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_MIB, $notification_oid)
812
notification_dot_oid=`echo "$withval" | sed 's/^\.//'`
813
AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_DOT_MIB, $notification_dot_oid)
814
notificationoid_len=`echo "$withval" | sed 's/[^\.]//g' | awk -F\. '{ print NF }'`
815
AC_DEFINE_UNQUOTED(NETSNMP_NOTIFICATION_DOT_MIB_LENGTH, $notificationoid_len)
816
AC_MSG_RESULT(using enterprise notifications $withval)
818
AC_MSG_RESULT(using default notifications "NET-SNMP-MIB::netSnmpNotifications")
820
AC_ARG_ENABLE(enterprise-notification-oid,,
821
AC_MSG_ERROR([ Invalid option. Use --with-enterprise-notification-oid/--without-enterprise-notification-oid instead ]) )
823
# Catch common mistakes in configure options
825
AC_ARG_WITH(mib-module,, AC_MSG_ERROR([ Invalid option1. Use --with-mib-modules instead ]) )
827
AC_MSG_ERROR([ Invalid option3. Use --with-mib-modules instead ]) )
828
AC_ARG_WITH(modules,,
829
AC_MSG_ERROR([ Invalid option4. Use --with-mib-modules instead ]) )
831
AC_ARG_WITH(out-mib-module,,AC_MSG_ERROR([ Invalid option5. Use --with-out-mib-modules instead ]) )
832
AC_ARG_WITH(out-modules,,
833
AC_MSG_ERROR([ Invalid option7. Use --with-out-mib-modules instead ]) )
834
AC_ARG_WITH(out-module,,
835
AC_MSG_ERROR([ Invalid option8. Use --with-out-mib-modules instead ]) )
840
AC_ARG_WITH(perl-modules,
843
--with-perl-modules[=ARGS] Install the Perl modules along with the rest
844
of the net-snmp toolkit. If ARGS is
845
specified, they're passed to the
846
Makefile.PL script.],[
847
if test "$withval" = "no"; then
851
if test "$withval" != "yes"; then
855
], install_perl="try")
857
AC_ARG_ENABLE(embedded-perl,
858
[ --disable-embedded-perl Disable embedded Perl in the SNMP agent and
859
snmptrapd. [enabled by default]],
860
embed_perl="$enableval", embed_perl="try")
862
AC_ARG_ENABLE(perl-cc-checks,
863
[ --disable-perl-cc-checks Disable configure checks for whether Perl's
864
C Compiler is compatible with ours when
865
embedded Perl is enabled.])
867
# Common perl mistakes
868
AC_ARG_ENABLE(perl-modules,,
869
AC_MSG_ERROR([ Invalid option. Use --with-perl-modules/--without-perl-modules instead ]) )
870
AC_ARG_WITH(embedded-perl,,
871
AC_MSG_ERROR([ Invalid option. Use --enable-embedded-perl/--disable-embedded-perl instead ]) )
872
AC_ARG_WITH(perl-cc-checks,,
873
AC_MSG_ERROR([ Invalid option. Use --enable-perl-cc-checks/--disable-perl-cc-checks instead ]) )
879
AC_ARG_WITH(python-modules,
882
--with-python-modules[=ARGS] Install the python bindings along with the
883
rest of the net-snmp toolkit. If ARGS is
884
specified, they're passed to the
885
setup.py script as arguments.],[
887
if test "$withval" = "yes"; then
889
elif test "$withval" = "no"; then
893
PYTHONARGS="$withval"
895
], install_python="no")
899
AC_ARG_WITH(server-send-buf,
902
--with-server-send-buf[=ARG] Use ARG for the default UDP/TCP send buffer instead
903
of the OS buffer for server sockets that are
904
created (snmpd, snmptrapd).
905
This default can be overridden in the runtime
907
The ARG should be the size in bytes],[
908
if test "$withval" = yes; then
909
AC_MSG_ERROR([ Please provide a positive number for the server send buffer ])
911
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_SERVER_SEND_BUF, $withval)],
912
AC_MSG_RESULT([using OS default send buffer size for server sockets]) )
913
AC_ARG_ENABLE(server-send-buf,,
914
AC_MSG_ERROR([ Invalid option. Use --with-server-send-buf/--without-server-send-buf instead ]) )
916
AC_ARG_WITH(server-recv-buf,
917
[ --with-server-recv-buf[=ARG] Similar as previous option, but for receive buffer],[
918
if test "$withval" = yes; then
919
AC_MSG_ERROR([ Please provide a positive number for the server recv buffer ])
921
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_SERVER_RECV_BUF, $withval)],
922
AC_MSG_RESULT([using OS default recv buffer size for server sockets]) )
923
AC_ARG_ENABLE(server-recv-buf,,
924
AC_MSG_ERROR([ Invalid option. Use --with-server-recv-buf/--without-server-recv-buf instead ]) )
926
AC_ARG_WITH(client-send-buf,
927
[ --with-client-send-buf[=ARG] Similar as previous options, but for the
928
receive buffer of client sockets],[
929
if test "$withval" = yes; then
930
AC_MSG_ERROR([ Please provide a positive number for the client send buffer ])
932
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_CLIENT_SEND_BUF, $withval)],
933
AC_MSG_RESULT([using OS default send buffer size for client sockets]) )
934
AC_ARG_ENABLE(client-send-buf,,
935
AC_MSG_ERROR([ Invalid option. Use --with-client-send-buf/--without-client-send-buf instead ]) )
937
AC_ARG_WITH(client-recv-buf,
938
[ --with-client-recv-buf[=ARG] Similar as previous options, but for the send buffer],[
939
if test "$withval" = yes; then
940
AC_MSG_ERROR([ Please provide a positive number for the client recv buffer ])
942
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_CLIENT_RECV_BUF, $withval)],
943
AC_MSG_RESULT([using OS default recv buffer size for client sockets]) )
944
AC_ARG_ENABLE(client-recv-buf,,
945
AC_MSG_ERROR([ Invalid option. Use --with-client-recv-buf/--without-client-recv-buf instead ]) )
948
# otherwise prompted information
950
AC_ARG_WITH(defaults,
953
--with-defaults Use defaults for prompted values.],
954
defaults="yes",defaults="no")
955
AC_ARG_ENABLE(defaults,,
956
AC_MSG_ERROR([ Invalid option. Use --with-defaults/--without-defaults instead ]) )
958
AC_ARG_ENABLE(ucd-snmp-compatibility,
959
[ --enable-ucd-snmp-compatibility Install ucd-snmp look-alike headers and libs.
961
AC_ARG_WITH(ucd-snmp-compatibility,,
962
AC_MSG_ERROR([ Invalid option. Use --enable-ucd-snmp-compatibility/--disable-ucd-snmp-compatibility instead ]) )
965
# setup install targets
967
if test "x$enable_ucd_snmp_compatibility" = "xyes" ; then
968
installucdheaders=installucdheaders
969
installucdlibs=installucdlibs
970
AC_MSG_CACHE_ADD(UCD-SNMP compatability: enabled)
972
AC_SUBST(installucdheaders)
973
AC_SUBST(installucdlibs)
975
# Only define if specifically chosen as --without (i.e., default to true).
976
if test "x$with_root_access" = "xno"; then
977
AC_DEFINE(NETSNMP_NO_ROOT_ACCESS)
980
# Only define if specifically chosen as --without (i.e., default to true).
981
if test "x$with_kmem_usage" = "xno"; then
982
AC_DEFINE(NETSNMP_NO_KMEM_USAGE)
985
# Define unless specifically suppressed (i.e., option defaults to false).
986
if test "x$with_dummy_values" != "xyes"; then
987
AC_DEFINE(NETSNMP_NO_DUMMY_VALUES)
990
# Only define if specifically chosen as --without (i.e., default to true).
991
if test "x$with_opaque_special_types" != "xno"; then
992
AC_DEFINE(NETSNMP_WITH_OPAQUE_SPECIAL_TYPES)
996
# overflow problems with hpux's sh
997
# taken from Perl's Configure script
999
AC_MSG_CHECKING([if I need to feed myself to ksh])
1000
if test -f /hp-ux -a -f /bin/ksh; then
1001
if (PATH=.; alias -x) >/dev/null 2>&1; then
1005
if test "x$1" = "x"; then
1008
exec /bin/ksh $0 "$@"
1015
if test "x$developer" != "xno" -a -f $srcdir/remove-files; then
1016
# turn on the developer flag when taken from a SVN checkout (not a release)
1023
LINKCC=${LINKCC-"$CC"}
1030
PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
1033
# platform-specific compiler flags
1034
if test "x$PARTIALTARGETOS" = "xmingw32msvc"; then
1035
CFLAGS="$CFLAGS -Dmingw32"
1038
# platform-specific linker flags
1040
aix4.2*|aix4.3*|aix5*|aix6*)
1041
AC_MSG_CHECKING([what linker flags to add to enable runtime linking on AIX])
1042
for ld_flag in $LDFLAGS; do
1043
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
1044
netsnmp_aix_runtimelinking_flags_ok=yes
1048
if test "X$netsnmp_aix_runtimelinking_flags_ok" != "Xyes"; then
1049
if test "x$GCC" = "xyes"; then
1050
netsnmp_aix_ldflags="-Wl,-brtl"
1052
netsnmp_aix_ldflags="-brtl"
1054
LDFLAGS="$netsnmp_aix_ldflags $LDFLAGS"
1055
AC_MSG_RESULT($netsnmp_aix_ldflags)
1057
AC_MSG_RESULT([none])
1061
AC_MSG_CHECKING([whether darwin ld might need -flat_namespace])
1062
if test -z "$MACOSX_DEPLOYMENT_TARGET"; then
1063
LDFLAGS="-flat_namespace $LDFLAGS"
1064
AC_MSG_RESULT([yes])
1073
# libtool stuff for shared/static libraries.
1075
AC_LIBTOOL_WIN32_DLL
1077
AC_SUBST(LIBTOOL_DEPS)
1079
# Checks for programs.
1084
AC_PATH_PROG([PSPROG],ps)
1085
AC_PATH_PROG([PERLPROG],perl)
1086
AC_PATH_PROG([PYTHONPROG],python)
1087
AC_CHECK_PROGS(WHOAMI, whoami logname, whoami)
1088
AC_CHECK_PROGS(SED,sed gsed)
1089
AC_CHECK_PROGS(FIND,find)
1090
AC_PATH_PROG(AUTOCONF, autoconf)
1091
AC_PATH_PROG(AUTOHEADER, autoheader)
1092
if test "x$ac_cv_prog_AUTOCONF" = "x"; then
1096
if test "x$ac_cv_prog_AUTOHEADER" = "x"; then
1098
AC_SUBST(AUTOHEADER)
1101
AC_PATH_PROG([UNAMEPROG],uname)
1102
AC_DEFINE_UNQUOTED(UNAMEPROG,"$UNAMEPROG")
1108
# get version number.
1109
AC_MSG_CHECKING([for net-snmp version number])
1110
VERSION=`grep NetSnmpVersionInfo.*= $srcdir/snmplib/snmp_version.c | sed 's/";.*//;s/.*"//;'`
1112
# create the release version number.... I'm not sure this is used
1113
# anywhere any longer.
1114
_release_version=`echo $VERSION | sed 's/";.*//;s/.*"//;s/pre/0./;'`
1116
RELEASEVERSION=`echo $_release_version | sed 's/^\([0-9]\)\.\([0-9]\)/\1:\2:0/'`
1120
AC_SUBST(RELEASEVERSION)
1121
AC_MSG_RESULT($VERSION)
1122
AC_MSG_CACHE_ADD(Net-SNMP Version: $VERSION)
1124
# super type checking
1126
AC_MSG_CHECKING([for developer gcc flags])
1127
if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
1128
DEVFLAGS="-Wall -Winline -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts"
1132
AC_MSG_RESULT($DEVFLAGS)
1136
# hacks for building outside of the source directory
1138
# 1) make sure build include paths are before source
1139
# 2) check for GNU make to use vpath instead of VPATH
1141
NON_GNU_VPATH="VPATH ="
1144
# define include paths relative to top_srcdir
1145
# tweak includes if we're building outside of the source dir
1146
if test "x$srcdir" = "x."; then
1147
TOP_INCLUDES=SRC_TOP_INCLUDES
1148
SNMPLIB_INCLUDES=SRC_SNMPLIB_INCLUDES
1149
AGENT_INCLUDES=SRC_AGENT_INCLUDES
1150
HELPER_INCLUDES=SRC_HELPER_INCLUDES
1151
MIBGROUP_INCLUDES=SRC_MIBGROUP_INCLUDES
1153
TOP_INCLUDES=BLD_TOP_INCLUDES
1154
SNMPLIB_INCLUDES=BLD_SNMPLIB_INCLUDES
1155
AGENT_INCLUDES=BLD_AGENT_INCLUDES
1156
HELPER_INCLUDES=BLD_HELPER_INCLUDES
1157
MIBGROUP_INCLUDES=BLD_MIBGROUP_INCLUDES
1158
make -v -f /dev/null 2>/dev/null | grep GNU >/dev/null
1160
if test $have_gnu_make -eq 0 ; then
1161
NON_GNU_VPATH="#VPATH ="
1165
AC_SUBST(TOP_INCLUDES)
1166
AC_SUBST(SNMPLIB_INCLUDES)
1167
AC_SUBST(AGENT_INCLUDES)
1168
AC_SUBST(HELPER_INCLUDES)
1169
AC_SUBST(MIBGROUP_INCLUDES)
1171
AC_SUBST(NON_GNU_VPATH)
1175
# Check whether we can use -Ux -Dx=x with the expected behaviour
1177
AC_MSG_CHECKING([whether to un-define target system token (before redefining)])
1178
OLD_CPPFLAGS="$CPPFLAGS"
1179
CPPFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
1182
#ifdef $PARTIALTARGETOS
1186
[PARTIALTARGETFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
1187
AC_MSG_RESULT([yes])],
1188
[PARTIALTARGETFLAGS="-D$PARTIALTARGETOS=$PARTIALTARGETOS"
1189
AC_MSG_RESULT([no])])
1190
CFLAGS="$CFLAGS $PARTIALTARGETFLAGS"
1191
CPPFLAGS="$OLD_CPPFLAGS"
1192
AC_MSG_CACHE_ADD(Building for: $PARTIALTARGETOS)
1196
# check for special includes and pick one
1199
AC_MSG_CHECKING([for system include file])
1202
# ignore binary format indication
1203
filebase=`echo $filebase | sed 's/elf//'`
1204
filebase=`echo $filebase | sed 's/aout//'`
1205
filebase=`echo $filebase | sed 's/ecoff//'`
1206
filebase=`echo $filebase | sed 's/coff//'`
1207
while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/system/$filebase.h
1210
filebase=`echo $filebase | sed 's/[-._][^-._]*$//'`
1211
if test "x$filebase" = "x$last"; then
1212
filebase=`echo $filebase | sed 's/[0-9]*$//'`
1216
if test "x$filebase" = "x$last"; then
1219
ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE="net-snmp/system/$filebase.h"
1222
AC_MSG_RESULT($ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE)
1223
AC_DEFINE_UNQUOTED(NETSNMP_SYSTEM_INCLUDE_FILE, "$ac_cv_NETSNMP_SYSTEM_INCLUDE_FILE")
1225
# second part, the CPU type.
1227
AC_MSG_CHECKING([for machine-type include file])
1229
filebase=$target_cpu
1230
while test "x$filebase" != "x$last" -a ! -f $srcdir/include/net-snmp/machine/$filebase.h
1233
filebase=`echo $filebase | sed 's/[-._][^-._]*$//'`
1236
if test "x$filebase" = "x$last"; then
1239
ac_cv_NETSNMP_MACHINE_INCLUDE_FILE="net-snmp/machine/$filebase.h"
1241
AC_MSG_RESULT([$ac_cv_NETSNMP_MACHINE_INCLUDE_FILE])
1243
AC_DEFINE_UNQUOTED(NETSNMP_MACHINE_INCLUDE_FILE, "$ac_cv_NETSNMP_MACHINE_INCLUDE_FILE")
1245
AC_PATH_PROG([CCPATH],$CC)
1246
# watch out for /usr/ucb/cc on solaris, it doesn't work with this package.
1249
if test "x$CCPATH" = "x/usr/ucb/cc" -o "x$CCPATH" = "x/usr/bin/cc"; then
1252
*** The BSDI /usr/ucb/cc compiler does not work with this package.
1253
*** Please run configure with --with-cc=gcc
1258
if test "x$CCPATH" = "x/usr/ucb/cc"; then
1261
*** The solaris /usr/ucb/cc compiler does not work with this package.
1262
*** Please put a different compiler in your path first or run
1263
*** configure with --with-cc=XX, where XX is the compiler you want to use.
1269
AC_MSG_CHECKING([for additional cpp flags])
1270
# gcc extra CPPFLAGS
1271
if test "x$GCC" = "xyes" -a "x$CPP" = "x$CC -E"; then
1272
# extra cpp flags for gnu c compiler to allow .in file extensions.
1273
EXTRACPPFLAGS="-x c"
1278
# Solaris extra cpp flags.
1279
if test "x$GCC" != "xyes"; then
1281
solaris*) EXTRACPPFLAGS="$EXTRACPPFLAGS -Xs" ;;
1285
AC_SUBST(EXTRACPPFLAGS)
1286
AC_MSG_RESULT($EXTRACPPFLAGS)
1288
# Prefixes must begin with "/" or [A-Z] followed by colon.
1290
if test "x$prefix" = "xNONE"; then
1294
fch=`echo $prefix | sed 's/\(.\).*/\1/'`
1295
if test "x$fch" != "x/" ; then
1296
sch=`echo $prefix | sed 's/.\(.\).*/\1/'`
1297
if test "x$sch" != "x:" ; then
1298
prefix=`pwd`/$prefix
1299
echo "adjusting prefix to $prefix"
1303
if test "x$exec_prefix" = "xNONE"; then
1307
fch=`echo $exec_prefix | sed 's/\(.\).*/\1/'`
1308
if test "x$fch" != "x/" ; then
1309
sch=`echo $exec_prefix | sed 's/.\(.\).*/\1/'`
1310
if test "x$sch" != "x:" ; then
1311
exec_prefix=`pwd`/$exec_prefix
1312
echo "adjusting exec_prefix to $exec_prefix"
1316
# Set SNMPLIBPATH & SNMPSHAREPATH
1319
tmpset="$libdir/snmp"
1320
while test "x$tmpset" != "x$SNMPLIBPATH"; do
1321
SNMPLIBPATH="$tmpset"
1322
eval tmpset="$tmpset"
1324
AC_DEFINE_UNQUOTED(SNMPLIBPATH,"$SNMPLIBPATH")
1325
AC_SUBST(SNMPLIBPATH)
1326
AC_DEFINE_UNQUOTED(SNMPDLMODPATH,"$SNMPLIBPATH/dlmod")
1329
tmpset="$datadir/snmp"
1330
while test "x$tmpset" != "x$SNMPSHAREPATH"; do
1331
SNMPSHAREPATH="$tmpset"
1332
eval tmpset="$tmpset"
1334
AC_DEFINE_UNQUOTED(SNMPSHAREPATH,"$SNMPSHAREPATH")
1335
AC_SUBST(SNMPSHAREPATH)
1337
if test "x$NETSNMP_DEFAULT_MIBDIRS" = "x"; then
1338
NETSNMP_DEFAULT_MIBDIRS="\$HOME/.snmp/mibs:$SNMPSHAREPATH/mibs"
1339
if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
1340
NETSNMP_DEFAULT_MIBDIRS=`echo "$NETSNMP_DEFAULT_MIBDIRS" | $SED 's/:/;/g'`
1342
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBDIRS,"$NETSNMP_DEFAULT_MIBDIRS")
1344
AC_SUBST(NETSNMP_DEFAULT_MIBDIRS)
1347
tmpset="$sysconfdir/snmp"
1348
while test "x$tmpset" != "x$SNMPCONFPATH"; do
1349
SNMPCONFPATH="$tmpset"
1350
eval tmpset="$tmpset"
1352
AC_DEFINE_UNQUOTED(SNMPCONFPATH,"$SNMPCONFPATH")
1353
AC_SUBST(SNMPCONFPATH)
1355
AC_CHECK_SIZEOF(short)
1356
AC_CHECK_SIZEOF(int)
1357
AC_CHECK_SIZEOF(long)
1358
AC_CHECK_SIZEOF(long long)
1359
AC_CHECK_SIZEOF(intmax_t)
1360
AC_CHECK_TYPES([int8_t, uint8_t, u_int8_t])
1361
AC_CHECK_TYPES([int16_t, uint16_t, u_int16_t])
1362
AC_CHECK_TYPES([int32_t, uint32_t, u_int32_t])
1363
AC_CHECK_TYPES([int64_t, uint64_t, u_int64_t])
1364
AC_CHECK_TYPES([intmax_t, uintmax_t])
1365
AC_CHECK_TYPES([off64_t])
1366
AC_CHECK_TYPES([uintptr_t, intptr_t])
1368
# solaris specific type
1369
AC_CHECK_TYPES([Counter64],,,[#include <inet/mib2.h>])
1371
# guess IPv6 stack type.
1372
if test "x$enable_ipv6" = "xyes"; then
1377
AC_MSG_CHECKING([[ipv6 stack type]])
1378
for i in v6d toshiba kame inria zeta linux-glibc linux-inet6 generic; do
1382
#include </usr/local/v6/include/sys/types.h>
1386
[v6type=$i; v6lib=v6;
1387
v6libdir=/usr/local/v6/lib;
1388
CFLAGS="-I/usr/local/v6/include $CFLAGS"])
1392
#include <sys/param.h>
1393
#ifdef _TOSHIBA_INET6
1396
[v6type=$i; v6lib=inet6;
1397
v6libdir=/usr/local/v6/lib;
1398
CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
1402
#include <netinet/in.h>
1406
[v6type=$i; v6lib=inet6;
1407
v6libdir=/usr/local/v6/lib;
1409
CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
1413
#include <netinet/in.h>
1414
#ifdef IPV6_INRIA_VERSION
1421
CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
1425
#include <sys/param.h>
1426
#ifdef _ZETA_MINAMI_INET6
1430
[v6type=$i; v6lib=inet6;
1431
v6libdir=/usr/local/v6/lib;
1432
CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
1436
#include <features.h>
1437
#if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC_ > 2))
1444
CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
1447
if test -d /usr/inet6; then
1450
v6libdir=/usr/inet6/lib
1451
CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
1455
AC_MSG_RESULT([[postponed]])
1456
AC_CHECK_STRUCT_FOR([
1457
#include <sys/types.h>
1458
#include <sys/param.h>
1459
#include <sys/socket.h>
1460
#include <netinet/in.h>
1461
], sockaddr_in6, sin6_addr, no)
1462
AC_MSG_CHECKING([[ipv6 stack type]])
1463
if test "x$ac_cv_struct_sockaddr_in6_has_sin6_addr" = "xyes"; then
1468
CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
1472
if test "$v6type" != "unknown"; then
1477
if test "$v6lib" != "none"; then
1478
if test -d $v6libdir -a -f $v6libdir/lib$v6lib.a; then
1479
LIBS="-L$v6libdir -l$v6lib $LIBS"
1481
AC_MSG_RESULT(["$v6type, $enable_ipv6, using lib$v6lib"])
1482
elif test "$v6trylibc" = "yes"; then
1484
AC_MSG_RESULT(["$v6type, $enable_ipv6, using libc"])
1486
AC_MSG_ERROR(no IPv6 library lib$v6lib.a found.)
1491
AC_MSG_RESULT(["$v6type, $enable_ipv6"])
1496
# Maybe add library extensions for thread mutex locking.
1499
if test "x$with_res_locks" = "xyes"; then
1500
AC_DEFINE(NETSNMP_REENTRANT)
1505
CC_RUNTIME_ARG="$CC_RUNTIME_ARG -lpthreads"
1515
# Add platform-specific source files.
1517
AC_MSG_CHECKING([for platform-specific source])
1523
other_trapd_objects=""
1525
# Win32 service code
1526
if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
1527
other_src_list="$other_src_list winservice.c winservicerc.rc"
1528
other_objs_list="$other_objs_list winservice.o winservicerc.o"
1529
other_lobjs_list="$other_lobjs_list winservice.lo winservicerc.lo"
1530
other_agentobjs="../snmplib/winservicerc.o"
1531
other_lagentobjs="../snmplib/winservicerc.lo"
1532
other_trapd_objects="../snmplib/winservicerc.o"
1536
if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
1537
other_src_list="$other_src_list winpipe.c"
1538
other_objs_list="$other_objs_list winpipe.o"
1539
other_lobjs_list="$other_lobjs_list winpipe.lo"
1542
AC_SUBST(other_src_list)
1543
AC_SUBST(other_objs_list)
1544
AC_SUBST(other_lobjs_list)
1545
AC_SUBST(other_agentobjs)
1546
AC_SUBST(other_lagentobjs)
1547
AC_SUBST(other_trapd_objects)
1549
AC_MSG_RESULT([$other_src_list $other_objs_list $other_lobjs_list])
1550
AC_MSG_RESULT([$other_agentobjs $other_lagentobjs $other_trapd_objects])
1553
# Do transport module processing.
1555
AC_MSG_CHECKING([for and configuring transport modules to use])
1556
transport_src_list=""
1557
transport_hdr_list=""
1558
transport_def_list=""
1559
transport_result_list=""
1560
transport_add_list=""
1561
transport_callback_disabled=""
1562
new_with_transport_list=`echo $with_transports | sed 's/,/ /g;'`
1563
new_with_out_transport_list=`echo $with_out_transports | sed 's/,/ /g;'`
1566
# Add the default transports to the list
1568
if test "x$PARTIALTARGETOS" = "xcygwin"; then
1569
transport_default_list="UDP TCP Callback"
1570
elif test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
1571
transport_default_list="UDP TCP Callback"
1573
transport_default_list="UDP TCP Unix Callback"
1575
if test "x$enable_ipv6" = "xyes"; then
1576
transport_default_list="UDPIPv6 TCPIPv6 $transport_default_list"
1578
for i in $transport_default_list; do
1579
if echo " $new_with_transport_list " | grep " $i " >/dev/null; then
1582
transport_add_list="$i $transport_add_list"
1585
new_transport_list="$transport_add_list $new_with_transport_list"
1587
for i in $new_transport_list; do
1588
if echo " $new_with_out_transport_list " | grep " $i " >/dev/null; then
1589
if test "x$i" = "xUDP"; then
1591
AC_MSG_ERROR(It is not possible to compile without UDP/IP support.)
1592
elif test "x$i" = "xCallback"; then
1594
transport_callback_disabled="yes"
1597
if test "x$i" = "xAAL5PVC"; then
1598
if test "x$PARTIALTARGETOS" != "xlinux"; then
1600
AC_MSG_ERROR(AAL5 PVC support unavailable for this platform (Linux only))
1603
if test "x$i" = "xIPX"; then
1604
if test "x$PARTIALTARGETOS" != "xlinux"; then
1606
AC_MSG_ERROR(IPX support unavailable for this platform (Linux only))
1609
if test "x$i" = "xUnix"; then
1610
if test "x$PARTIALTARGETOS" = "xcygwin"; then
1612
AC_MSG_ERROR(Unix domain protocol support unavailable for this platform)
1613
elif test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
1615
AC_MSG_ERROR(Unix domain protocol support unavailable for this platform)
1618
if test ! "x$enable_ipv6" = "xyes"; then
1619
if test "x$i" = "xUDPIPv6" -o "x$i" = "xTCPIPv6"; then
1621
AC_MSG_ERROR(IPv6 transports not available if IPv6 support is not enabled)
1624
transport_src="snmp"$i"Domain.c"
1625
transport_hdr="snmp"$i"Domain.h"
1626
rel_transport_src="snmplib/"$transport_src
1627
rel_transport_hdr="include/net-snmp/library/"$transport_hdr
1628
if test -f "$srcdir/$rel_transport_src"; then
1629
transport_result_list="$transport_result_list $i"
1630
transport_src_list="$transport_src $transport_src_list"
1631
if test -f "$srcdir/$rel_transport_hdr"; then
1632
transport_hdr_list="$transport_hdr $transport_hdr_list"
1634
transport_def=`echo $i | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1635
transport_def_list="NETSNMP_TRANSPORT_"$transport_def"_DOMAIN $transport_def_list"
1638
AC_MSG_ERROR(Cannot find file $srcdir/$rel_transport_src to support SNMP transport domain $i.)
1642
transport_obj_list=`echo " $transport_src_list " | sed 's/\.c/\.o/g'`
1643
transport_lobj_list=`echo " $transport_src_list " | sed 's/\.c/\.lo/g'`
1645
## win32 platforms require inet_ntop etc.
1646
if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
1647
if echo "$transport_def_list" | grep "IPV6" >/dev/null; then
1648
transport_obj_list="$transport_obj_list inet_ntop.o inet_pton.o"
1649
transport_lobj_list="$transport_lobj_list inet_ntop.lo inet_pton.lo"
1653
AC_SUBST(transport_hdr_list)
1654
AC_SUBST(transport_src_list)
1655
AC_SUBST(transport_obj_list)
1656
AC_SUBST(transport_lobj_list)
1657
for i in $transport_def_list; do
1658
AC_DEFINE_UNQUOTED($i)
1660
AC_MSG_RESULT($transport_result_list.)
1661
AC_MSG_CACHE_ADD(Network transport support: $transport_result_list)
1664
# Security modules to use
1667
AC_MSG_CHECKING([for security modules to use])
1668
security_def_list="usm"
1669
security_src_list=""
1670
security_obj_list=""
1671
security_lobj_list=""
1672
security_init_file="snmplib/snmpsm_init.h"
1673
security_incl_file="include/net-snmp/library/snmpv3-security-includes.h"
1674
new_with_security=`echo $with_security_modules | sed 's/,/ /g;'`
1675
new_with_out_security=`echo $with_out_security_modules | sed 's/,/ /g;'`
1677
if test ! -d include; then
1680
if test ! -d include/net-snmp; then
1681
mkdir include/net-snmp
1683
if test ! -d include/net-snmp/agent; then
1684
mkdir include/net-snmp/agent
1686
if test ! -d include/net-snmp/library; then
1687
mkdir include/net-snmp/library
1689
if test ! -d include/ucd-snmp; then
1690
mkdir include/ucd-snmp
1693
if test ! -d snmplib; then
1696
echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_init_file
1697
echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $security_incl_file
1699
for i in $security_def_list; do
1700
if echo " $new_with_out_security " | grep " $i " > /dev/null; then
1701
if test "x$i" = "xusm"; then
1703
AC_MSG_ERROR(The USM security module is mandatory)
1706
new_with_security="$new_with_security $i"
1710
for i in $new_with_security; do
1714
# make sure support exists for it
1715
if test -f $srcdir"/snmplib/"$cfile -a -f $srcdir"/include/net-snmp/library/"$hfile; then
1719
AC_MSG_ERROR(No such security module: $i / $cfile / $hfile)
1722
# define a bunch of stuff to enable it
1723
security_src_list="$security_src_list $cfile"
1724
security_hdr_list="$security_hdr_list $hfile"
1725
security_obj_list="$security_obj_list snmp"$i".o"
1726
security_lobj_list="$security_lobj_list snmp"$i".lo"
1727
def_name="NETSNMP_SECMOD_"`echo $i | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1728
echo "init_"$i"();" >> $security_init_file
1729
echo "#include <net-snmp/library/$hfile>" >> $security_incl_file
1730
AC_DEFINE_UNQUOTED($def_name)
1733
AC_SUBST(security_src_list)
1734
AC_SUBST(security_hdr_list)
1735
AC_SUBST(security_obj_list)
1736
AC_SUBST(security_lobj_list)
1737
AC_MSG_RESULT($new_with_security)
1738
AC_MSG_CACHE_ADD(SNMPv3 Security Modules: $new_with_security)
1741
# Handle the special case of KSM to see which crypto API we support
1744
ac_cv_NETSNMP_USE_KERBEROS_MIT=no
1745
rebuilt_new_with_security=
1746
already_checked_krb5=no
1748
for sec in $new_with_security
1750
if test "x$sec" = "xksm" -a "xyes" = "x$already_checked_krb5"; then
1753
already_checked_krb5=yes
1755
if test x$sec != xksm; then
1756
rebuilt_new_with_security="$rebuilt_new_with_security $sec"
1758
if test no = $trykrb5; then
1759
AC_MSG_NOTICE([configured not to use krb5. disabling ksm])
1763
AC_PATH_PROG([krb5_config],krb5-config,[no],$krb5path/bin:$PATH)
1765
if test no != $krb5_config; then
1766
CPPFLAGS="$CPPFLAGS `$krb5_config --cflags`"
1767
LIBS="$LIBS `$krb5_config --libs`"
1768
elif test $krb5path != no; then
1769
AC_ADD_SEARCH_PATH($krb5path)
1771
AC_ADD_SEARCH_PATH(/usr/kerberos)
1774
AC_MSG_CHECKING([for krb5])
1775
AC_CACHE_VAL(ac_cv_have_krb5,
1776
AC_CHECK_LIB(krb5, krb5_init_context,
1777
ac_cv_have_krb5=yes, ac_cv_have_krb5=no
1781
if test $ac_cv_have_krb5 = no; then
1782
if test "x$askedkrb5" = "xyes"; then
1783
AC_MSG_ERROR(Asked to use krb5 but I couldn't find it.)
1785
AC_MSG_RESULT(no. disabling ksm)
1790
rebuilt_new_with_security="$rebuilt_new_with_security ksm"
1792
AC_MSG_CHECKING([[for heimdal]])
1793
AC_CACHE_VAL(ac_cv_heimdal,
1795
[#include <krb5.h>],
1796
[const char *v = heimdal_version;],
1800
AC_MSG_RESULT($ac_cv_heimdal)
1801
if test $ac_cv_heimdal = yes; then
1802
AC_DEFINE(NETSNMP_USE_KERBEROS_HEIMDAL)
1803
if test no = $krb5_config; then
1804
LIBS="$LIBS -lkrb5 -lasn1 -lcom_err -lroken"
1806
elif test no = $krb5_config; then
1807
LIBS="$LIBS -lkrb5 -lcom_err"
1810
AC_MSG_CHECKING([to see which crypto API we need to use])
1811
AC_CHECK_FUNC(krb5_c_encrypt,[
1812
AC_CACHE_VAL(ac_cv_NETSNMP_USE_KERBEROS_MIT,
1813
AC_CHECK_LIB(k5crypto, krb5_init_context,
1814
ac_cv_NETSNMP_USE_KERBEROS_MIT=yes, ac_cv_MIT_NEW_CRYPTo=no
1818
if test yes = $ac_cv_NETSNMP_USE_KERBEROS_MIT; then
1819
AC_MSG_RESULT(new MIT crypto API)
1820
AC_DEFINE(NETSNMP_USE_KERBEROS_MIT)
1821
if test no = $krb5_config; then
1822
LIBS="$LIBS -lk5crypto"
1825
AC_MSG_RESULT(old MIT crypto API)])
1830
new_with_security=$rebuilt_new_with_security
1833
# generate empty files
1835
# Create include file list for snmp_vars.h to use.
1836
mibdir="agent/mibgroup"
1837
if test ! -d agent; then
1840
if test ! -d agent/mibgroup; then
1841
mkdir agent/mibgroup
1843
j="$mibdir/mib_module_includes.h $mibdir/agent_module_includes.h \
1844
$mibdir/mib_module_inits.h $mibdir/agent_module_inits.h \
1845
$mibdir/mib_module_shutdown.h $mibdir/agent_module_shutdown.h \
1846
include/net-snmp/agent/mib_module_config.h \
1847
include/net-snmp/agent/agent_module_config.h \
1848
$mibdir/mib_module_dot_conf.h $mibdir/agent_module_dot_conf.h"
1852
echo "/* This file is automatically generated by configure. Do not modify by hand. */" > $i
1856
# Do hairy agent module processing.
1858
AC_MSG_CHECKING([for and configuring mib modules to use])
1860
# set up the CPP command
1861
MODULECPP="$CPP $PARTIALTARGETFLAGS -I${srcdir}/include -I${srcdir}/agent/mibgroup"
1862
if test "x$enable_mfd_rewrites" = "xyes"; then
1863
MODULECPP="$MODULECPP -DNETSNMP_ENABLE_MFD_REWRITES"
1868
agent_module_list=""
1869
new_with_mib_modules=`echo $with_mib_modules | sed 's/,/ /g;'`
1870
new_with_out_mib_modules=`echo $with_out_mib_modules | sed 's/,/ /g;'`
1872
# set up initial module list
1873
new_module_list="$new_with_mib_modules default_modules"
1875
# minor modifications
1876
if test "x$enable_agent" = "xno"; then
1877
# minimum mib module list for snmptrapd
1878
new_module_list="mibII/vacm_vars mibII/vacm_conf utilities/execute $new_with_mib_modules"
1879
default_mibs=SNMPv2-MIB:RFC1213-MIB
1880
default_mibs_install=" "
1881
elif test "x$mini_agent" = "xyes"; then
1882
# define the mini agent flag to reduce our load list from default_mibs.h
1883
MODULECPP="$MODULECPP -DNETSNMP_MINI_AGENT"
1886
test_modules="$new_module_list"
1889
# remove modules that were explicitly excluded
1890
for i in $test_modules
1892
if echo " $new_with_out_mib_modules " | grep " $i " > /dev/null; then
1893
mib_cfg_msg="mib module '$i' is both included and excluded."
1894
AC_MSG_WARN([mib module conflict])
1895
if test "x$with_mib_cfg_checks" = "xyes"; then
1896
AC_MSG_WARN([user with : $with_mib_modules])
1897
AC_MSG_WARN([final with : $new_module_list])
1898
AC_MSG_WARN([user without : $with_out_mib_modules])
1899
AC_MSG_WARN([final without: $new_with_out_mib_modules])
1900
AC_MSG_ERROR([$mib_cfg_msg])
1902
AC_MSG_WARN([$mib_cfg_msg It will be excluded])
1903
AC_MSG_CACHE_ADD([*** MIB Module warning *** $mib_cfg_msg It has been excluded.])
1906
new_module_list="$new_module_list $i"
1910
AC_MSG_RESULT([$new_module_list.])
1912
#---------------------
1913
# loop over module list
1916
if test "x$with_mib_cfg_debug" = "xyes"; then
1924
if test ! -d mk ; then
1929
module_rules=mk/module_rules.mk
1930
echo "# contents below built automatically by configure; do not edit by hand" > $module_rules
1933
# make file sub-pieces
1935
for i in module_list_deps mib_module_list_deps agent_module_list_deps ; do
1936
eval "$i=mk/${i}.mk"
1937
echo "# contents below built automatically by configure; do not edit by hand" > mk/${i}.mk
1941
# variable settings sub-pieces
1943
for i in module_list_code mib_module_list_code agent_module_list_code module_list mib_module_list agent_module_list ; do
1944
eval "$i=mk/${i}.mk"
1945
echo "# contents below built automatically by configure; do not edit by hand" > mk/${i}.mk
1946
echo "$i= \\" >> mk/${i}.mk
1949
echo $ECHO_N "echo " $ECHO_C > mk/MODULE_LIST.mk
1950
MODULE_LIST=mk/MODULE_LIST.mk
1953
#---------------------
1954
# until we have an empty module list...
1955
# (modules may add new modules, and until all dependencies are done...)
1957
while test "x$new_module_list" != "x"; do
1958
AC_MSG_MODULE_DBG(-e,"\n****************************************************************")
1959
AC_MSG_MODULE_DBG("nml: $new_module_list")
1961
#---------------------
1962
# loop over all the modules in the current list
1964
for j in $new_module_list
1967
#---------------------
1968
# figure out which sub-blocks to build in parts
1969
if echo "$j" | grep "=" ; then
1970
# build a shared object file
1971
# format: sofilename=module1:module2
1972
# XXX: currently doesn't do this
1973
dl_name=`echo $j | sed 's/=.*//'`
1974
dl_names="$dl_names $dl_name"
1975
dl_objects=`echo $j | sed 's/.*=//'`
1976
module_sublist=`echo $dl_objects | sed 's/:/ /g'`
1978
saved_sublist_code=""
1981
# create output files
1982
# these actually get nuked later
1983
output_inits="agent/mibgroup/${dl_name}-dll.c"
1984
output_hdrs="agent/mibgroup/${dl_name}-hdrs.h"
1986
# not a special token invocation
1992
while test "x$module_sublist" != "x" ; do
1994
#---------------------
1995
# loop over all the modules in the sub list
1996
for i in $module_sublist
1999
AC_MSG_MODULE_DBG(-e "\n================================================================")
2000
AC_MSG_MODULE_DBG("testing $i")
2003
#---------------------
2004
# build a pseudo include header that includes current config and
2006
AC_LANG_CONFTEST(AC_LANG_SOURCE([[
2007
#include NETSNMP_SYSTEM_INCLUDE_FILE
2008
#include "$srcdir/$mibdir/$i.h"]]))
2009
mv conftest.$ac_ext module_tmp_header.h
2011
#---------------------
2012
# macro: config_belongs_in(ARG)
2014
# - mib_module => libnetsnmpmibs (default)
2015
# - agent_module => libnetsnmpagent
2017
module_type=mib_module
2018
if test -f $srcdir/$mibdir/$i.h; then
2020
module_type=`$MODULECPP module_tmp_header.h | grep config_belongs_in | sed 's@.*config_belongs_in(\([^)]*\)).*@\1@'`
2023
if test "x$module_type" = "x" ; then
2024
module_type=mib_module
2026
if test "x$output_to" = "xnormal" ; then
2027
output_inits="$mibdir/${module_type}_inits.h"
2028
output_hdrs="$mibdir/${module_type}_includes.h"
2031
#--------------------
2032
# check for duplicates within the dll system.
2033
# - if found in a dll, then remove from the dll and add to main
2035
for dltest in $dl_names ; do
2036
eval mod_files="\"\$dl_${dltest}_files\""
2037
if echo " $mod_files " | grep " $i " > /dev/null; then
2038
# some dll module has already seen this, unload it from that list
2039
# and include it in the core (again)
2040
AC_MSG_MODULE_DBG("removing $i from $dltest")
2041
mod_files=`echo " $mod_files " | sed "s@ $i @@"`
2043
eval "dl_${dltest}_files=\"$mod_files\""
2045
module_list="$module_list $i"
2046
echo "read_config.lo: mibgroup/$i.h" >> $module_list_deps
2047
if test $module_type = "agent_module" ; then
2048
echo "snmp_vars.lo: mibgroup/$i.h" >> $agent_module_list_deps
2050
echo "mib_modules.lo: mibgroup/$i.h" >> $mib_module_list_deps
2052
eval ${module_type}_list="\"\$${module_type}_list $i\""
2053
echo " $i \\" >> $module_list_code
2054
echo $ECHO_N " $i" $ECHO_C >> $MODULE_LIST
2055
eval tmpfilevar=\$`echo ${module_type}_list_code`
2056
echo " $i \\" >> $tmpfilevar
2058
# XXX: add this to the main init list; this is possible not
2059
# quite in the right spot any longer but we're stuck with it.
2060
# Adding it back to the original ordered spot would be a
2061
# nightmare. Ok, we're already in nightmare code so that
2062
# wolud have to be a night-terror.
2063
mnm=`echo $i | sed 's/.*\///;s/\.c$//;'`
2064
output_inits_tmp="$mibdir/${module_type}_inits.h"
2065
echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits_tmp
2066
# XXX: even worse, we loose whether the header is needed or not.
2067
output_hdrs_tmp="$mibdir/${module_type}_includes.h"
2068
echo '#include "'"mibgroup/$i.h"'"' >> $output_hdrs_tmp
2072
#---------------------
2073
# make sure module wasn't explicitly excluded, or already added
2075
if test "x$dblfix" != "x" ; then
2076
AC_MSG_MODULE_DBG("$i was duplicated -- putting into main")
2077
elif echo " $new_with_out_mib_modules " | grep " $i " > /dev/null; then
2078
AC_MSG_MODULE_DBG("$i was excluded")
2079
elif echo " $module_list " | grep " $i " > /dev/null; then
2080
AC_MSG_MODULE_DBG("$i already tested")
2083
#---------------------
2084
# process modules header, checking for config_ pseudo-macros
2087
#---------------------
2088
# does the header file for the module exist?
2089
# macros are only processed if it does
2090
if test -f $srcdir/$mibdir/$i.h; then
2093
#---------------------
2094
# macro: config_exclude(modules)
2095
# - lists conflicts with other modules
2096
# - EG: new MIB implementations exclude old and vice-versa
2098
# check if $i has any conflicts
2100
new_list_excl=`$MODULECPP module_tmp_header.h | grep config_exclude | sed 's/.*config_exclude(\(.*\)).*/\1/'`
2101
if test "x$new_list_excl" != "x"; then
2102
AC_MSG_MODULE_DBG("$i excludes $new_list_excl")
2103
for j in $new_list_excl
2105
if echo " $module_list $new_mib_module_list $new_list_two " | grep " $j " > /dev/null; then
2106
mib_cfg_msg="mib module '$i' excludes module '$j' but another module requires it"
2107
AC_MSG_WARN([mib module error])
2108
if test "x$with_mib_cfg_checks" = "xyes"; then
2109
AC_MSG_ERROR([$mib_cfg_msg])
2111
AC_MSG_WARN([$mib_cfg_msg])
2112
AC_MSG_CACHE_ADD([*** MIB Module warning *** $mib_cfg_msg])
2115
new_with_out_mib_modules="$j $new_with_out_mib_modules"
2116
AC_MSG_MODULE_DBG("$j added to excluded list")
2121
#---------------------
2122
# macro: config_arch_require(ARCH,modules)
2123
# - lists modules required for a given ARCH
2125
# check if $i has any architecture specific requirements
2128
new_list_arch=`$MODULECPP module_tmp_header.h | grep config_arch_require | sed 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/'`
2130
if test "x$new_list_arch" != "x"; then
2131
for j in $new_list_arch
2133
archtest=`echo $j | sed 's/-xarchx-.*//'`
2134
# target_os may have been changed to a #define of 1...
2135
if test "x$archtest" = "x1" -o "x$target_os" = "x$archtest" -o "x$PARTIALTARGETOS" = "x$archtest"; then
2136
new_list="$new_list `echo $j | sed 's/.*-xarchx-//'`"
2137
AC_MSG_MODULE_DBG(" $i required adding arch files: `echo $j | sed 's/.*-xarchx-//'`")
2141
AC_MSG_MODULE_DBG(" $i required arch files: $new_list")
2143
#---------------------
2144
# macro: config_require(modules)
2145
# - lists modules required for this module
2147
# check if $i has any other required modules
2149
new_list="$new_list `$MODULECPP module_tmp_header.h | grep config_require | sed 's/.*config_require(\(.*\)).*/\1/'`"
2150
AC_MSG_MODULE_DBG(" $i will test: $new_list")
2151
if test "x$new_list" != "x"; then
2154
AC_MSG_MODULE_DBG(-n " $i wants to add $j: ")
2155
if test ! -f $srcdir/$mibdir/$j.h -a ! -f $srcdir/$mibdir/$j.c; then
2156
AC_MSG_WARN([mib module error])
2157
AC_MSG_ERROR([mib module "$i" requires module "$j" but $j.h or $j.c could not be found in $srcdir/$mibdir])
2158
elif echo " $new_with_out_mib_modules " | grep " $j " > /dev/null; then
2159
if test "x$i" != "xdefault_modules" ; then
2160
mib_cfg_msg="mib module '$i' requires module '$j' but someone told me to compile without it"
2161
AC_MSG_WARN([mib module error])
2162
if test "x$with_mib_cfg_checks" = "xyes"; then
2163
AC_MSG_ERROR([$mib_cfg_msg])
2165
AC_MSG_WARN([$mib_cfg_msg])
2166
AC_MSG_CACHE_ADD([*** MIB Module warning *** $mib_cfg_msg])
2168
# elif echo " $module_list $new_list_two $new_module_list " | grep " $j " > /dev/null; then
2169
# AC_MSG_MODULE_DBG(" $j included previously")
2172
new_list_two="$new_list_two $j"
2173
AC_MSG_MODULE_DBG(" $j included")
2178
#---------------------
2179
# macro: config_add_mib(SOME-MIB)
2180
# - lists MIBs to be added to the default to-load list.
2182
# check if $i has any mibs to add
2184
new_mibs=`$MODULECPP module_tmp_header.h | grep config_add_mib | sed 's/.*config_add_mib(\(.*\)).*/\1/'`
2185
if test "x$new_mibs" != "x"; then
2188
if test "x`echo :$default_mibs: | grep :$j:`" = "x"; then
2189
default_mibs="$default_mibs:$j"
2191
if test -f $srcdir/mibs/$j.txt; then
2192
if echo $default_mibs_install | grep " $j " > /dev/null; then
2195
default_mibs_install="$default_mibs_install $j.txt"
2201
#-------------------
2202
# add the current module to the list of stuff to compile, etc.
2204
# add $i to module list
2206
AC_MSG_MODULE_DBG(" $i added (based on $i.h)")
2207
module_list="$module_list $i"
2208
eval ${module_type}_list="\"\$${module_type}_list $i\""
2210
echo "read_config.lo: mibgroup/$i.h" >> $module_list_deps
2211
if test $module_type = "agent_module" ; then
2212
echo "snmp_vars.lo: mibgroup/$i.h" >> $agent_module_list_deps
2214
echo "mib_modules.lo: mibgroup/$i.h" >> $mib_module_list_deps
2217
#-------------------
2218
# check for unsupported config_load_mib
2220
if $MODULECPP module_tmp_header.h | grep config_load_mib > /dev/null 2>&1; then
2221
AC_MSG_WARN([mib module error])
2222
AC_MSG_WARN([mib module "$i" uses the "config_load_mib" directive, which is no longer supported. It probably won't work.])
2223
fi # grep config_load_mib
2225
#-------------------
2226
# check for config_parse_dot_conf
2227
# (generally not used any longer; old auto-load a .conf token)
2230
$MODULECPP module_tmp_header.h | grep config_parse_dot_conf | sed 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@' >> $mibdir/mib_module_dot_conf.h
2233
#---------------------
2234
# macro: config_error(error text)
2235
# - used to signal a configuration error from a module
2237
# check if $i has any errors, or warnings
2239
error=`$MODULECPP module_tmp_header.h | grep config_error | sed 's/.*config_error(\(.*\)).*/\1/'`
2240
if test "x$error" != "x"; then
2243
AC_MSG_ERROR([$i: *** $error ***])
2246
#---------------------
2247
# macro: config_warning(warning text)
2248
# - used to signal a configuration "warning" to be printed to the user
2250
warning=`$MODULECPP module_tmp_header.h | grep config_warning | sed 's/.*config_warning(\(.*\)).*/\1/'`
2251
if test "x$warning" != "x"; then
2252
all_warnings="$all_warnings $warning
2256
#---------------------
2257
# Check for a .c file if the .h didn't exist
2259
elif test -f $srcdir/$mibdir/$i.c; then
2260
if echo " $module_list $new_list_two $new_module_list " | grep " $i " > /dev/null; then
2261
AC_MSG_MODULE_DBG(" $i already included")
2263
AC_MSG_MODULE_DBG(" $i added (based on $i.c)")
2264
module_list="$module_list $i"
2265
mib_module_list="$mib_module_list $i"
2268
#---------------------
2269
# No .h or .c = error! (typo?)
2271
else # no $i.h or $i.c
2272
AC_MSG_WARN([mib module error])
2273
AC_MSG_ERROR([module files $i.h or $i.c could not be found in $srcdir/$mibdir])
2276
#-------------------
2277
# check for init/shutdown routines too
2280
if test -f $srcdir/$mibdir/$i.c; then
2281
if test "x$output_to" = "xnormal" ; then
2282
echo " $i \\" >> $module_list_code
2283
echo $ECHO_N " $i" $ECHO_C >> $MODULE_LIST
2284
eval tmpfilevar=\$`echo ${module_type}_list_code`
2285
echo " $i \\" >> $tmpfilevar
2287
eval "dl_${dl_name}_files=\"\$dl_${dl_name}_files $i\""
2288
saved_sublist_code="$saved_sublist_code $i"
2290
mnm=`echo $i | sed 's/.*\///;s/\.c$//;'`
2291
AC_MSG_MODULE_DBG(-e "\nchecking '$srcdir/$mibdir/$i.c' ($mnm/`basename $i`) C file for init/shutdown")
2292
if test "x$mnm" != "x`basename $i`"; then
2293
AC_MSG_WARN([mib module error])
2294
AC_MSG_ERROR([conflicting names: $mnm != `basename $i`])
2296
temp_init=`grep init_$mnm $srcdir/$mibdir/$i.c | grep -v _init_$mnm`
2297
if test "x$temp_init" != "x"; then
2298
AC_MSG_MODULE_DBG(-e "adding init_$mnm() to list")
2300
echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits
2302
grep shutdown_$mnm $srcdir/$mibdir/$i.c > /dev/null
2303
if test $? -eq 0 ; then
2304
if test $module_debug -eq 1; then
2305
echo -e "\nadding shutdown_$mnm() to list"
2308
echo " if (should_init(\"$mnm\")) shutdown_$mnm();" >> $mibdir/${module_type}_shutdown.h
2310
fi # test -f $srcdir/$mibdir/$i.c
2312
#-------------------
2313
# if there is a shutdown/init list,
2315
if test $need_header -eq 1 ; then
2316
echo '#include "'"mibgroup/$i.h"'"' >> $output_hdrs
2318
echo '/*#include "'"mibgroup/$i.h"'"*/' >> $output_hdrs
2321
#-------------------
2322
# check for output directory (for building outside of source tree
2325
if test "x`echo $i | sed 's/\///g;'`" != "x$i"; then
2326
mnd=`echo $i | sed 's/\/[^/]*$//;'`
2327
if test ! -d ./$mibdir/$mnd; then
2328
module_directories="$module_directories ./$mibdir/$mnd"
2330
fi # module directory test
2333
#-------------------
2334
# define USING_*_MODULE
2337
sym="`echo ${i} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
2339
echo "/* Define if compiling with the ${i} module files. */" >> include/net-snmp/agent/${module_type}_config.h
2340
echo "#define USING_${sym}_MODULE 1" >> include/net-snmp/agent/${module_type}_config.h
2341
echo " " >> include/net-snmp/agent/${module_type}_config.h
2343
#-------------------
2344
echo $ECHO_N " $i$ECHO_C"
2346
done # for i in $module_sublist
2348
if test "$output_to" = "separate" ; then
2349
if test "x$new_list_two" = "x" ; then
2350
# no new sub-modules to add to the current target
2353
dllcleans="$saved_sublist_o $dllcleans"
2357
# a module had sub-modules required; keep goin'
2358
saved_sublist="$saved_sublist $module_sublist"
2359
module_sublist="$new_list_two"
2366
done # while module_sublist
2367
done # for j in $new_module_list
2369
# remember the top level modules for later reporting
2370
if test $first_pass = 1 ; then
2371
# remember this list for later reporting
2372
top_level_modules="$new_module_list => $new_list_two"
2375
#-------------------
2376
# if $i added new modules vis config_*,
2377
# check those modules for requirements too
2379
# transfer the new module to check list to the normal variable
2381
if test "x$new_list_two" ; then
2384
new_module_list="$new_list_two"
2386
done # while test "x$new_module_list" != "x"; do
2389
#--------------------
2390
# construct the dll code files and make rules. This can't be done
2391
# until now because dulpicate use of a module means it gets removed
2392
# from the dll and put into the main agent.
2394
for i in $dl_names ; do
2395
eval mod_files="\"\$dl_${i}_files\""
2396
echo "components in the $i dll: $mod_files"
2398
output_inits="agent/mibgroup/${i}-dll.c"
2399
output_hdrs="agent/mibgroup/${i}-hdrs.h"
2401
AC_MSG_MODULE_DBG("creating dll file: $output_inits")
2402
for ofile in $output_inits $output_hdrs ; do
2403
if test -f $ofile ; then
2404
if grep "this file created automatically by configure" $ofile > /dev/null 2>&1 ; then
2407
AC_MSG_ERROR([$ofile already existed ; can't build dll object $i])
2410
cat > $ofile << EOFIF
2411
/* xDo not edit; this file created automatically by configure */
2415
cat >> $output_inits << EOFOC
2416
#include <net-snmp/net-snmp-config.h>
2417
#include <net-snmp/net-snmp-includes.h>
2418
#include <net-snmp/agent/net-snmp-agent-includes.h>
2419
#include "${i}-hdrs.h"
2424
# create the .so rule
2425
saved_sublist_o=`echo "$mod_files " | sed 's/^ *//g;s/ */.o /g;'`
2427
# create the rules for each object
2428
for j in $mod_files ; do
2429
cat >> $module_rules << EOFR
2431
\$(CC) -c \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ \$<
2434
mnm=`echo $j | sed 's/.*\///;s/\.c$//;'`
2435
echo " if (should_init(\"$mnm\")) init_$mnm();" >> $output_inits
2438
# create the rule for the .so and wrapper code
2439
cat >> $module_rules << EOFM
2440
${i}-dll.o: ${i}-dll.c
2441
\$(CC) -c \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ \$<
2443
${i}.so: $saved_sublist_o ${i}-dll.o
2444
\$(CC) \$(CPPFLAGS) \$(CFLAGS) \$(DLFLAGS) -o \$@ $saved_sublist_o ${i}-dll.o
2447
cat >> $output_inits << EOFOCFIN
2454
rm -f module_tmp_header.h
2456
#-------------------
2457
# build module lists for Makefiles
2461
for i in module_list_o module_list_c module_list_lo mib_module_list_o mib_module_list_c mib_module_list_lo mibgroup_list_o mibgroup_list_lo agent_module_list_o agent_module_list_c agent_module_list_lo agentgroup_list_o agentgroup_list_lo ; do
2462
eval "$i=mk/${i}.mk"
2465
sed 's/^module_list_code/module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $module_list_code > $module_list_o
2466
sed 's/^module_list_code/module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $module_list_code > $module_list_c
2467
sed 's/^module_list_code/module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $module_list_code > $module_list_lo
2469
sed 's/^mib_module_list_code/mib_module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $mib_module_list_code > $mib_module_list_o
2470
sed 's/^mib_module_list_code/mib_module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $mib_module_list_code > $mib_module_list_c
2471
sed 's/^mib_module_list_code/mib_module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $mib_module_list_code > $mib_module_list_lo
2473
sed 's/^mib_module_list_o/mibgroup_list_o/;s@\([^ ]*\)\.o@mibgroup/\1.o@g' < $mib_module_list_o > $mibgroup_list_o
2474
sed 's/^mib_module_list_lo/mibgroup_list_lo/;s@\([^ ]*\)\.lo@mibgroup/\1.lo@g' < $mib_module_list_lo > $mibgroup_list_lo
2476
sed 's/^agent_module_list_code/agent_module_list_o/;s/\([^=]\) *\\/\1.o \\/g' < $agent_module_list_code > $agent_module_list_o
2477
sed 's/^agent_module_list_code/agent_module_list_c/;s/\([^=]\) *\\/\1.c \\/g' < $agent_module_list_code > $agent_module_list_c
2478
sed 's/^agent_module_list_code/agent_module_list_lo/;s/\([^=]\) *\\/\1.lo \\/g' < $agent_module_list_code > $agent_module_list_lo
2480
sed 's/^agent_module_list_o/agentgroup_list_o/;s@\([^ ]*\)\.o@mibgroup/\1.o@g' < $agent_module_list_o > $agentgroup_list_o
2481
sed 's/^agent_module_list_lo/agentgroup_list_lo/;s@\([^ ]*\)\.lo@mibgroup/\1.lo@g' < $agent_module_list_lo > $agentgroup_list_lo
2483
for i in module_list_o module_list_c module_list_lo mib_module_list_o mib_module_list_c mib_module_list_lo mibgroup_list_o mibgroup_list_lo agent_module_list_o agent_module_list_c agent_module_list_lo agentgroup_list_o agentgroup_list_lo ; do
2484
# hpux make (at least) doesn't like a trailing \ on the last
2485
# line even when the next line contains nothing but
2487
lasttoken=`tail -1 mk/$i.mk | awk '{print $1}'`
2488
sed "s#$lasttoken \\\\#$lasttoken#" < mk/$i.mk > mk/$i.mk.tmp
2489
mv mk/$i.mk.tmp mk/$i.mk
2491
# add a closing comment
2493
echo "# end configure generated code" >> mk/$i.mk
2498
if test $module_debug -eq 1; then
2499
echo -e "\nFinal module list: $module_list_code"
2502
if test "x$with_mib_cfg_checks" = "xyes"; then
2503
AC_MSG_CACHE_ADD([Agent Module list: $module_list_code])
2505
AC_SUBST_FILE(MODULE_LIST)
2506
AC_SUBST_FILE(module_list_c)
2507
AC_SUBST_FILE(module_list_o)
2508
AC_SUBST_FILE(module_list_lo)
2509
AC_SUBST_FILE(mib_module_list_c)
2510
AC_SUBST_FILE(mib_module_list_o)
2511
AC_SUBST_FILE(mib_module_list_lo)
2512
AC_SUBST_FILE(agent_module_list_c)
2513
AC_SUBST_FILE(agent_module_list_o)
2514
AC_SUBST_FILE(agent_module_list_lo)
2515
AC_SUBST_FILE(mibgroup_list_o)
2516
AC_SUBST_FILE(mibgroup_list_lo)
2517
AC_SUBST_FILE(agentgroup_list_o)
2518
AC_SUBST_FILE(agentgroup_list_lo)
2519
AC_SUBST_FILE(agent_module_list)
2521
#AC_SUBST_FILE(mib_module_list)
2522
#AC_SUBST(module_list)
2523
AC_SUBST(default_mibs_install)
2525
AC_SUBST_FILE(module_rules)
2526
AC_SUBST_FILE(module_list_deps)
2527
AC_SUBST_FILE(mib_module_list_deps)
2528
AC_SUBST_FILE(agent_module_list_deps)
2532
if test $module_debug -eq 1; then
2533
AC_MSG_CACHE_ADD(Agent MIB code: $module_list)
2535
AC_MSG_CACHE_ADD(Agent MIB code: $top_level_modules)
2537
# end hairy agent module processing
2539
AC_MSG_CHECKING([if directories need to be created])
2540
for i in $module_directories; do
2541
$srcdir/mkinstalldirs $i
2545
#-------------------
2546
# Define default mibs
2548
AC_MSG_CHECKING([default mib files to read])
2549
if test "x$NETSNMP_DEFAULT_MIBS" = "x"; then
2550
NETSNMP_DEFAULT_MIBS="$default_mibs"
2552
if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" -o "x$PARTIALTARGETOS" = "xcygwin"; then
2553
# mingw32 and cygwin use ';' as the environment variable separator char
2555
NETSNMP_DEFAULT_MIBS=`echo "$NETSNMP_DEFAULT_MIBS" | sed 's/:/;/g'`
2556
default_mibs=`echo "$default_mibs" | sed 's/:/;/g'`
2560
AC_SUBST(ENV_SEPARATOR)
2561
AC_DEFINE_UNQUOTED(NETSNMP_DEFAULT_MIBS,"$NETSNMP_DEFAULT_MIBS")
2562
AC_SUBST(NETSNMP_DEFAULT_MIBS)
2563
AC_MSG_RESULT($NETSNMP_DEFAULT_MIBS)
2565
AC_MSG_CHECKING([whether we have to build PIC code])
2566
echo " $module_list " | grep " ucd-snmp/dlmod " >/dev/null
2567
if test $? -eq 0 ; then
2568
LIB_CFLAGS="$LIB_CFLAGS $SHLIB_CFLAGS"
2576
# Check for kernel location
2579
AC_CACHE_CHECK(for location of system kernel,ac_cv_KERNEL_LOC,
2580
[ac_cv_KERNEL_LOC="unknown"
2581
# First determine if test expects a -f or a -c (character device (SYSV))
2583
if test -c /dev/null; then
2585
elif test -f /dev/null; then
2591
for i in /vmunix /hp-ux /stand/vmunix /dev/ksyms /kernel/unix /kernel/genunix /netbsd /unix /kernel /bsd /mach_kernel /boot/kernel/kernel
2593
if test -f $i -o $CFLAG $i; then
2594
ac_cv_KERNEL_LOC="$i"
2598
if test $i = "unknown"; then
2599
AC_MSG_WARN([Can't find system kernel... Setting to /vmunix])
2600
ac_cv_KERNEL_LOC="/vmunix"
2604
AC_DEFINE_UNQUOTED(KERNEL_LOC,"$ac_cv_KERNEL_LOC")
2607
# Check for mount table location
2610
AC_CACHE_CHECK(for mount table location,ac_cv_ETC_MNTTAB,
2611
[ac_cv_ETC_MNTTAB="unknown"
2613
[ --with-mnttab=\"/etc/mnttab\" Mount table location.
2614
The default is to autodetect this.],
2615
[ac_cv_ETC_MNTTAB="$with_mnttab"])
2616
if test "$ac_cv_ETC_MNTTAB" = "unknown"; then
2617
for i in /etc/mnttab /etc/mtab /etc/filesystems /dev/mnttab
2619
if test -f $i -o -c $i; then
2620
ac_cv_ETC_MNTTAB="$i"
2627
AC_DEFINE_UNQUOTED(ETC_MNTTAB,"$ac_cv_ETC_MNTTAB")
2629
# Check for /dev/dmem or /dev/drum location
2630
AC_CACHE_CHECK(for location of swap device,ac_cv_DMEM_LOC,
2632
# First determine if test expects a -f or a -c (character device (SYSV))
2634
if test -f /dev/kmem; then
2636
elif test -c /dev/kmem; then
2643
if $CTEST /dev/dmem; then
2644
ac_cv_DMEM_LOC="/dev/dmem"
2645
elif $CTEST /dev/drum; then
2646
ac_cv_DMEM_LOC="/dev/drum"
2648
ac_cv_DMEM_LOC="none"
2652
if test "x$ac_cv_DMEM_LOC" != "xnone"; then
2653
AC_DEFINE_UNQUOTED(DMEM_LOC,"$ac_cv_DMEM_LOC")
2656
# forced efence turned off.
2657
# if test "x$developer" = "xyes" -a "x$use_efence" != "xno"; then
2661
if test "x$use_efence" = "xyes"; then
2662
AC_CHECK_LIB(efence, EF_Exit)
2665
# Checks for libraries.
2666
# AC_CHECK_LIB(des, main)
2667
# AC_CHECK_LIB(m, asin)
2670
[AS_HELP_STRING(--without-elf,[use elf libraries])],,
2671
[AC_ARG_ENABLE(elf,,
2672
[AC_MSG_ERROR([ Invalid option. Use --with-elf/--without-elf instead ])])])
2674
if test "x$with_elf" != "xno"; then
2675
# nlist is needed for uptime on some sytems in the generic library
2676
# add hosts which don't use nlist to the blank first line
2679
irix*) # Check for nlist in mld (irix)
2680
AC_CHECK_LIB(elf, nlist)
2681
AC_CHECK_LIB(elf, nlist64)
2682
AC_CHECK_LIB(mld, nlist)
2685
AC_CHECK_LIB(elf, nlist)
2691
# On some platforms (Irix) libnsl and libsocket should not be used.
2692
AC_CHECK_FUNC(gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME),
2693
AC_CHECK_LIB(nsl, gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME)
2694
LIBS="${LIBS} -lnsl"))
2696
# SCO Unixware 7.1.4 finds gethostbyname() in -lsocket
2697
AC_CHECK_FUNC(gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME),
2698
AC_CHECK_LIB(socket, gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME)
2699
LIBS="${LIBS} -lsocket"))
2702
AC_CHECK_LIB(kstat, kstat_lookup,
2703
AC_DEFINE(HAVE_LIBKSTAT, 1, [Define to 1 if you have the `kstat' library (-lkstat).])
2704
LNETSNMPLIBS="${LNETSNMPLIBS} -lkstat")
2706
# Check for libraries that the agent needs
2707
# saving old libraries
2710
# Check for security related functions
2711
if test "x$tryopenssl" != "xno"; then
2712
if test "x$askedopenssl" != "xyes" -a "x$askedpkcs" = "xyes"; then
2713
AC_CHECK_LIB(pkcs11, C_Initialize, AC_DEFINE(HAVE_LIBPKCS11, 1, [Define to 1 if you have the `pkcs11' library (-lpkcs11).])
2714
LIBPKCS11="-lpkcs11")
2716
if test "x$tryrsaref" != "xno"; then
2717
AC_CHECK_LIB(rsaref, RSAPrivateDecrypt)
2718
AC_CHECK_LIB(RSAglue, RSA_PKCS1_RSAref)
2721
AC_CHECK_LIB(crypto, EVP_md5, AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).])
2722
LIBCRYPTO="-lcrypto")
2723
AC_CHECK_LIB(crypto, AES_cfb128_encrypt,
2724
AC_DEFINE(HAVE_AES_CFB128_ENCRYPT, 1, [Define to 1 if you have the `AES_cfb128_encrypt' function.]))
2726
elif test "x$askedpkcs" = "xyes"; then
2727
AC_CHECK_LIB(pkcs11, C_Initialize, AC_DEFINE(HAVE_LIBPKCS11)
2728
LIBPKCS11="-lpkcs11")
2733
# check for tcp wrapper support
2734
_cppflags="${CPPFLAGS}"
2735
_ldflags="${LDFLAGS}"
2737
AC_ARG_WITH(libwrap,
2738
[ --with-libwrap[=LIBPATH] Compile in libwrap (tcp_wrappers) support.],[
2739
if test "$with_libwrap" != "no"; then
2740
if test "$with_libwrap" != "yes"; then
2741
CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
2742
LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
2746
AC_CHECK_HEADER(tcpd.h, ,
2747
AC_MSG_ERROR([Asked to use libwrap but I couldn't find tcpd.h.]))
2750
AC_MSG_CHECKING([for TCP wrappers library -lwrap])
2751
# XXX: should check for hosts_ctl
2752
AC_TRY_LINK([#include <sys/types.h>
2754
int allow_severity = 0;
2755
int deny_severity = 0;
2756
],[hosts_access((void *)0)],[
2758
AC_MSG_RESULT([yes])
2759
AC_DEFINE(NETSNMP_USE_LIBWRAP)
2760
test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
2761
_wraplibs="$_wraplibs -lwrap"],
2764
# Linux RedHat 6.1 won't link libwrap without libnsl
2765
AC_CHECK_FUNC(yp_get_default_domain, ,
2766
AC_CHECK_LIB(nsl, yp_get_default_domain))
2767
AC_MSG_CHECKING([for TCP wrappers library -lwrap linked with -lnsl])
2768
AC_TRY_LINK([#include <sys/types.h>
2770
int allow_severity = 0;
2771
int deny_severity = 0;
2772
],[hosts_access((void *)0)],
2775
AC_DEFINE(NETSNMP_USE_LIBWRAP)
2776
test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
2777
_wraplibs="$_wraplibs -lwrap -lnsl",
2780
AC_MSG_ERROR(Asked to use libwrap but I couldn't find it.))])
2781
LAGENTLIBS="$_wraplibs"
2782
CPPFLAGS=${_cppflags}
2788
AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
2790
AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
2791
AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
2793
if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
2794
if test "x$with_rpm" = "xyes" ; then
2795
AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
2802
# rpm libraries only needed for the host resources mib software
2803
# installed tables (on linux in particular)
2805
if test "x$with_rpm" != "xno" && \
2806
echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
2807
# ARG. RPM is a real pain.
2808
# FWIW librpm.la, librpmio.la, and libpopt.la have correct dependencies.
2811
# zlib is required for newer versions of rpm
2812
_cppflags="${CPPFLAGS}"
2813
_ldflags="${LDFLAGS}"
2816
[ --with-zlib[=DIR] use libz in DIR],[
2817
if test -d "$withval"; then
2818
CPPFLAGS="${CPPFLAGS} -I$withval/include"
2819
LDFLAGS="${LDFLAGS} -L$withval/lib"
2823
# dunno if this is needed for rpm-4.0.x, earlier probably needs.
2824
AC_CHECK_HEADER(zlib.h,
2825
AC_CHECK_LIB(z, gzread, , CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
2826
CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
2828
# two variants of bzip2 need checking.
2830
[ --with-bzip2[=DIR] use libbz2 in DIR],[
2831
if test -d "$withval"; then
2832
CPPFLAGS="${CPPFLAGS} -I$withval/include"
2833
LDFLAGS="${LDFLAGS} -L$withval/lib"
2835
if test "x$with_bzip2" != "xno"; then
2836
AC_CHECK_LIB(bz2, bzread, [_rpmlibs="$_rpmlibs -lbz2"],
2837
AC_CHECK_LIB(bz2, BZ2_bzread, [_rpmlibs="$_rpmlibs -lbz2"],))
2842
# two variants of db1 need checking.
2843
AC_CHECK_LIB(db1, dbopen, [_rpmlibs="-ldb1 $_rpmlibs"],
2844
AC_CHECK_LIB(db, dbopen, [_rpmlibs="-ldb $_rpmlibs"]))
2846
# two variants of db3 need checking.
2847
AC_CHECK_LIB(db-3.1, db_create, [_rpmlibs="-ldb-3.1 $_rpmlibs"],
2848
AC_CHECK_LIB(db-3.0, db_create, [_rpmlibs="-ldb-3.0 $_rpmlibs"]))
2850
# rpm-3.0.5 and later needs popt.
2851
AC_CHECK_LIB(popt, poptParseArgvString, [_rpmlibs="-lpopt $_rpmlibs"])
2853
# rpm-4.0.x needs rpmio.
2854
AC_CHECK_LIB(rpmio, Fopen, [_rpmlibs="-lrpmio $_rpmlibs"],,$_rpmlibs)
2856
# now check for rpm using the appropriate libraries.
2857
AC_CHECK_LIB(rpm, rpmGetFilesystemList,[
2858
AC_DEFINE(HAVE_LIBRPM)
2859
LMIBLIBS="-lrpm $_rpmlibs $LMIBLIBS"
2860
CFLAGS="$CFLAGS -I/usr/include/rpm"
2862
# rpm-4.0.3 librpmdb actually contains what we need.
2863
AC_CHECK_LIB(rpmdb, rpmdbOpen,[
2864
AC_DEFINE(HAVE_LIBRPM)
2865
LMIBLIBS="-lrpmdb -lrpm $_rpmlibs $LMIBLIBS"
2866
CFLAGS="$CFLAGS -I/usr/include/rpm"
2870
# rpm 4.6 has incompatible API, turn on the legacy one
2871
AC_CHECK_DECL([headerGetEntry],
2873
AC_DEFINE([_RPM_4_4_COMPAT], [], [Define if you have RPM 4.6 or newer to turn on legacy API]),
2874
[[#include <rpm/rpmlib.h>]]
2879
AC_CHECK_LIB(kvm, kvm_read, [_libkvm="-lkvm"])
2880
AC_CHECK_FUNC(kvm_openfiles, AC_DEFINE(HAVE_KVM_OPENFILES, 1, [Define to 1 if you have the `kvm_openfiles' function.]),
2881
AC_CHECK_LIB(kvm, kvm_openfiles, AC_DEFINE(HAVE_KVM_OPENFILES, 1, [Define to 1 if you have the `kvm_openfiles' function.])
2883
AC_CHECK_FUNC(kvm_getprocs, AC_DEFINE(HAVE_KVM_GETPROCS, 1, [Define to 1 if you have the `kvm_getprocs' function.]),
2884
AC_CHECK_LIB(kvm, kvm_getprocs, AC_DEFINE(HAVE_KVM_GETPROCS, 1, [Define to 1 if you have the `kvm_getprocs' function.])
2886
AC_CHECK_FUNC(kvm_getswapinfo, AC_DEFINE(HAVE_KVM_GETSWAPINFO, 1, [Define to 1 if you have the `kvm_getswapinfo' function.]),
2887
AC_CHECK_LIB(kvm, kvm_getswapinfo, AC_DEFINE(HAVE_KVM_GETSWAPINFO, 1, [Define to 1 if you have the `kvm_getswapinfo' function.])
2889
if test "x${_libkvm}" != "x"; then
2890
AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the `kvm' library (-lkvm).])
2891
LAGENTLIBS="$LAGENTLIBS ${_libkvm}"
2894
# DYNAMIC MODULE SUPPORT
2895
AC_CHECK_FUNC(dlopen, AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if you have the `dlopen' function.]),
2896
AC_CHECK_LIB(dl, dlopen, AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if you have the `dlopen' function.])
2897
AC_DEFINE(HAVE_LIBDL, 1, [Define to 1 if you have the `dl' library (-ldl).])
2898
LMIBLIBS="${LMIBLIBS} -ldl"))
2901
AC_CHECK_FUNCS(nlist nlist64 knlist)
2903
# whether we need -ldevstat for diskio MIB
2904
echo " $module_list " | grep " ucd-snmp/diskio " >/dev/null
2905
if test $? -eq 0 ; then
2906
AC_CHECK_FUNC(getdevs, AC_DEFINE(HAVE_GETDEVS),
2907
AC_CHECK_LIB(devstat, getdevs, AC_DEFINE(HAVE_GETDEVS)
2908
LMIBLIBS="${LMIBLIBS} -ldevstat"))
2909
AC_CHECK_FUNC(getdevs, AC_DEFINE(HAVE_DEVSTAT_GETDEVS),
2910
AC_CHECK_LIB(devstat, devstat_getdevs, AC_DEFINE(HAVE_DEVSTAT_GETDEVS)
2911
LMIBLIBS="${LMIBLIBS} -ldevstat"))
2914
# LM-SENSORS-MIB support
2915
echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null
2916
if test $? -eq 0 ; then
2917
AC_MSG_CHECKING([for sensors support])
2920
AC_CHECK_HEADER(picl.h, LMIBLIBS="${LMIBLIBS} -lpicl",)
2921
AC_CHECK_HEADERS(picl.h)
2924
AC_CHECK_HEADER(sensors/sensors.h,,
2925
[AC_MSG_ERROR([asked to use lm_sensors but I couldn't find sensors/sensors.h])])
2926
AC_CHECK_LIB(sensors, sensors_get_detected_chips, [
2927
LMIBLIBS="${LMIBLIBS} -lsensors" ;
2929
[AC_MSG_ERROR([asked to use lm_sensors but I couldn't find -lsensors])])
2934
######################################################################
2936
######################################################################
2939
# test to see if we can attempt to build embedded Perl so far
2941
if test "x$embed_perl" = "xtry" ; then
2942
if test "x$install_perl" = "xno" ; then
2945
if test "x$ac_cv_path_PERLPROG" = "x" -o "x$ac_cv_path_PERLPROG" = "xno" ; then
2953
# Embedded Perl specific stuff
2957
if test "x$install_perl" != "xno" ; then
2958
myperl=$ac_cv_path_PERLPROG
2959
if test $myperl = "no" ; then
2960
if test "x$install_perl" = "xtry" ; then
2963
AC_MSG_ERROR(--enable-embedded-perl requested but no perl executable found)
2968
# test for shared libraries support
2969
if test "x$install_perl" != "xno" ; then
2970
# embedded Perl requires shared libraries
2971
if test "x$enable_shared" != "xyes"; then
2972
if test "x$install_perl" = "xtry" ; then
2975
AC_MSG_ERROR(Perl support requires --enable-shared)
2980
if test "x$install_perl" != "xno" ; then
2981
AC_MSG_CHECKING([if we are in the source tree so we can install Perl modules])
2982
if test "x$srcdir" = "x." -o -d perl/agent/default_store ; then
2983
AC_MSG_RESULT([Yes])
2985
if test "x$install_perl" = "xtry" ; then
2989
AC_MSG_ERROR([Perl modules can not be built outside the source directory])
2994
# check the Perl compiler name
2995
if test "x$install_perl" != "xno" ; then
2999
if test "xenable_perl_cc_checks" != "xno" ; then
3000
AC_MSG_CHECKING([for Perl cc])
3002
PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
3004
if test "x$PERLCC" != "x" ; then
3005
AC_MSG_RESULT([$PERLCC])
3007
if test "x$install_perl" = "xtry" ; then
3010
AC_MSG_ERROR([Could not determine the compiler that was used to build $myperl. Either set the environment variable PERLPROG to a different perl binary or use --without-perl-modules to build without Perl.])
3015
# check the Perl compiler compatibility
3016
if test "x$install_perl" != "xno" ; then
3017
AC_MSG_CHECKING([whether $PERLCC is a GNU C compiler])
3020
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
3024
]])], [perlcc_is_gnu=yes], [perlcc_is_gnu=no])
3025
AC_MSG_RESULT([$perlcc_is_gnu])
3027
if test "x$GCC" = "xyes" -a "x$perlcc_is_gnu" = "xno" ; then
3028
if test "x$install_perl" = "xtry" ; then
3031
AC_MSG_ERROR([This build is using a GNU C compiler ($CC) while Perl has been compiled with a non-GNU (or non-working) compiler ($PERLCC). This likely won't work for building with Perl support. Either specify a different compiler (--with-cc=PATH), disable this check (--disable-perl-cc-checks) or build without Perl (--without-perl-modules).])
3036
# check if they're both gnu
3037
if test "x$install_perl" != "xno" ; then
3038
if test "x$GCC" != "xyes" -a "x$perlcc_is_gnu" = "xyes" ; then
3039
if test "x$install_perl" = "xtry" ; then
3042
AC_MSG_ERROR([This build is using a non-GNU C compiler ($CC) while Perl has been compiled with a GNU compiler ($PERLCC). This likely won't work for building with Perl support. Either specify a different compiler (--with-cc=PATH), disable this check (--disable-perl-cc-checks) or build without Perl (--without-perl-modules).])
3047
# we have enough support for installing the modules at least.
3048
if test "x$install_perl" = "xtry" ; then
3051
if test "x$install_perl" = "xno" ; then
3057
####################
3058
# on to embedding...
3060
# check the compiler flags for illegal tokens
3063
if test "x$embed_perl" != "xno" ; then
3067
AC_MSG_CHECKING([for problematic Perl cc flags on Suns])
3068
if $myperl -V:ccflags | grep LARGEFILE > /dev/null ; then
3069
if test "x$embed_perl" = "xtry" ; then
3072
AC_MSG_ERROR([Perl was compiled with LARGEFILE support which will break Net-SNMP. Either set the environment variable PERLPROG to a different perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
3075
AC_MSG_RESULT([none known])
3086
if test "x$embed_perl" != "xno" ; then
3087
AC_MSG_CHECKING([for Perl CFLAGS])
3088
perlcflags=`$myperl -MExtUtils::Embed -e ccopts`
3089
if test "x$perlcflags" != "x" ; then
3090
AC_MSG_RESULT([$perlcflags])
3091
CFLAGS="$CFLAGS $perlcflags"
3093
if test "x$embed_perl" = "xtry" ; then
3096
AC_MSG_ERROR([Could not determine the C compiler flags that were used to build $myperl. Either set the environment variable PERLPROG to a different Perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
3102
if test "x$embed_perl" != "xno" ; then
3103
AC_MSG_CHECKING([for Perl LDFLAGS])
3104
netsnmp_perlldopts=`$myperl -MExtUtils::Embed -e ldopts`
3105
if test "x$netsnmp_perlldopts" != "x" ; then
3106
AC_MSG_RESULT([$netsnmp_perlldopts])
3108
if test "x$embed_perl" = "xtry" ; then
3111
AC_MSG_ERROR([Could not determine the linker options that were used to build $myperl. Either set the environment variable PERLPROG to a different Perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
3114
if test "x$enable_as_needed" = "xyes" ; then
3115
# link *libraries* with libperl
3116
PERLLDOPTS_FOR_LIBS="$netsnmp_perlldopts"
3117
# Perl ccdlflags (RPATH to libperl, hopefully)
3118
AC_MSG_CHECKING([for Perl CCDLFLAGS])
3120
netsnmp_perlccdlflags=`$myperl -V:ccdlflags | $myperl -n -e 'print $1 '"if (/^\s*ccdlflags='([^']+)';/);"`
3122
AC_MSG_RESULT([$netsnmp_perlccdlflags])
3123
PERLLDOPTS_FOR_APPS="$netsnmp_perlccdlflags"
3125
# link *applications* against libperl
3126
PERLLDOPTS_FOR_APPS="$netsnmp_perlldopts"
3130
# check needed functions
3131
if test "x$embed_perl" != "xno" ; then
3133
LIBS="$LIBS $netsnmp_perlldopts"
3135
# newer perl vs older perl call functions
3136
AC_CHECK_FUNCS(eval_pv)
3138
# sigh: this has a CAPITAL P in Perl, which ends up being the same
3139
# autoconf define as the lower case so we have to treat them *BOTH*
3140
# specially. Wonderful.
3141
AC_CHECK_FUNC(perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_LC))
3142
AC_CHECK_FUNC(Perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_UC))
3147
if test "x$ac_cv_func_perl_eval_pv" != "xyes" -a "x$ac_cv_func_Perl_eval_pv" != "xyes" -a "x$ac_cv_func_eval_pv" != "xyes" ; then
3148
if test "x$embed_perl" = "xtry" ; then
3151
AC_MSG_ERROR([Could not find the eval_pv, perl_eval_pv or Perl_eval_pv functions needed for embedded Perl support. Either set the environment variable PERLPROG to a different perl binary or use --disable-embedded-perl to turn off embedded Perl functionality altogether.])
3154
AC_DEFINE(NETSNMP_EMBEDDED_PERL)
3155
OTHERAGENTLIBOBJS="snmp_perl.o"
3156
OTHERAGENTLIBLOBJS="snmp_perl.lo"
3158
EMBEDPERLINSTALL="embedperlinstall"
3159
EMBEDPERLUNINSTALL="embedperluninstall"
3165
EMBEDPERLUNINSTALL=""
3169
AC_SUBST(EMBEDPERLINSTALL)
3170
AC_SUBST(EMBEDPERLUNINSTALL)
3171
AC_SUBST(PERLLDOPTS_FOR_LIBS)
3172
AC_SUBST(PERLLDOPTS_FOR_APPS)
3174
# embedded Perl results
3175
AC_MSG_CHECKING([for potential embedded Perl support])
3176
if test "x$embed_perl" != "xyes" ; then
3177
AC_MSG_CACHE_ADD(Embedded Perl support: disabled)
3178
AC_MSG_RESULT([disabled])
3180
AC_MSG_CACHE_ADD(Embedded Perl support: enabled)
3181
AC_MSG_RESULT([enabled])
3184
# install Perl module results
3187
PERLUNINSTALLTARGS=""
3188
AC_MSG_CHECKING([if we can install the Perl modules])
3189
if test "x$install_perl" = "xyes" ; then
3190
PERLTARGS="perlmodules"
3191
PERLINSTALLTARGS="perlinstall"
3192
PERLUNINSTALLTARGS="perluninstall"
3193
if test "x$embed_perl" = "xyes" ; then
3194
AC_MSG_CACHE_ADD(SNMP Perl modules: building -- embeddable)
3195
AC_MSG_RESULT([yes -- and embeddable])
3197
AC_MSG_CACHE_ADD(SNMP Perl modules: building -- not embeddable)
3198
AC_MSG_RESULT([yes -- not embeddable])
3202
AC_MSG_CACHE_ADD(SNMP Perl modules: disabled)
3205
AC_SUBST(PERLINSTALLTARGS)
3206
AC_SUBST(PERLUNINSTALLTARGS)
3219
PYTHONINSTALLTARGS=""
3220
PYTHONUNINSTALLTARGS=""
3222
AC_MSG_CHECKING([if we should install the python bindings])
3223
if test "x$install_python" = "xyes" ; then
3224
PYTHONTARGS="pythonmodules"
3225
PYTHONINSTALLTARGS="pythoninstall"
3226
PYTHONUNINSTALLTARGS="pythonuninstall"
3227
PYTHONCLEANTARGS="pythonclean"
3228
AC_MSG_CACHE_ADD(SNMP Python modules: building for $PYTHONPROG)
3229
AC_MSG_RESULT([yes])
3231
AC_MSG_CACHE_ADD(SNMP Python modules: disabled)
3234
AC_SUBST(PYTHONTARGS)
3235
AC_SUBST(PYTHONINSTALLTARGS)
3236
AC_SUBST(PYTHONUNINSTALLTARGS)
3237
AC_SUBST(PYTHONCLEANTARGS)
3238
AC_SUBST(PYTHONARGS)
3242
# Checks for header files.
3246
AC_CHECK_HEADERS(stdarg.h string.h fcntl.h limits.h sys/file.h sys/ioctl.h syslog.h unistd.h sys/dmap.h machine/pte.h xti.h sys/sockio.h sys/socket.h sys/param.h sys/uio.h)
3247
# at least Solaris 9 needs sys/socket.h to compile sys/socketvar.h
3248
AC_CHECK_HEADERS(sys/socketvar.h,,,
3249
AC_INCLUDES_DEFAULT([])
3251
#if HAVE_SYS_SOCKET_H
3252
#include <sys/socket.h>
3255
# at least OpenBSD 3.4 needs sys/param.h (MAXPATHLEN) to compile sys/swap.h
3256
AC_CHECK_HEADERS(sys/swap.h,,,
3257
AC_INCLUDES_DEFAULT([])
3259
#if HAVE_SYS_PARAM_H
3260
#include <sys/param.h>
3263
AC_CHECK_HEADERS(sys/timeout.h sys/un.h fstab.h sys/fs.h mtab.h ufs/fs.h sys/fixpoint.h machine/param.h sys/vm.h vm/vm.h sys/vmmeter.h sys/vmparam.h sys/vmmac.h sys/vmsystm.h sys/time.h sys/times.h sys/statvfs.h sys/vfs.h sys/mnttab.h sys/select.h mntent.h sys/mntent.h kstat.h utsname.h sys/utsname.h sys/cdefs.h getopt.h locale.h pthread.h sys/loadavg.h regex.h linux/tasks.h pwd.h grp.h utmpx.h)
3265
AC_CHECK_HEADERS(arpa/inet.h netinet/in_systm.h netinet/in.h netinet/ip_var.h netinet/tcp.h netinet/tcpip.h netinet/udp.h net/if.h netinet/in_var.h netinet/ip.h netinet/ip_icmp.h net/if_arp.h net/if_mib.h net/if_var.h netinet/if_ether.h netinet/tcp_timer.h netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h netdb.h net/route.h,,,
3267
#if HAVE_SYS_TYPES_H
3268
#include <sys/types.h>
3270
#if HAVE_SYS_TIMEOUT_H
3271
#include <sys/timeout.h>
3273
#if HAVE_SYS_SOCKET_H
3274
#include <sys/socket.h>
3276
#if HAVE_SYS_SOCKETVAR_H
3277
#include <sys/socketvar.h>
3279
#if HAVE_ARPA_INET_H
3280
#include <arpa/inet.h>
3282
#if HAVE_NETINET_IN_SYSTM_H
3283
#include <netinet/in_systm.h>
3285
#if HAVE_NETINET_IN_H
3286
#include <netinet/in.h>
3288
#if HAVE_NETINET_IP_H
3289
#include <netinet/ip.h>
3294
#if HAVE_NETINET_IP_VAR_H
3295
#include <netinet/ip_var.h>
3297
#if HAVE_NETINET_IP_ICMP_H
3298
#include <netinet/ip_icmp.h>
3300
#if HAVE_NETINET_TCP_H
3301
#include <netinet/tcp.h>
3303
#if HAVE_NETINET_UDP_H
3304
#include <netinet/udp.h>
3306
#if HAVE_NETINET_TCP_TIMER_H
3307
#include <netinet/tcp_timer.h>
3311
AC_CHECK_HEADERS(ufs/ufs/dinode.h ufs/ufs/quota.h ufs/ufs/inode.h ufs/ffs/fs.h,,,
3313
#if HAVE_SYS_TYPES_H
3314
#include <sys/types.h>
3316
#if HAVE_UFS_UFS_DINODE_H
3317
#include <ufs/ufs/dinode.h>
3319
#if HAVE_UFS_UFS_QUOTA_H
3320
#include <ufs/ufs/quota.h>
3323
# FreeBSD required headers
3324
AC_CHECK_HEADERS(malloc.h net/if_dl.h sys/sysctl.h stdlib.h net/if_types.h sys/queue.h osreldate.h machine/types.h sys/user.h sys/proc.h sys/mbuf.h sys/mount.h sys/dkstat.h sys/conf.h,,,
3326
#if HAVE_SYS_TYPES_H
3327
#include <sys/types.h>
3329
#if HAVE_SYS_PARAM_H
3330
#include <sys/param.h>
3334
AC_CHECK_HEADERS(netinet/tcp_fsm.h sys/protosw.h nlist.h ioctls.h asm/page.h asm/types.h netipx/ipx.h pci/pci.h)
3336
AC_CHECK_HEADERS(inet/mib2.h)
3337
# NetBSD required headers
3338
AC_CHECK_HEADERS(kvm.h sys/pool.h uvm/uvm_param.h uvm/uvm_extern.h vm/vm_param.h vm/vm_extern.h)
3340
AC_CHECK_HEADERS(vm/swap_pager.h,,,
3347
# requires special hacks to get around various problems on older linux kernels.
3349
AC_CHECK_HEADERS([linux/ethtool.h],,,
3351
#include <linux/types.h>
3352
typedef __u64 u64; /* hack, so we may include kernel's ethtool.h */
3353
typedef __u32 u32; /* ditto */
3354
typedef __u16 u16; /* ditto */
3355
typedef __u8 u8; /* ditto */
3358
AC_CHECK_HEADERS(sys/stat.h)
3359
# BSDi3/IRIX headers
3360
# at least IRIX 6.5 needs _KMEMUSER and sys/types.h (mprot_t) to compile
3362
AC_CHECK_HEADERS(sys/vnode.h,,,
3365
#if HAVE_SYS_TYPES_H
3366
#include <sys/types.h>
3369
# at least IRIX 6.5 needs sys/sema.h (mrlock_t) to compile sys/hashing.h
3370
AC_CHECK_HEADERS(sys/sema.h)
3371
AC_CHECK_HEADERS(sys/hashing.h,,,
3372
AC_INCLUDES_DEFAULT([])
3375
#include <sys/sema.h>
3379
AC_CHECK_HEADERS(sys/tcpipstats.h sys/sysmp.h sys/systeminfo.h sys/sysget.h)
3380
# AIX system configuration
3381
AC_CHECK_HEADERS(sys/systemcfg.h)
3383
AC_CHECK_HEADERS(err.h sys/filio.h sgtty.h)
3384
# AIX needs this for statfs func
3385
AC_CHECK_HEADERS(sys/statfs.h)
3386
# for HostRes (HP-UX at least)
3387
AC_CHECK_HEADERS(sys/dkio.h sys/diskio.h sys/pstat.h linux/hdreg.h pkglocs.h)
3388
# for HostRes (Solaris 2.x at least)
3389
AC_CHECK_HEADERS(pkginfo.h,
3390
AC_CHECK_LIB(adm, pkginfo, AC_DEFINE(HAVE_PKGINFO)
3391
LMIBLIBS="${LMIBLIBS} -ladm"))
3394
aix*) # AIX perfstat library, needed for CPU/memory statistics
3395
AC_CHECK_HEADERS(libperfstat.h,
3396
AC_CHECK_LIB(perfstat, perfstat_cpu_total, AC_DEFINE(HAVE_PERFSTAT)
3397
LMIBLIBS="${LMIBLIBS} -lperfstat"), AC_MSG_ERROR([
3399
*** To monitor CPU/memory values in AIX you need to install
3400
*** libperfstat which can be found in bos.perf
3403
hpux*) # HP-UX agent needs open_mib
3404
AC_CHECK_LIB(nm, open_mib, AC_DEFINE(HAVE_LIBNM)
3405
LMIBLIBS="${LMIBLIBS} -lnm")
3411
# (mingw32 must link winsock explicitly)
3412
AC_CHECK_HEADERS(winsock.h,[
3413
AGENTLIBS="${AGENTLIBS} -liphlpapi"
3416
LIBS="${LIBS} -lregex -lws2_32"
3417
AGENTLIBS="${AGENTLIBS} -lregex -lws2_32"
3423
AC_CHECK_HEADERS(io.h)
3425
AC_CHECK_HEADERS(sys/stream.h)
3427
AC_CHECK_HEADERS(netinet/ip6.h netinet6/in6_var.h netinet6/in6_pcb.h netinet6/ip6_var.h netinet6/tcp6.h netinet6/tcp6_fsm.h netinet6/nd6.h netinet6/tcp6_timer.h netinet6/tcp6_var.h,,,
3429
#if HAVE_SYS_TYPES_H
3430
#include <sys/types.h>
3432
#if HAVE_SYS_QUEUE_H
3433
#include <sys/queue.h>
3435
#if HAVE_NETINET_IN_H
3436
#include <netinet/in.h>
3438
#if HAVE_NETINET_IP6_H
3439
#include <netinet/ip6.h>
3442
# DYNAMIC MODULE SUPPORT
3443
AC_CHECK_HEADERS(dlfcn.h)
3444
# table_array helper support
3445
AC_CHECK_HEADERS(search.h)
3447
# RPM subdirectory path (sigh)
3448
if test "x$with_rpm" != "xno" && \
3449
echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
3450
AC_CHECK_HEADERS(rpm/rpmdb.h)
3453
# OpenBSD 2.6 needs netinet/in.h before netinet/in_pcb.h
3454
AC_MSG_CHECKING([[for netinet/in_pcb.h]])
3455
AC_CACHE_VAL(cv_have_netinet_in_pcb_h,
3457
#include <netinet/in.h>
3458
#include <netinet/in_pcb.h>
3459
], cv_have_netinet_in_pcb_h=yes, cv_have_netinet_in_pcb_h=no)])
3460
AC_MSG_RESULT($cv_have_netinet_in_pcb_h)
3461
if test $cv_have_netinet_in_pcb_h = yes; then
3462
AC_DEFINE(HAVE_NETINET_IN_PCB_H)
3465
# NetBSD needs machine/types.h before sys/disklabel.h
3466
AC_MSG_CHECKING([[for sys/disklabel.h]])
3467
AC_CACHE_VAL(cv_have_sys_disklabel_h,
3469
#include <machine/types.h>
3470
#include <sys/disklabel.h>
3471
], cv_have_sys_disklabel_h=yes, cv_have_sys_disklabel_h=no)])
3472
AC_MSG_RESULT($cv_have_sys_disklabel_h)
3473
if test $cv_have_sys_disklabel_h = yes; then
3474
AC_DEFINE(HAVE_SYS_DISKLABEL_H)
3478
AC_CHECK_HEADERS(openssl/hmac.h openssl/evp.h openssl/aes.h openssl/des.h openssl/dh.h)
3479
AC_CHECK_HEADERS(security/cryptoki.h)
3482
AC_PATH_PROG([LPSTAT_PATH],lpstat)
3483
if test x$LPSTAT_PATH != x; then
3484
AC_DEFINE_UNQUOTED(LPSTAT_PATH,"$LPSTAT_PATH")
3485
AC_DEFINE(HAVE_LPSTAT)
3487
AC_CHECK_FUNCS(cgetnext)
3488
if test -r /etc/printcap; then
3489
AC_DEFINE(HAVE_PRINTCAP)
3492
AC_MSG_CHECKING([for authentication support])
3495
if test "x$ac_cv_lib_pkcs11_C_Initialize" != "xyes" -o "x$ac_cv_header_security_cryptoki_h" != "xyes"; then
3496
if test "x$askedpkcs" = "xyes"; then
3497
AC_MSG_ERROR(Asked to use PKCS11 but I couldn't find it.)
3500
if test "x$askedpkcs" = "xyes"; then
3505
if test "x$ac_cv_lib_crypto_EVP_md5" != "xyes" -o "x$ac_cv_header_openssl_hmac_h" != "xyes" -o "x$ac_cv_header_openssl_hmac_h" != "xyes"; then
3506
if test "x$askedopenssl" = "xyes"; then
3507
AC_MSG_ERROR(Asked to use OpenSSL but I couldn't find it.)
3510
if test "x$askedopenssl" = "xyes"; then
3512
elif test "x$tryopenssl" = "xyes"; then
3513
if test "x$usepkcs" != "xyes"; then
3519
if test "x$useopenssl" != "xno" ; then
3520
authmodes="MD5 SHA1"
3521
if test "x$enable_privacy" != "xno" ; then
3522
if test "x$ac_cv_header_openssl_aes_h" = "xyes" ; then
3528
encrmodes="[disabled]"
3530
AC_DEFINE(NETSNMP_USE_OPENSSL)
3531
LNETSNMPLIBS="$LNETSNMPLIBS $LIBCRYPTO"
3532
AC_MSG_RESULT(OpenSSL Support)
3533
elif test "x$usepkcs" != "xno" ; then
3534
authmodes="MD5 SHA1"
3535
if test "x$enable_privacy" != "xno" ; then
3538
encrmodes="[disabled]"
3540
AC_DEFINE(NETSNMP_USE_PKCS11)
3541
LNETSNMPLIBS="$LNETSNMPLIBS $LIBPKCS11"
3542
AC_MSG_RESULT(PKCS11 Support)
3543
elif test "x$enable_md5" != "xno"; then
3546
AC_DEFINE(NETSNMP_USE_INTERNAL_MD5)
3547
AC_MSG_RESULT(Internal MD5 Support)
3549
if test "x$enable_md5" = "xno"; then
3550
authmodes=`echo $authmodes | sed 's/MD5 *//;'`
3552
AC_SUBST(LNETSNMPLIBS)
3553
AC_SUBST(LAGENTLIBS)
3555
AC_MSG_CACHE_ADD(Authentication support: $authmodes)
3556
AC_MSG_CACHE_ADD(Encryption support: $encrmodes)
3558
if test "x$all_warnings" != "x"; then
3559
AC_MSG_CACHE_ADD(WARNING: $all_warnings)
3562
# Checks for typedefs, structures, and compiler characteristics.
3567
# this should use AC_CHECK_TYPE, but it's broken at least in 2.13-14
3568
# so we do it by hand.
3569
AC_MSG_CHECKING([for socklen_t])
3570
AC_CACHE_VAL(ac_cv_type_$1,
3571
[AC_EGREP_CPP([socklen_t@<:@^a-zA-Z_0-9@:>@],
3572
[#include <sys/types.h>
3577
#ifdef HAVE_SYS_SOCKET_H
3578
#include <sys/socket.h>
3579
#endif], [ac_cv_type_socklen_t=yes], [ac_cv_type_socklen_t=no])])
3581
AC_MSG_RESULT([$ac_cv_type_socklen_t])
3582
if test $ac_cv_type_socklen_t = yes; then
3583
AC_DEFINE(HAVE_SOCKLEN_T)
3586
# AIX keeps in_addr_t in /usr/include/netinet/in.h
3587
AC_MSG_CHECKING([for in_addr_t])
3588
AC_CACHE_VAL(ac_cv_type_$1,
3589
[AC_EGREP_CPP([in_addr_t@<:@^a-zA-Z_0-9@:>@],
3590
[#include <sys/types.h>
3595
#ifdef HAVE_NETINET_IN_H
3596
#include <netinet/in.h>
3597
#endif], [ac_cv_type_in_addr_t=yes], [ac_cv_type_in_addr_t=no])])
3599
AC_MSG_RESULT([$ac_cv_type_in_addr_t])
3600
if test $ac_cv_type_in_addr_t = yes; then
3601
AC_DEFINE(HAVE_IN_ADDR_T)
3604
# Older versions of MinGW do not define ssize_t in sys/types
3605
AC_MSG_CHECKING([for ssize_t])
3606
AC_CACHE_VAL(ac_cv_type_$1,
3607
[AC_EGREP_CPP([ssize_t@<:@^a-zA-Z_0-9@:>@],
3608
[#include <sys/types.h>
3612
#endif], [ac_cv_type_ssize_t=yes], [ac_cv_type_ssize_t=no])])
3614
AC_MSG_RESULT([$ac_cv_type_ssize_t])
3615
if test $ac_cv_type_ssize_t = yes; then
3616
AC_DEFINE(HAVE_SSIZE_T, 1, [Define if type ssize_t is available])
3620
AC_CACHE_CHECK([for correct flags to ps], ac_cv_ps_flags,
3621
[if test "`($PSPROG -e 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3623
elif test "`($PSPROG -el 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3624
ac_cv_ps_flags="-el"
3625
elif test "`($PSPROG acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3626
ac_cv_ps_flags="acx"
3627
elif test "`($PSPROG -acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3628
ac_cv_ps_flags="-acx"
3629
elif test "`($PSPROG -o pid,tt,state,time,ucomm 2>&1) | $EGREP ' ps *$' | awk '{print $NF}'`" = "ps" ; then
3630
ac_cv_ps_flags="-o pid,tt,state,time,ucomm"
3631
elif test "`($PSPROG ax 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3633
elif test "x$PARTIALTARGETOS" = "xcygwin"; then
3635
elif test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
3638
AC_MSG_WARN([Unable to determine valid ps flags... defaulting...])
3639
ac_cv_ps_flags="-acx"
3643
PSCMD="$PSPROG $ac_cv_ps_flags"
3645
AC_DEFINE_UNQUOTED(PSCMD, "$PSPROG $ac_cv_ps_flags")
3647
# Checks for byte order
3648
if test $cross_compiling = yes; then
3649
if test x$with_endianness = xbig; then
3650
AC_DEFINE(WORDS_BIGENDIAN)
3651
elif test -z $with_endianness; then
3652
AC_MSG_ERROR([You are cross-compiling, but you have not specified the target's endianness])
3655
if test $with_endianness; then
3656
AC_MSG_ERROR([Endianness has been specified, but you are not cross-compiling.])
3661
# Checks for library functions.
3663
AC_PROG_GCC_TRADITIONAL
3667
AC_CHECK_FUNCS(setmntent hasmntopt gethostname uname gettimeofday select socket strtol strtoul strlcpy)
3668
AC_CHECK_FUNCS(strchr strtok_r strdup memcpy memmove index bcopy strcasestr regcomp)
3669
AC_CHECK_FUNCS(signal setsid sigset sigblock sighold strerror setenv vsnprintf snprintf)
3670
AC_CHECK_FUNCS(sigaction)
3671
AC_CHECK_FUNCS(random lrand48 rand)
3672
AC_CHECK_FUNCS(execv system fork getpid strncasecmp sigalrm)
3673
AC_CHECK_FUNCS(lseek64 pread64)
3674
if test "x$with_rpm" != "xno" && \
3675
echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
3678
AC_CHECK_FUNCS(rpmGetPath)
3682
AC_CHECK_FUNCS(getloadavg)
3683
AC_CHECK_FUNCS(getaddrinfo getipnodebyname gai_strerror)
3684
# BSDi2 functions differ
3685
AC_CHECK_FUNCS(statvfs statfs)
3686
AC_CHECK_FUNCS(getdtablesize)
3688
AC_CHECK_FUNCS(getfsstat)
3689
AC_CHECK_FUNCS(usleep)
3690
AC_CHECK_FUNCS(setlocale)
3691
AC_CHECK_FUNCS(tcgetattr)
3692
AC_CHECK_FUNCS(if_nameindex if_freenameindex)
3694
AC_CHECK_FUNCS(getpagesize)
3695
AC_CHECK_FUNCS(mkstemp)
3696
AC_CHECK_FUNCS(getpwnam getgrnam setgid setuid setgroups)
3697
# High resolution alarm support
3698
AC_CHECK_FUNCS(setitimer)
3699
# functions to support the clock.
3700
AC_CHECK_FUNCS(mktime stime times sysconf)
3701
# missing from hp-ux
3702
AC_CHECK_FUNCS(if_nametoindex)
3703
# missing from MinGW
3704
AC_CHECK_FUNCS(chown localtime_r)
3706
AC_MSG_CHECKING([[for SIOCGIFADDR in sys/ioctl.h]])
3707
AC_CACHE_VAL(cv_sys_ioctl_h_has_SIOCGIFADDR,
3708
[ AC_EGREP_CPP(xxxyesxxx,
3710
#ifdef HAVE_SYS_IOCTL_H
3711
#include <sys/ioctl.h>
3716
], cv_sys_ioctl_h_has_SIOCGIFADDR=yes, cv_sys_ioctl_h_has_SIOCGIFADDR=no)])
3717
AC_MSG_RESULT($cv_sys_ioctl_h_has_SIOCGIFADDR)
3718
if test $cv_sys_ioctl_h_has_SIOCGIFADDR = yes; then
3719
AC_DEFINE(SYS_IOCTL_H_HAS_SIOCGIFADDR)
3723
AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]])
3724
AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
3726
#ifdef HAVE_SYS_PARAM_H
3727
#include <sys/param.h>
3729
#include <sys/types.h>
3730
#ifdef HAVE_SYS_MOUNT_H
3731
#include <sys/mount.h>
3733
#ifdef HAVE_SYS_FS_TYPES_H
3734
#include <sys/fs_types.h>
3739
/* Ultrix's statfs returns 1 for success,
3740
0 for not mounted, -1 for failure. */
3741
exit (statfs (".", &fsd) != 1);
3743
fu_cv_sys_stat_fs_data=yes,
3744
fu_cv_sys_stat_fs_data=no,
3745
fu_cv_sys_stat_fs_data=no)])
3746
AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
3747
if test $fu_cv_sys_stat_fs_data = yes; then
3748
AC_DEFINE(STAT_STATFS_FS_DATA)
3751
# check if compiler pre-processor defines __FUNCTION__
3752
AC_CACHE_CHECK(if __FUNCTION__ is defined,ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED,
3755
char *cp = __FUNCTION__;
3756
], ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED=yes, ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED=no)])
3758
if test "x$ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED" = "xyes"; then
3759
AC_DEFINE(HAVE_CPP_UNDERBAR_FUNCTION_DEFINED)
3762
#--------------------------------------------------------------
3763
# on SCO Unixware 7.1.4 (SCO compiler), "static inline" functions
3764
# are not supported, so this disables the whole inline thing if it
3765
# doesn't work properly. Should have no effect on other platforms.
3766
AC_CACHE_CHECK([[whether static inline functions are broken (Unixware)]],
3767
[netsnmp_cv_c_broken_inline],
3768
AC_COMPILE_IFELSE([[
3769
static inline int nested_inline_function(void) {
3772
inline int main_inline_function( void ) {
3773
return nested_inline_function();
3775
]], netsnmp_cv_broken_inline=no, netsnmp_cv_broken_inline=yes))
3777
# But, sadly, the usage of inline in NET_SNMP disagrees seriously with at least
3778
# solaris2, so disable it for now.
3779
case "$target_os" in
3781
netsnmp_cv_broken_inline=yes
3787
if test "$netsnmp_cv_broken_inline" = yes ; then
3788
AC_DEFINE(NETSNMP_BROKEN_INLINE, 1,
3789
[Define if static inline functions are unsupported])
3792
# openbsd seems to have dropped m_clusters and m_clfree from mbstat
3793
AC_CHECK_STRUCT_FOR([
3795
#include <sys/mbuf.h>
3797
], mbstat, m_clusters, no)
3799
# openbsd seems to have dropped m_mbufs from mbstat too
3800
AC_CHECK_STRUCT_FOR([
3802
#include <sys/mbuf.h>
3804
], mbstat, m_mbufs, no)
3807
AC_CHECK_STRUCT_FOR([
3808
#ifdef HAVE_SYS_PARAM_H
3809
#include <sys/param.h>
3811
#include <sys/types.h>
3812
#include <sys/signal.h>
3813
], sigaction, sa_sigaction, no)
3815
AC_CHECK_STRUCT_FOR([
3816
#include <sys/types.h>
3817
#if TIME_WITH_SYS_TIME
3818
# include <sys/time.h>
3821
# if HAVE_SYS_TIME_H
3822
# include <sys/time.h>
3827
], tm, tm_gmtoff, no)
3829
AC_CHECK_STRUCT_FOR([
3830
#ifdef HAVE_SYS_PARAM_H
3831
#include <sys/param.h>
3833
#include <sys/types.h>
3834
#include <sys/socket.h>
3836
#ifdef HAVE_NET_IF_VAR_H
3837
#include <net/if_var.h>
3841
if test "x$ac_cv_struct_ifnet_has_if_mtu" = "xno"; then
3842
AC_CACHE_CHECK(if _KERNEL needs to be defined for if_mtu, ac_cv_IFNET_NEEDS_KERNEL,
3844
if test "x$ac_cv_struct_ifnet_has_if_mtu" = "xyes"; then
3845
ac_cv_IFNET_NEEDS_KERNEL=no
3849
#ifdef HAVE_SYS_PARAM_H
3850
#include <sys/param.h>
3852
#include <sys/types.h>
3853
#include <sys/socket.h>
3854
#ifdef HAVE_SYS_TIME_H
3855
#include <sys/time.h>
3858
#ifdef HAVE_NET_IF_VAR_H
3859
#include <net/if_var.h>
3862
struct ifnet testit;
3864
], ac_cv_IFNET_NEEDS_KERNEL=yes, ac_cv_IFNET_NEEDS_KERNEL=no)
3868
if test "x$ac_cv_IFNET_NEEDS_KERNEL" = "xyes"; then
3869
AC_DEFINE(IFNET_NEEDS_KERNEL)
3873
AC_CHECK_STRUCT_FOR([
3874
#ifdef HAVE_SYS_PARAM_H
3875
#include <sys/param.h>
3877
#include <sys/types.h>
3878
#ifdef IFNET_NEEDS_KERNEL
3882
#include <sys/socket.h>
3883
], sockaddr, sa_len, no)
3885
AC_CHECK_STRUCT_FOR([
3886
#ifdef HAVE_SYS_PARAM_H
3887
#include <sys/param.h>
3889
#include <sys/types.h>
3890
#ifdef IFNET_NEEDS_KERNEL
3894
#include <sys/socket.h>
3895
], sockaddr, sa_union.sa_generic.sa_family2, no)
3897
AC_CHECK_STRUCT_FOR([
3898
#if HAVE_SYS_PARAM_H
3899
#include <sys/param.h>
3901
#if HAVE_SYS_TYPES_H
3902
#include <sys/types.h>
3904
#if HAVE_SYS_SOCKET_H
3905
#include <sys/socket.h>
3907
], sockaddr_storage, ss_family, no)
3909
AC_CHECK_STRUCT_FOR([
3910
#if HAVE_SYS_PARAM_H
3911
#include <sys/param.h>
3913
#if HAVE_SYS_TYPES_H
3914
#include <sys/types.h>
3916
#if HAVE_SYS_SOCKET_H
3917
#include <sys/socket.h>
3919
], sockaddr_storage, __ss_family, no)
3921
AC_CHECK_STRUCT_FOR([
3922
#ifdef HAVE_SYS_PARAM_H
3923
#include <sys/param.h>
3925
#include <sys/types.h>
3926
#ifdef IFNET_NEEDS_KERNEL
3930
#include <sys/socket.h>
3933
#include <net/route.h>
3934
], rtentry, rt_dst, no)
3936
# checking for 4.3 vs 4.4 rtentry.
3937
AC_CACHE_CHECK(type of rtentry structure,ac_cv_RTENTRY_TYPE,
3942
#ifdef HAVE_SYS_PARAM_H
3943
#include <sys/param.h>
3945
#include <sys/types.h>
3946
#ifdef IFNET_NEEDS_KERNEL
3950
#include <sys/socket.h>
3953
#include <net/route.h>
3956
#ifndef STRUCT_RTENTRY_HAS_RT_DST
3957
#define rt_dst rt_nodes->rn_key
3961
rt.rt_nodes[0].rn_flags = 1;
3963
], ac_cv_RTENTRY_TYPE="BSD-4.4")
3966
if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
3968
#ifdef HAVE_SYS_PARAM_H
3969
#include <sys/param.h>
3971
#include <sys/types.h>
3972
#ifdef IFNET_NEEDS_KERNEL
3976
#include <sys/socket.h>
3979
#include <net/route.h>
3983
], ac_cv_RTENTRY_TYPE="BSD-4.3")
3987
if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
3988
AC_MSG_RESULT(Unknown)
3989
ac_cv_RTENTRY_TYPE="unknown"
3994
if test "x$ac_cv_RTENTRY_TYPE" = "xBSD-4.4"; then
3995
AC_DEFINE(RTENTRY_4_4)
3998
# checking for alpha's ortentry vs rtentry
3999
if test "x$ac_cv_RTENTRY_TYPE" = "xunknown"; then
4000
AC_CACHE_CHECK(for struct rtentry, ac_cv_struct_rtentry,
4001
[AC_EGREP_CPP(ortentry, [#define KERNEL
4002
#include <net/route.h>
4003
], ac_cv_struct_rtentry=ortentry, ac_cv_struct_rtentry=rtentry )
4004
if test "x$ac_cv_struct_rtentry" = "xrtentry" ; then
4005
ac_cv_struct_rtentry="rtentry"
4007
ac_cv_struct_rtentry="ortentry"
4011
RTENTRY_TYPE="rtentry"
4012
ac_cv_struct_rtentry="rtentry"
4015
if test "x$ac_cv_struct_rtentry" != "x"; then
4016
AC_DEFINE_UNQUOTED(RTENTRY,struct ${ac_cv_struct_rtentry})
4018
AC_DEFINE(RTENTRY,struct rtentry)
4021
# check for 4.3's rtentry->rt_next
4022
if test "x$ac_cv_RTENTRY_TYPE" = "xBSD-4.3"; then
4023
AC_CACHE_CHECK(for struct rtentry has a rt_next node,
4024
ac_cv_struct_rtentry_rt_next,
4027
#ifdef HAVE_SYS_PARAM_H
4028
#include <sys/param.h>
4030
#include <sys/types.h>
4031
#ifdef IFNET_NEEDS_KERNEL
4035
#include <sys/socket.h>
4038
#include <net/route.h>
4042
], ac_cv_struct_rtentry_rt_next=yes, ac_cv_struct_rtentry_rt_next=no )
4045
if test "x$ac_cv_struct_rtentry_rt_next" = "xyes"; then
4046
AC_DEFINE(RTENTRY_RT_NEXT)
4051
# Check sin6_scope_id member specified in RFC2553 additionally
4052
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,[
4053
AC_INCLUDES_DEFAULT()
4054
[#ifdef HAVE_SYS_PARAM_H
4055
#include <sys/param.h>
4057
#ifdef HAVE_SYS_SOCKET_H
4058
#include <sys/socket.h>
4060
#ifdef HAVE_NETINET_IN_H
4061
#include <netinet/in.h>
4065
# Check struct rtentry for various things.
4066
AC_CHECK_STRUCT_FOR([
4067
#ifdef HAVE_SYS_PARAM_H
4068
#include <sys/param.h>
4070
#include <sys/types.h>
4071
#ifdef IFNET_NEEDS_KERNEL
4075
#include <sys/socket.h>
4078
#include <net/route.h>
4079
], rtentry, rt_unit)
4081
AC_CHECK_STRUCT_FOR([
4082
#ifdef HAVE_SYS_PARAM_H
4083
#include <sys/param.h>
4085
#include <sys/types.h>
4086
#ifdef IFNET_NEEDS_KERNEL
4090
#include <sys/socket.h>
4093
#include <net/route.h>
4094
], rtentry, rt_refcnt)
4096
AC_CHECK_STRUCT_FOR([
4097
#ifdef HAVE_SYS_PARAM_H
4098
#include <sys/param.h>
4100
#include <sys/types.h>
4101
#ifdef IFNET_NEEDS_KERNEL
4105
#include <sys/socket.h>
4108
#include <net/route.h>
4109
], rtentry, rt_hash)
4111
AC_CHECK_STRUCT_FOR([
4112
#ifdef HAVE_SYS_PARAM_H
4113
#include <sys/param.h>
4115
#include <sys/types.h>
4116
#ifdef IFNET_NEEDS_KERNEL
4120
#include <sys/socket.h>
4123
#include <net/route.h>
4126
# Check tcpstat for tcpstat.tcp_rcvmemdrop
4127
AC_CHECK_STRUCT_FOR([
4128
#ifdef HAVE_SYS_PARAM_H
4129
#include <sys/param.h>
4131
#include <sys/types.h>
4132
#ifdef HAVE_SYS_TIMEOUT_H
4133
#include <sys/timeout.h>
4135
#include <netinet/tcp.h>
4136
#ifdef HAVE_NETINET_TCP_TIMER_H
4137
#include <netinet/tcp_timer.h>
4140
#ifdef HAVE_NETINET_TCP_VAR_H
4141
#include <netinet/tcp_var.h>
4143
], tcpstat, tcp_rcvmemdrop)
4146
AC_CHECK_STRUCT_FOR([
4147
#ifdef IFNET_NEEDS_KERNEL
4150
#ifdef HAVE_SYS_PARAM_H
4151
#include <sys/param.h>
4153
#include <sys/types.h>
4154
#include <sys/socket.h>
4155
#ifdef HAVE_SYS_TIME_H
4156
#include <sys/time.h>
4159
#ifdef HAVE_NET_IF_VAR_H
4160
#include <net/if_var.h>
4162
], ifaddr, ifa_next)
4164
# Check ifnet entries using macro defined in aclocal.m4.
4166
# XXX Broken on FreeBSD where these are #define'd in <net/if.h>
4168
AC_CHECK_IFNET_FOR(if_baudrate)
4169
AC_CHECK_IFNET_FOR(if_baudrate.ifs_value)
4170
AC_CHECK_IFNET_FOR(if_speed)
4171
AC_CHECK_IFNET_FOR(if_type)
4172
AC_CHECK_IFNET_FOR(if_imcasts)
4173
AC_CHECK_IFNET_FOR(if_iqdrops)
4174
AC_CHECK_IFNET_FOR(if_noproto)
4175
AC_CHECK_IFNET_FOR(if_omcasts)
4176
AC_CHECK_IFNET_FOR(if_xname,no)
4177
AC_CHECK_IFNET_FOR(if_lastchange.tv_sec)
4178
AC_CHECK_IFNET_FOR(if_obytes)
4179
AC_CHECK_IFNET_FOR(if_ibytes)
4180
AC_CHECK_IFNET_FOR(if_addrlist)
4181
AC_CHECK_IFNET_FOR(if_addrhead.tqh_first)
4183
AC_CHECK_STRUCT_FOR([
4184
#include <sys/types.h>
4185
#if HAVE_NETINET_IN_H
4186
#include <netinet/in.h>
4188
#if HAVE_NETINET_IP_VAR_H
4189
#include <netinet/ip_var.h>
4191
#if HAVE_NETINET_UDP_H
4192
#include <netinet/udp.h>
4194
#if HAVE_NETINET_UDP_VAR_H
4195
#include <netinet/udp_var.h>
4197
],udpstat,udps_discard)
4199
AC_CHECK_STRUCT_FOR([
4200
#include <sys/types.h>
4201
#if HAVE_NETINET_IN_H
4202
#include <netinet/in.h>
4204
#if HAVE_NETINET_IP_VAR_H
4205
#include <netinet/ip_var.h>
4207
#if HAVE_NETINET_UDP_H
4208
#include <netinet/udp.h>
4210
#if HAVE_NETINET_UDP_VAR_H
4211
#include <netinet/udp_var.h>
4213
],udpstat,udps_noport)
4215
AC_CHECK_STRUCT_FOR([
4216
#include <sys/types.h>
4217
#if HAVE_NETINET_IN_H
4218
#include <netinet/in.h>
4220
#if HAVE_NETINET_IP_VAR_H
4221
#include <netinet/ip_var.h>
4223
#if HAVE_NETINET_UDP_H
4224
#include <netinet/udp.h>
4226
#if HAVE_NETINET_UDP_VAR_H
4227
#include <netinet/udp_var.h>
4229
],udpstat,udps_noportbcast)
4231
AC_CHECK_STRUCT_FOR([
4232
#include <sys/types.h>
4233
#if HAVE_NETINET_IN_H
4234
#include <netinet/in.h>
4236
#if HAVE_NETINET_IP_VAR_H
4237
#include <netinet/ip_var.h>
4239
#if HAVE_NETINET_UDP_H
4240
#include <netinet/udp.h>
4242
#if HAVE_NETINET_UDP_VAR_H
4243
#include <netinet/udp_var.h>
4245
],udpstat,udps_fullsock)
4247
AC_CHECK_STRUCT_FOR([
4248
#ifdef HAVE_SYS_PARAM_H
4249
#include <sys/param.h>
4251
#include <sys/types.h>
4252
#include <sys/socket.h>
4253
#ifdef HAVE_SYS_TIME_H
4254
#include <sys/time.h>
4257
#if HAVE_NETINET_IN_H
4258
#include <netinet/in.h>
4260
#if HAVE_NETINET_IF_ETHER_H
4261
#include <netinet/if_ether.h>
4265
AC_CHECK_STRUCT_FOR([
4266
#if HAVE_SYS_TYPES_H
4267
#include <sys/types.h>
4269
#ifdef HAVE_SYS_PARAM_H
4270
#include <sys/param.h>
4273
#include <sys/conf.h>
4275
],swdevt,sw_nblksenabled)
4277
AC_CHECK_STRUCT_FOR([
4278
#ifdef HAVE_SYS_STAT_H
4279
#include <sys/stat.h>
4281
#if HAVE_SYS_STATFS_H
4282
#include <sys/statfs.h>
4284
#if HAVE_SYS_STATVFS_H
4285
#include <sys/statvfs.h>
4289
AC_CHECK_STRUCT_FOR([
4290
#ifdef HAVE_SYS_STAT_H
4291
#include <sys/stat.h>
4293
#if HAVE_SYS_STATFS_H
4294
#include <sys/statfs.h>
4296
#if HAVE_SYS_STATVFS_H
4297
#include <sys/statvfs.h>
4301
AC_CHECK_STRUCT_FOR([
4302
#ifdef HAVE_SYS_STAT_H
4303
#include <sys/stat.h>
4305
#if HAVE_SYS_STATFS_H
4306
#include <sys/statfs.h>
4308
#if HAVE_SYS_STATVFS_H
4309
#include <sys/statvfs.h>
4313
AC_CHECK_STRUCT_FOR([
4314
#ifdef HAVE_SYS_STAT_H
4315
#include <sys/stat.h>
4317
#if HAVE_SYS_STATFS_H
4318
#include <sys/statfs.h>
4320
#if HAVE_SYS_STATVFS_H
4321
#include <sys/statvfs.h>
4325
AC_CHECK_STRUCT_FOR([
4326
#ifdef HAVE_SYS_STAT_H
4327
#include <sys/stat.h>
4329
#if HAVE_SYS_STATFS_H
4330
#include <sys/statfs.h>
4332
#ifdef HAVE_SYS_PARAM_H
4333
#include <sys/param.h>
4334
#include <sys/types.h>
4336
#ifdef HAVE_SYS_MOUNT_H
4337
#include <sys/mount.h>
4341
AC_CHECK_STRUCT_FOR([
4342
#ifdef HAVE_SYS_STAT_H
4343
#include <sys/stat.h>
4345
#if HAVE_SYS_STATFS_H
4346
#include <sys/statfs.h>
4348
#ifdef HAVE_SYS_PARAM_H
4349
#include <sys/param.h>
4350
#include <sys/types.h>
4352
#ifdef HAVE_SYS_MOUNT_H
4353
#include <sys/mount.h>
4357
AC_CHECK_STRUCT_FOR([
4358
#ifdef HAVE_SYS_STAT_H
4359
#include <sys/stat.h>
4361
#if HAVE_SYS_STATFS_H
4362
#include <sys/statfs.h>
4364
#ifdef HAVE_SYS_PARAM_H
4365
#include <sys/param.h>
4366
#include <sys/types.h>
4368
#ifdef HAVE_SYS_MOUNT_H
4369
#include <sys/mount.h>
4373
AC_CHECK_STRUCT_FOR([
4379
# struct nlist64 (IRIX)
4380
AC_CHECK_STRUCT_FOR([
4381
#if HAVE_SYS_TYPES_H
4382
#include <sys/types.h>
4389
# check struct ipstat for various things
4390
AC_CHECK_STRUCT_FOR([
4391
#include <sys/types.h>
4392
#if HAVE_NETINET_IN_H
4393
#include <netinet/in.h>
4395
#if HAVE_NETINET_IP_VAR_H
4396
#include <netinet/ip_var.h>
4398
], ipstat, ips_cantforward)
4400
AC_CHECK_STRUCT_FOR([
4401
#include <sys/types.h>
4402
#if HAVE_NETINET_IN_H
4403
#include <netinet/in.h>
4405
#if HAVE_NETINET_IP_VAR_H
4406
#include <netinet/ip_var.h>
4408
], ipstat, ips_cantfrag)
4410
AC_CHECK_STRUCT_FOR([
4411
#include <sys/types.h>
4412
#if HAVE_NETINET_IN_H
4413
#include <netinet/in.h>
4415
#if HAVE_NETINET_IP_VAR_H
4416
#include <netinet/ip_var.h>
4418
], ipstat, ips_delivered)
4420
AC_CHECK_STRUCT_FOR([
4421
#include <sys/types.h>
4422
#if HAVE_NETINET_IN_H
4423
#include <netinet/in.h>
4425
#if HAVE_NETINET_IP_VAR_H
4426
#include <netinet/ip_var.h>
4428
], ipstat, ips_fragdropped)
4430
AC_CHECK_STRUCT_FOR([
4431
#include <sys/types.h>
4432
#if HAVE_NETINET_IN_H
4433
#include <netinet/in.h>
4435
#if HAVE_NETINET_IP_VAR_H
4436
#include <netinet/ip_var.h>
4438
], ipstat, ips_fragtimeout)
4440
AC_CHECK_STRUCT_FOR([
4441
#include <sys/types.h>
4442
#if HAVE_NETINET_IN_H
4443
#include <netinet/in.h>
4445
#if HAVE_NETINET_IP_VAR_H
4446
#include <netinet/ip_var.h>
4448
], ipstat, ips_fragmented)
4450
AC_CHECK_STRUCT_FOR([
4451
#include <sys/types.h>
4452
#if HAVE_NETINET_IN_H
4453
#include <netinet/in.h>
4455
#if HAVE_NETINET_IP_VAR_H
4456
#include <netinet/ip_var.h>
4458
], ipstat, ips_localout)
4460
AC_CHECK_STRUCT_FOR([
4461
#include <sys/types.h>
4462
#if HAVE_NETINET_IN_H
4463
#include <netinet/in.h>
4465
#if HAVE_NETINET_IP_VAR_H
4466
#include <netinet/ip_var.h>
4468
], ipstat, ips_noproto)
4470
AC_CHECK_STRUCT_FOR([
4471
#include <sys/types.h>
4472
#if HAVE_NETINET_IN_H
4473
#include <netinet/in.h>
4475
#if HAVE_NETINET_IP_VAR_H
4476
#include <netinet/ip_var.h>
4478
], ipstat, ips_noroute)
4480
AC_CHECK_STRUCT_FOR([
4481
#include <sys/types.h>
4482
#if HAVE_NETINET_IN_H
4483
#include <netinet/in.h>
4485
#if HAVE_NETINET_IP_VAR_H
4486
#include <netinet/ip_var.h>
4488
], ipstat, ips_odropped)
4490
AC_CHECK_STRUCT_FOR([
4491
#include <sys/types.h>
4492
#if HAVE_NETINET_IN_H
4493
#include <netinet/in.h>
4495
#if HAVE_NETINET_IP_VAR_H
4496
#include <netinet/ip_var.h>
4498
], ipstat, ips_ofragments)
4500
AC_CHECK_STRUCT_FOR([
4501
#include <sys/types.h>
4502
#if HAVE_NETINET_IN_H
4503
#include <netinet/in.h>
4505
#if HAVE_NETINET_IP_VAR_H
4506
#include <netinet/ip_var.h>
4508
], ipstat, ips_reassembled)
4510
# check for the des_ks_struct.weak_key attribute, which indicates the
4511
# older openssl version is being used.
4512
if test "x$ac_cv_header_openssl_des_h" = "xyes" ; then
4513
AC_CHECK_STRUCT_FOR([
4514
#include <openssl/des.h>
4515
], des_ks_struct, weak_key)
4518
# attempt to figure out if sysctl is usable
4520
if test $cross_compiling = yes; then
4521
AC_MSG_WARN([Can't check sysctl, manually define NETSNMP_CAN_USE_SYSCTL if platform support available])
4523
AC_CACHE_CHECK(if sysctl can read kernel information,ac_cv_NETSNMP_CAN_USE_SYSCTL,
4525
#if TIME_WITH_SYS_TIME
4526
# include <sys/time.h>
4529
# if HAVE_SYS_TIME_H
4530
# include <sys/time.h>
4535
#if HAVE_SYS_PARAM_H
4536
# include <sys/param.h>
4538
#include <sys/types.h>
4539
#if HAVE_SYS_SYSCTL_H
4540
# include <sys/sysctl.h>
4546
struct timeval boottime;
4549
mib[1] = KERN_BOOTTIME;
4551
len = sizeof(boottime);
4552
sysctl(mib, 2, &boottime, &len, NULL, NULL);
4553
if (boottime.tv_sec != 0)
4558
], ac_cv_NETSNMP_CAN_USE_SYSCTL=yes, ac_cv_NETSNMP_CAN_USE_SYSCTL=no, ac_cv_NETSNMP_CAN_USE_SYSCTL=no)])
4561
if test "x$ac_cv_NETSNMP_CAN_USE_SYSCTL" = "xyes"; then
4562
AC_DEFINE(NETSNMP_CAN_USE_SYSCTL)
4566
# In FreeBSD 4.x, the TCP timer constants aren't. They are defined
4567
# in terms of 'hz', the kernel clock tick. In this case,
4568
# we need to have a local variable 'hz' in scope and set to a useful
4569
# value whenever we use one of these constants.
4571
AC_CACHE_CHECK(whether TCP timers depend on 'hz',ac_cv_TCPTV_NEEDS_HZ,
4573
[#include <netinet/tcp_timer.h>
4575
], ac_cv_TCPTV_NEEDS_HZ=yes, ac_cv_TCPTV_NEEDS_HZ=no)])
4577
if test "x$ac_cv_TCPTV_NEEDS_HZ" = "xyes"; then
4578
AC_DEFINE(TCPTV_NEEDS_HZ)
4582
# define the agent libraries variables
4586
AC_SUBST(OTHERAGENTLIBOBJS)
4587
AC_SUBST(OTHERAGENTLIBLOBJS)
4590
# Prompt for various bits of user information
4593
if test "x$ac_cv_user_prompt_NETSNMP_LOGFILE" = "x" -o "x$ac_cv_user_prompt_NETSNMP_SYS_LOC" = "x" -o "x$ac_cv_user_prompt_NETSNMP_SYS_CONTACT" = "x" -o "x$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" = "x"; then
4594
AC_CACHE_CHECK(whether to prompt for values, ac_cv_have_warned,
4596
if test "x$defaults" = "xno"; then
4599
************** Configuration Section **************
4601
You are about to be prompted with a series of questions. Answer
4602
them carefully, as they determine how the SNMP agent and related
4603
applications are to function.
4605
After the configure script finishes, you can browse the newly
4606
created net-snmp-config.h file for further - less important - parameters to
4607
modify. Be careful if you re-run configure though, since net-snmp-config.h
4608
will be overwritten.
4610
-Press return to continue-
4614
ac_cv_have_warned="yes"
4616
ac_cv_have_warned="no"
4620
ac_cv_have_warned="yes"
4624
if test -f /etc/resolv.conf; then
4625
LOC=`cat /etc/resolv.conf | grep '^domain' | tail -1 | awk '{print $NF}'`
4630
AC_PROMPT_USER(NETSNMP_DEFAULT_SNMP_VERSION,[
4632
*** Default SNMP Version:
4634
Starting with Net-SNMP 5.0, you can choose the default version of
4635
the SNMP protocol to use when no version is given explicitly on the
4636
command line, or via an 'snmp.conf' file. In the past this was set to
4637
SNMPv1, but you can use this to switch to SNMPv3 if desired. SNMPv3
4638
will provide a more secure management environment (and thus you're
4639
encouraged to switch to SNMPv3), but may break existing scripts that
4640
rely on the old behaviour. (Though such scripts will probably need to
4641
be changed to use the '-c' community flag anyway, as the SNMPv1
4642
command line usage has changed as well.).
4643
At this prompt you can select \"1\", \"2\" (for SNMPv2c), or \"3\" as
4644
the default version for the command tools (snmpget, ...) to use. This
4645
can always be overridden at runtime using the -v flag to the tools, or
4646
by using the \"defVersion\" token in your snmp.conf file.
4647
Providing the --with-default-snmp-version=\"x\" parameter to ./configure
4648
will avoid this prompt.
4650
Default version of SNMP to use],3,unquoted)
4652
# we tested this above before the prompt, but the prompt may give a new value.
4653
if test "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" = "2c"; then
4654
ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION="2"
4656
if test "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "1" -a "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "2" -a "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" != "3"; then
4657
AC_MSG_ERROR([Illegal version number. Only 1, 2 (for SNMPv2c) and 3 are supported.])
4660
AC_PROMPT_USER(NETSNMP_SYS_CONTACT,[
4662
*** System Contact Information:
4664
Describes who should be contacted about the host the agent is
4665
running on. This information is available in the MIB-II tree. This
4666
can also be over-ridden using the \"syscontact\" syntax in the agent's
4667
configuration files.
4668
Providing the --with-sys-contact=\"contact\" parameter to ./configure
4669
will avoid this prompt.
4671
System Contact Information],$ME@$LOC,quoted)
4673
AC_PROMPT_USER(NETSNMP_SYS_LOC,[
4675
*** System Location:
4677
Describes the location of the system. This information is
4678
available in the MIB-II tree. this can also be over-ridden using the
4679
\"syslocation\" syntax in the agent's configuration files.
4680
Providing the --with-sys-location=\"location\" parameter to ./configure
4681
will avoid this prompt.
4683
System Location],Unknown,quoted)
4685
if test -d /var/log; then
4686
defaultlog="/var/log/snmpd.log"
4688
defaultlog="/usr/adm/snmpd.log"
4691
AC_PROMPT_USER(NETSNMP_LOGFILE,[
4693
*** Logfile location:
4695
Enter the default location for the snmpd agent to dump
4696
information & errors to. If not defined (enter the keyword \"none\"
4697
at the prompt below) the agent will use stdout and stderr instead.
4698
(Note: This value can be over-ridden using command line options.)
4699
Providing the --with-logfile=\"path\" parameter to ./configure
4700
will avoid this prompt.
4702
Location to write logfile],$defaultlog,quoted)
4704
if test -d /var; then
4705
defaultstore="/var/net-snmp"
4706
ucddefaultstore="/var/ucd-snmp"
4708
defaultstore="/etc/net-snmp"
4709
ucddefaultstore="/etc/ucd-snmp"
4712
AC_PROMPT_USER(NETSNMP_PERSISTENT_DIRECTORY,[
4714
*** snmpd persistent storage location:
4716
Enter a directory for the SNMP library to store persistent
4717
data in the form of a configuration file. This default location is
4718
different than the old default location (which was for ucd-snmp). If
4719
you stay with the new path, I'll ask you in a second if you wish to
4720
copy your files over to the new location (once only). If you pick
4721
some other path than the default, you'll have to copy them yourself.
4722
There is nothing wrong with picking the old path ($ucddefaultstore) if
4724
Providing the --with-persistent-directory=\"path\" parameter to
4725
./configure will avoid this prompt.
4727
Location to write persistent information],$defaultstore,quoted)
4729
PERSISTENT_DIRECTORY=$ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY
4730
AC_SUBST(PERSISTENT_DIRECTORY)
4731
UCDPERSISTENT_DIRECTORY=$ucddefaultstore
4732
AC_SUBST(UCDPERSISTENT_DIRECTORY)
4734
if test $PERSISTENT_DIRECTORY = "$defaultstore" -a -d "$ucddefaultstore" -a ! -d "$defaultstore" ; then
4735
AC_CACHE_CHECK(If we should copy the old persistent directory, ac_cv_user_prompt_COPY_PERSISTENT_FILES,
4737
AC_PROMPT_USER_NO_DEFINE(ac_cv_user_prompt_COPY_PERSISTENT_FILES,[
4739
*** Copying old ucd-snmp persistent files to net-snmp persistent directory:
4741
Would you like to copy the older ucd-snmp persistent files
4742
into your new net-snmp persistent file path? This will functionally
4743
save all your ucd-snmp data and let it be used within the net-snmp
4744
tools. This will only be done once when you run make install. If you
4745
wish to do this, enter "yes" at the prompt.
4746
Providing the --with-copy-persistent-files=\"no\" (or \"yes\")
4747
parameters to ./configure will avoid this prompt.
4749
Copy ucd-snmp data into the net-snmp data directory],"yes")
4752
ac_cv_user_prompt_COPY_PERSISTENT_FILES="no"
4754
COPY_PERSISTENT_FILES="$ac_cv_user_prompt_COPY_PERSISTENT_FILES"
4755
AC_SUBST(COPY_PERSISTENT_FILES)
4759
AC_CONFIG_FILES([Makefile:Makefile.top:Makefile.in:Makefile.rules])
4760
AC_CONFIG_FILES([snmplib/Makefile:Makefile.top:snmplib/Makefile.in:Makefile.rules:snmplib/Makefile.depend])
4761
AC_CONFIG_FILES([apps/Makefile:Makefile.top:apps/Makefile.in:Makefile.rules:apps/Makefile.depend])
4762
AC_CONFIG_FILES([apps/snmpnetstat/Makefile:Makefile.top:apps/snmpnetstat/Makefile.in:Makefile.rules:apps/snmpnetstat/Makefile.depend])
4763
AC_CONFIG_FILES([agent/Makefile:Makefile.top:agent/Makefile.in:Makefile.rules:agent/Makefile.depend])
4764
AC_CONFIG_FILES([agent/helpers/Makefile:Makefile.top:agent/helpers/Makefile.in:Makefile.rules:agent/helpers/Makefile.depend])
4765
AC_CONFIG_FILES([agent/mibgroup/Makefile:Makefile.top:agent/mibgroup/Makefile.in:Makefile.rules:agent/mibgroup/Makefile.depend])
4766
AC_CONFIG_FILES([local/Makefile:Makefile.top:local/Makefile.in:Makefile.rules])
4767
AC_CONFIG_FILES([testing/Makefile:Makefile.top:testing/Makefile.in])
4768
AC_CONFIG_FILES([man/Makefile:Makefile.top:man/Makefile.in:Makefile.rules])
4769
AC_CONFIG_FILES([mibs/Makefile:Makefile.top:mibs/Makefile.in:Makefile.rules])
4770
AC_CONFIG_FILES([net-snmp-config:net-snmp-config.in],
4771
[chmod +x net-snmp-config])
4773
AC_CONFIG_COMMANDS([default], echo timestamp > stamp-h)
4776
# protect PACKAGE_* variables
4778
AH_VERBATIM([PACKAGE_BUGREPORT],[/* Define to the address where bug reports for this package should be sent. */
4779
#ifndef PACKAGE_BUGREPORT
4780
#undef PACKAGE_BUGREPORT
4782
AH_VERBATIM([PACKAGE_NAME],[/* Define to the full name of this package. */
4783
#ifndef PACKAGE_NAME
4786
AH_VERBATIM([PACKAGE_STRING],[/* Define to the full name and version of this package. */
4787
#ifndef PACKAGE_STRING
4788
#undef PACKAGE_STRING
4790
AH_VERBATIM([PACKAGE_TARNAME],[/* Define to the one symbol short name of this package. */
4791
#ifndef PACKAGE_TARNAME
4792
#undef PACKAGE_TARNAME
4794
AH_VERBATIM([PACKAGE_VERSION],[/* Define to the version of this package. */
4795
#ifndef PACKAGE_VERSION
4796
#undef PACKAGE_VERSION
4801
AC_MSG_CACHE_DISPLAY()
4804
# comment-start: "#"