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"
2612
for i in /etc/mnttab /etc/mtab /etc/filesystems /dev/mnttab
2614
if test -f $i -o -c $i; then
2615
ac_cv_ETC_MNTTAB="$i"
2621
AC_DEFINE_UNQUOTED(ETC_MNTTAB,"$ac_cv_ETC_MNTTAB")
2623
# Check for /dev/dmem or /dev/drum location
2624
AC_CACHE_CHECK(for location of swap device,ac_cv_DMEM_LOC,
2626
# First determine if test expects a -f or a -c (character device (SYSV))
2628
if test -f /dev/kmem; then
2630
elif test -c /dev/kmem; then
2637
if $CTEST /dev/dmem; then
2638
ac_cv_DMEM_LOC="/dev/dmem"
2639
elif $CTEST /dev/drum; then
2640
ac_cv_DMEM_LOC="/dev/drum"
2642
ac_cv_DMEM_LOC="none"
2646
if test "x$ac_cv_DMEM_LOC" != "xnone"; then
2647
AC_DEFINE_UNQUOTED(DMEM_LOC,"$ac_cv_DMEM_LOC")
2650
# forced efence turned off.
2651
# if test "x$developer" = "xyes" -a "x$use_efence" != "xno"; then
2655
if test "x$use_efence" = "xyes"; then
2656
AC_CHECK_LIB(efence, EF_Exit)
2659
# Checks for libraries.
2660
# AC_CHECK_LIB(des, main)
2661
# AC_CHECK_LIB(m, asin)
2664
[AS_HELP_STRING(--without-elf,[use elf libraries])],,
2665
[AC_ARG_ENABLE(elf,,
2666
[AC_MSG_ERROR([ Invalid option. Use --with-elf/--without-elf instead ])])])
2668
if test "x$with_elf" != "xno"; then
2669
# nlist is needed for uptime on some sytems in the generic library
2670
# add hosts which don't use nlist to the blank first line
2673
irix*) # Check for nlist in mld (irix)
2674
AC_CHECK_LIB(elf, nlist)
2675
AC_CHECK_LIB(elf, nlist64)
2676
AC_CHECK_LIB(mld, nlist)
2679
AC_CHECK_LIB(elf, nlist)
2685
# On some platforms (Irix) libnsl and libsocket should not be used.
2686
AC_CHECK_FUNC(gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME),
2687
AC_CHECK_LIB(nsl, gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME)
2688
LIBS="${LIBS} -lnsl"))
2690
# SCO Unixware 7.1.4 finds gethostbyname() in -lsocket
2691
AC_CHECK_FUNC(gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME),
2692
AC_CHECK_LIB(socket, gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME)
2693
LIBS="${LIBS} -lsocket"))
2696
AC_CHECK_LIB(kstat, kstat_lookup,
2697
AC_DEFINE(HAVE_LIBKSTAT, 1, [Define to 1 if you have the `kstat' library (-lkstat).])
2698
LNETSNMPLIBS="${LNETSNMPLIBS} -lkstat")
2700
# Check for libraries that the agent needs
2701
# saving old libraries
2704
# Check for security related functions
2705
if test "x$tryopenssl" != "xno"; then
2706
if test "x$askedopenssl" != "xyes" -a "x$askedpkcs" = "xyes"; then
2707
AC_CHECK_LIB(pkcs11, C_Initialize, AC_DEFINE(HAVE_LIBPKCS11, 1, [Define to 1 if you have the `pkcs11' library (-lpkcs11).])
2708
LIBPKCS11="-lpkcs11")
2710
if test "x$tryrsaref" != "xno"; then
2711
AC_CHECK_LIB(rsaref, RSAPrivateDecrypt)
2712
AC_CHECK_LIB(RSAglue, RSA_PKCS1_RSAref)
2715
AC_CHECK_LIB(crypto, EVP_md5, AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).])
2716
LIBCRYPTO="-lcrypto")
2717
AC_CHECK_LIB(crypto, AES_cfb128_encrypt,
2718
AC_DEFINE(HAVE_AES_CFB128_ENCRYPT, 1, [Define to 1 if you have the `AES_cfb128_encrypt' function.]))
2720
elif test "x$askedpkcs" = "xyes"; then
2721
AC_CHECK_LIB(pkcs11, C_Initialize, AC_DEFINE(HAVE_LIBPKCS11)
2722
LIBPKCS11="-lpkcs11")
2727
# check for tcp wrapper support
2728
_cppflags="${CPPFLAGS}"
2729
_ldflags="${LDFLAGS}"
2731
AC_ARG_WITH(libwrap,
2732
[ --with-libwrap[=LIBPATH] Compile in libwrap (tcp_wrappers) support.],[
2733
if test "$with_libwrap" != "no"; then
2734
if test "$with_libwrap" != "yes"; then
2735
CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
2736
LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
2740
AC_CHECK_HEADER(tcpd.h, ,
2741
AC_MSG_ERROR([Asked to use libwrap but I couldn't find tcpd.h.]))
2744
AC_MSG_CHECKING([for TCP wrappers library -lwrap])
2745
# XXX: should check for hosts_ctl
2746
AC_TRY_LINK([#include <sys/types.h>
2748
int allow_severity = 0;
2749
int deny_severity = 0;
2750
],[hosts_access((void *)0)],[
2752
AC_MSG_RESULT([yes])
2753
AC_DEFINE(NETSNMP_USE_LIBWRAP)
2754
test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
2755
_wraplibs="$_wraplibs -lwrap"],
2758
# Linux RedHat 6.1 won't link libwrap without libnsl
2759
AC_CHECK_FUNC(yp_get_default_domain, ,
2760
AC_CHECK_LIB(nsl, yp_get_default_domain))
2761
AC_MSG_CHECKING([for TCP wrappers library -lwrap linked with -lnsl])
2762
AC_TRY_LINK([#include <sys/types.h>
2764
int allow_severity = 0;
2765
int deny_severity = 0;
2766
],[hosts_access((void *)0)],
2769
AC_DEFINE(NETSNMP_USE_LIBWRAP)
2770
test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
2771
_wraplibs="$_wraplibs -lwrap -lnsl",
2774
AC_MSG_ERROR(Asked to use libwrap but I couldn't find it.))])
2775
LAGENTLIBS="$_wraplibs"
2776
CPPFLAGS=${_cppflags}
2782
AC_CHECK_HEADERS(rpm/rpmlib.h rpm/header.h)
2784
AC_CHECK_HEADER(rpm/rpmlib.h,rpmlib_h=yes,rpmlib_h=no)
2785
AC_CHECK_HEADER(rpm/header.h,rpmheader_h=yes,rpmheader_h=no)
2787
if test "x$rpmheader_h" = "xno" -o "x$rpmlib_h" = "xno" ; then
2788
if test "x$with_rpm" = "xyes" ; then
2789
AC_MSG_ERROR([Could not find either the RPM header files needed and was specifically asked to use RPM support])
2796
# rpm libraries only needed for the host resources mib software
2797
# installed tables (on linux in particular)
2799
if test "x$with_rpm" != "xno" && \
2800
echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
2801
# ARG. RPM is a real pain.
2802
# FWIW librpm.la, librpmio.la, and libpopt.la have correct dependencies.
2805
# zlib is required for newer versions of rpm
2806
_cppflags="${CPPFLAGS}"
2807
_ldflags="${LDFLAGS}"
2810
[ --with-zlib[=DIR] use libz in DIR],[
2811
if test -d "$withval"; then
2812
CPPFLAGS="${CPPFLAGS} -I$withval/include"
2813
LDFLAGS="${LDFLAGS} -L$withval/lib"
2817
# dunno if this is needed for rpm-4.0.x, earlier probably needs.
2818
AC_CHECK_HEADER(zlib.h,
2819
AC_CHECK_LIB(z, gzread, , CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
2820
CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
2822
# two variants of bzip2 need checking.
2824
[ --with-bzip2[=DIR] use libbz2 in DIR],[
2825
if test -d "$withval"; then
2826
CPPFLAGS="${CPPFLAGS} -I$withval/include"
2827
LDFLAGS="${LDFLAGS} -L$withval/lib"
2829
if test "x$with_bzip2" != "xno"; then
2830
AC_CHECK_LIB(bz2, bzread, [_rpmlibs="$_rpmlibs -lbz2"],
2831
AC_CHECK_LIB(bz2, BZ2_bzread, [_rpmlibs="$_rpmlibs -lbz2"],))
2836
# two variants of db1 need checking.
2837
AC_CHECK_LIB(db1, dbopen, [_rpmlibs="-ldb1 $_rpmlibs"],
2838
AC_CHECK_LIB(db, dbopen, [_rpmlibs="-ldb $_rpmlibs"]))
2840
# two variants of db3 need checking.
2841
AC_CHECK_LIB(db-3.1, db_create, [_rpmlibs="-ldb-3.1 $_rpmlibs"],
2842
AC_CHECK_LIB(db-3.0, db_create, [_rpmlibs="-ldb-3.0 $_rpmlibs"]))
2844
# rpm-3.0.5 and later needs popt.
2845
AC_CHECK_LIB(popt, poptParseArgvString, [_rpmlibs="-lpopt $_rpmlibs"])
2847
# rpm-4.0.x needs rpmio.
2848
AC_CHECK_LIB(rpmio, Fopen, [_rpmlibs="-lrpmio $_rpmlibs"],,$_rpmlibs)
2850
# now check for rpm using the appropriate libraries.
2851
AC_CHECK_LIB(rpm, rpmGetFilesystemList,[
2852
AC_DEFINE(HAVE_LIBRPM)
2853
LMIBLIBS="-lrpm $_rpmlibs $LMIBLIBS"
2854
CFLAGS="$CFLAGS -I/usr/include/rpm"
2856
# rpm-4.0.3 librpmdb actually contains what we need.
2857
AC_CHECK_LIB(rpmdb, rpmdbOpen,[
2858
AC_DEFINE(HAVE_LIBRPM)
2859
LMIBLIBS="-lrpmdb -lrpm $_rpmlibs $LMIBLIBS"
2860
CFLAGS="$CFLAGS -I/usr/include/rpm"
2864
# rpm 4.6 has incompatible API, turn on the legacy one
2865
AC_CHECK_DECL([headerGetEntry],
2867
AC_DEFINE([_RPM_4_4_COMPAT], [], [Define if you have RPM 4.6 or newer to turn on legacy API]),
2868
[[#include <rpm/rpmlib.h>]]
2873
AC_CHECK_LIB(kvm, kvm_read, [_libkvm="-lkvm"])
2874
AC_CHECK_FUNC(kvm_openfiles, AC_DEFINE(HAVE_KVM_OPENFILES, 1, [Define to 1 if you have the `kvm_openfiles' function.]),
2875
AC_CHECK_LIB(kvm, kvm_openfiles, AC_DEFINE(HAVE_KVM_OPENFILES, 1, [Define to 1 if you have the `kvm_openfiles' function.])
2877
AC_CHECK_FUNC(kvm_getprocs, AC_DEFINE(HAVE_KVM_GETPROCS, 1, [Define to 1 if you have the `kvm_getprocs' function.]),
2878
AC_CHECK_LIB(kvm, kvm_getprocs, AC_DEFINE(HAVE_KVM_GETPROCS, 1, [Define to 1 if you have the `kvm_getprocs' function.])
2880
AC_CHECK_FUNC(kvm_getswapinfo, AC_DEFINE(HAVE_KVM_GETSWAPINFO, 1, [Define to 1 if you have the `kvm_getswapinfo' function.]),
2881
AC_CHECK_LIB(kvm, kvm_getswapinfo, AC_DEFINE(HAVE_KVM_GETSWAPINFO, 1, [Define to 1 if you have the `kvm_getswapinfo' function.])
2883
if test "x${_libkvm}" != "x"; then
2884
AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the `kvm' library (-lkvm).])
2885
LAGENTLIBS="$LAGENTLIBS ${_libkvm}"
2888
# DYNAMIC MODULE SUPPORT
2889
AC_CHECK_FUNC(dlopen, AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if you have the `dlopen' function.]),
2890
AC_CHECK_LIB(dl, dlopen, AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if you have the `dlopen' function.])
2891
AC_DEFINE(HAVE_LIBDL, 1, [Define to 1 if you have the `dl' library (-ldl).])
2892
LMIBLIBS="${LMIBLIBS} -ldl"))
2895
AC_CHECK_FUNCS(nlist nlist64 knlist)
2897
# whether we need -ldevstat for diskio MIB
2898
echo " $module_list " | grep " ucd-snmp/diskio " >/dev/null
2899
if test $? -eq 0 ; then
2900
AC_CHECK_FUNC(getdevs, AC_DEFINE(HAVE_GETDEVS),
2901
AC_CHECK_LIB(devstat, getdevs, AC_DEFINE(HAVE_GETDEVS)
2902
LMIBLIBS="${LMIBLIBS} -ldevstat"))
2903
AC_CHECK_FUNC(getdevs, AC_DEFINE(HAVE_DEVSTAT_GETDEVS),
2904
AC_CHECK_LIB(devstat, devstat_getdevs, AC_DEFINE(HAVE_DEVSTAT_GETDEVS)
2905
LMIBLIBS="${LMIBLIBS} -ldevstat"))
2908
# LM-SENSORS-MIB support
2909
echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null
2910
if test $? -eq 0 ; then
2911
AC_MSG_CHECKING([for sensors support])
2914
AC_CHECK_HEADER(picl.h, LMIBLIBS="${LMIBLIBS} -lpicl",)
2915
AC_CHECK_HEADERS(picl.h)
2918
AC_CHECK_HEADER(sensors/sensors.h,,
2919
[AC_MSG_ERROR([asked to use lm_sensors but I couldn't find sensors/sensors.h])])
2920
AC_CHECK_LIB(sensors, sensors_get_detected_chips, [
2921
LMIBLIBS="${LMIBLIBS} -lsensors" ;
2923
[AC_MSG_ERROR([asked to use lm_sensors but I couldn't find -lsensors])])
2928
######################################################################
2930
######################################################################
2933
# test to see if we can attempt to build embedded Perl so far
2935
if test "x$embed_perl" = "xtry" ; then
2936
if test "x$install_perl" = "xno" ; then
2939
if test "x$ac_cv_path_PERLPROG" = "x" -o "x$ac_cv_path_PERLPROG" = "xno" ; then
2947
# Embedded Perl specific stuff
2951
if test "x$install_perl" != "xno" ; then
2952
myperl=$ac_cv_path_PERLPROG
2953
if test $myperl = "no" ; then
2954
if test "x$install_perl" = "xtry" ; then
2957
AC_MSG_ERROR(--enable-embedded-perl requested but no perl executable found)
2962
# test for shared libraries support
2963
if test "x$install_perl" != "xno" ; then
2964
# embedded Perl requires shared libraries
2965
if test "x$enable_shared" != "xyes"; then
2966
if test "x$install_perl" = "xtry" ; then
2969
AC_MSG_ERROR(Perl support requires --enable-shared)
2974
if test "x$install_perl" != "xno" ; then
2975
AC_MSG_CHECKING([if we are in the source tree so we can install Perl modules])
2976
if test "x$srcdir" = "x." -o -d perl/agent/default_store ; then
2977
AC_MSG_RESULT([Yes])
2979
if test "x$install_perl" = "xtry" ; then
2983
AC_MSG_ERROR([Perl modules can not be built outside the source directory])
2988
# check the Perl compiler name
2989
if test "x$install_perl" != "xno" ; then
2993
if test "xenable_perl_cc_checks" != "xno" ; then
2994
AC_MSG_CHECKING([for Perl cc])
2996
PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
2998
if test "x$PERLCC" != "x" ; then
2999
AC_MSG_RESULT([$PERLCC])
3001
if test "x$install_perl" = "xtry" ; then
3004
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.])
3009
# check the Perl compiler compatibility
3010
if test "x$install_perl" != "xno" ; then
3011
AC_MSG_CHECKING([whether $PERLCC is a GNU C compiler])
3014
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
3018
]])], [perlcc_is_gnu=yes], [perlcc_is_gnu=no])
3019
AC_MSG_RESULT([$perlcc_is_gnu])
3021
if test "x$GCC" = "xyes" -a "x$perlcc_is_gnu" = "xno" ; then
3022
if test "x$install_perl" = "xtry" ; then
3025
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).])
3030
# check if they're both gnu
3031
if test "x$install_perl" != "xno" ; then
3032
if test "x$GCC" != "xyes" -a "x$perlcc_is_gnu" = "xyes" ; then
3033
if test "x$install_perl" = "xtry" ; then
3036
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).])
3041
# we have enough support for installing the modules at least.
3042
if test "x$install_perl" = "xtry" ; then
3045
if test "x$install_perl" = "xno" ; then
3051
####################
3052
# on to embedding...
3054
# check the compiler flags for illegal tokens
3057
if test "x$embed_perl" != "xno" ; then
3061
AC_MSG_CHECKING([for problematic Perl cc flags on Suns])
3062
if $myperl -V:ccflags | grep LARGEFILE > /dev/null ; then
3063
if test "x$embed_perl" = "xtry" ; then
3066
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.])
3069
AC_MSG_RESULT([none known])
3080
if test "x$embed_perl" != "xno" ; then
3081
AC_MSG_CHECKING([for Perl CFLAGS])
3082
perlcflags=`$myperl -MExtUtils::Embed -e ccopts`
3083
if test "x$perlcflags" != "x" ; then
3084
AC_MSG_RESULT([$perlcflags])
3085
CFLAGS="$CFLAGS $perlcflags"
3087
if test "x$embed_perl" = "xtry" ; then
3090
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.])
3096
if test "x$embed_perl" != "xno" ; then
3097
AC_MSG_CHECKING([for Perl LDFLAGS])
3098
netsnmp_perlldopts=`$myperl -MExtUtils::Embed -e ldopts`
3099
if test "x$netsnmp_perlldopts" != "x" ; then
3100
AC_MSG_RESULT([$netsnmp_perlldopts])
3102
if test "x$embed_perl" = "xtry" ; then
3105
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.])
3108
if test "x$enable_as_needed" = "xyes" ; then
3109
# link *libraries* with libperl
3110
PERLLDOPTS_FOR_LIBS="$netsnmp_perlldopts"
3111
# Perl ccdlflags (RPATH to libperl, hopefully)
3112
AC_MSG_CHECKING([for Perl CCDLFLAGS])
3114
netsnmp_perlccdlflags=`$myperl -V:ccdlflags | $myperl -n -e 'print $1 '"if (/^\s*ccdlflags='([^']+)';/);"`
3116
AC_MSG_RESULT([$netsnmp_perlccdlflags])
3117
PERLLDOPTS_FOR_APPS="$netsnmp_perlccdlflags"
3119
# link *applications* against libperl
3120
PERLLDOPTS_FOR_APPS="$netsnmp_perlldopts"
3124
# check needed functions
3125
if test "x$embed_perl" != "xno" ; then
3127
LIBS="$LIBS $netsnmp_perlldopts"
3129
# newer perl vs older perl call functions
3130
AC_CHECK_FUNCS(eval_pv)
3132
# sigh: this has a CAPITAL P in Perl, which ends up being the same
3133
# autoconf define as the lower case so we have to treat them *BOTH*
3134
# specially. Wonderful.
3135
AC_CHECK_FUNC(perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_LC))
3136
AC_CHECK_FUNC(Perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_UC))
3141
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
3142
if test "x$embed_perl" = "xtry" ; then
3145
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.])
3148
AC_DEFINE(NETSNMP_EMBEDDED_PERL)
3149
OTHERAGENTLIBOBJS="snmp_perl.o"
3150
OTHERAGENTLIBLOBJS="snmp_perl.lo"
3152
EMBEDPERLINSTALL="embedperlinstall"
3153
EMBEDPERLUNINSTALL="embedperluninstall"
3159
EMBEDPERLUNINSTALL=""
3163
AC_SUBST(EMBEDPERLINSTALL)
3164
AC_SUBST(EMBEDPERLUNINSTALL)
3165
AC_SUBST(PERLLDOPTS_FOR_LIBS)
3166
AC_SUBST(PERLLDOPTS_FOR_APPS)
3168
# embedded Perl results
3169
AC_MSG_CHECKING([for potential embedded Perl support])
3170
if test "x$embed_perl" != "xyes" ; then
3171
AC_MSG_CACHE_ADD(Embedded Perl support: disabled)
3172
AC_MSG_RESULT([disabled])
3174
AC_MSG_CACHE_ADD(Embedded Perl support: enabled)
3175
AC_MSG_RESULT([enabled])
3178
# install Perl module results
3181
PERLUNINSTALLTARGS=""
3182
AC_MSG_CHECKING([if we can install the Perl modules])
3183
if test "x$install_perl" = "xyes" ; then
3184
PERLTARGS="perlmodules"
3185
PERLINSTALLTARGS="perlinstall"
3186
PERLUNINSTALLTARGS="perluninstall"
3187
if test "x$embed_perl" = "xyes" ; then
3188
AC_MSG_CACHE_ADD(SNMP Perl modules: building -- embeddable)
3189
AC_MSG_RESULT([yes -- and embeddable])
3191
AC_MSG_CACHE_ADD(SNMP Perl modules: building -- not embeddable)
3192
AC_MSG_RESULT([yes -- not embeddable])
3196
AC_MSG_CACHE_ADD(SNMP Perl modules: disabled)
3199
AC_SUBST(PERLINSTALLTARGS)
3200
AC_SUBST(PERLUNINSTALLTARGS)
3213
PYTHONINSTALLTARGS=""
3214
PYTHONUNINSTALLTARGS=""
3216
AC_MSG_CHECKING([if we should install the python bindings])
3217
if test "x$install_python" = "xyes" ; then
3218
PYTHONTARGS="pythonmodules"
3219
PYTHONINSTALLTARGS="pythoninstall"
3220
PYTHONUNINSTALLTARGS="pythonuninstall"
3221
PYTHONCLEANTARGS="pythonclean"
3222
AC_MSG_CACHE_ADD(SNMP Python modules: building for $PYTHONPROG)
3223
AC_MSG_RESULT([yes])
3225
AC_MSG_CACHE_ADD(SNMP Python modules: disabled)
3228
AC_SUBST(PYTHONTARGS)
3229
AC_SUBST(PYTHONINSTALLTARGS)
3230
AC_SUBST(PYTHONUNINSTALLTARGS)
3231
AC_SUBST(PYTHONCLEANTARGS)
3232
AC_SUBST(PYTHONARGS)
3236
# Checks for header files.
3240
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)
3241
# at least Solaris 9 needs sys/socket.h to compile sys/socketvar.h
3242
AC_CHECK_HEADERS(sys/socketvar.h,,,
3243
AC_INCLUDES_DEFAULT([])
3245
#if HAVE_SYS_SOCKET_H
3246
#include <sys/socket.h>
3249
# at least OpenBSD 3.4 needs sys/param.h (MAXPATHLEN) to compile sys/swap.h
3250
AC_CHECK_HEADERS(sys/swap.h,,,
3251
AC_INCLUDES_DEFAULT([])
3253
#if HAVE_SYS_PARAM_H
3254
#include <sys/param.h>
3257
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)
3259
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,,,
3261
#if HAVE_SYS_TYPES_H
3262
#include <sys/types.h>
3264
#if HAVE_SYS_TIMEOUT_H
3265
#include <sys/timeout.h>
3267
#if HAVE_SYS_SOCKET_H
3268
#include <sys/socket.h>
3270
#if HAVE_SYS_SOCKETVAR_H
3271
#include <sys/socketvar.h>
3273
#if HAVE_ARPA_INET_H
3274
#include <arpa/inet.h>
3276
#if HAVE_NETINET_IN_SYSTM_H
3277
#include <netinet/in_systm.h>
3279
#if HAVE_NETINET_IN_H
3280
#include <netinet/in.h>
3282
#if HAVE_NETINET_IP_H
3283
#include <netinet/ip.h>
3288
#if HAVE_NETINET_IP_VAR_H
3289
#include <netinet/ip_var.h>
3291
#if HAVE_NETINET_IP_ICMP_H
3292
#include <netinet/ip_icmp.h>
3294
#if HAVE_NETINET_TCP_H
3295
#include <netinet/tcp.h>
3297
#if HAVE_NETINET_UDP_H
3298
#include <netinet/udp.h>
3300
#if HAVE_NETINET_TCP_TIMER_H
3301
#include <netinet/tcp_timer.h>
3305
AC_CHECK_HEADERS(ufs/ufs/dinode.h ufs/ufs/quota.h ufs/ufs/inode.h ufs/ffs/fs.h,,,
3307
#if HAVE_SYS_TYPES_H
3308
#include <sys/types.h>
3310
#if HAVE_UFS_UFS_DINODE_H
3311
#include <ufs/ufs/dinode.h>
3313
#if HAVE_UFS_UFS_QUOTA_H
3314
#include <ufs/ufs/quota.h>
3317
# FreeBSD required headers
3318
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,,,
3320
#if HAVE_SYS_TYPES_H
3321
#include <sys/types.h>
3323
#if HAVE_SYS_PARAM_H
3324
#include <sys/param.h>
3328
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)
3330
AC_CHECK_HEADERS(inet/mib2.h)
3331
# NetBSD required headers
3332
AC_CHECK_HEADERS(kvm.h sys/pool.h uvm/uvm_param.h uvm/uvm_extern.h vm/vm_param.h vm/vm_extern.h)
3334
AC_CHECK_HEADERS(vm/swap_pager.h,,,
3341
# requires special hacks to get around various problems on older linux kernels.
3343
AC_CHECK_HEADERS([linux/ethtool.h],,,
3345
#include <linux/types.h>
3346
typedef __u64 u64; /* hack, so we may include kernel's ethtool.h */
3347
typedef __u32 u32; /* ditto */
3348
typedef __u16 u16; /* ditto */
3349
typedef __u8 u8; /* ditto */
3352
AC_CHECK_HEADERS(sys/stat.h)
3353
# BSDi3/IRIX headers
3354
# at least IRIX 6.5 needs _KMEMUSER and sys/types.h (mprot_t) to compile
3356
AC_CHECK_HEADERS(sys/vnode.h,,,
3359
#if HAVE_SYS_TYPES_H
3360
#include <sys/types.h>
3363
# at least IRIX 6.5 needs sys/sema.h (mrlock_t) to compile sys/hashing.h
3364
AC_CHECK_HEADERS(sys/sema.h)
3365
AC_CHECK_HEADERS(sys/hashing.h,,,
3366
AC_INCLUDES_DEFAULT([])
3369
#include <sys/sema.h>
3373
AC_CHECK_HEADERS(sys/tcpipstats.h sys/sysmp.h sys/systeminfo.h sys/sysget.h)
3374
# AIX system configuration
3375
AC_CHECK_HEADERS(sys/systemcfg.h)
3377
AC_CHECK_HEADERS(err.h sys/filio.h sgtty.h)
3378
# AIX needs this for statfs func
3379
AC_CHECK_HEADERS(sys/statfs.h)
3380
# for HostRes (HP-UX at least)
3381
AC_CHECK_HEADERS(sys/dkio.h sys/diskio.h sys/pstat.h linux/hdreg.h pkglocs.h)
3382
# for HostRes (Solaris 2.x at least)
3383
AC_CHECK_HEADERS(pkginfo.h,
3384
AC_CHECK_LIB(adm, pkginfo, AC_DEFINE(HAVE_PKGINFO)
3385
LMIBLIBS="${LMIBLIBS} -ladm"))
3388
aix*) # AIX perfstat library, needed for CPU/memory statistics
3389
AC_CHECK_HEADERS(libperfstat.h,
3390
AC_CHECK_LIB(perfstat, perfstat_cpu_total, AC_DEFINE(HAVE_PERFSTAT)
3391
LMIBLIBS="${LMIBLIBS} -lperfstat"), AC_MSG_ERROR([
3393
*** To monitor CPU/memory values in AIX you need to install
3394
*** libperfstat which can be found in bos.perf
3397
hpux*) # HP-UX agent needs open_mib
3398
AC_CHECK_LIB(nm, open_mib, AC_DEFINE(HAVE_LIBNM)
3399
LMIBLIBS="${LMIBLIBS} -lnm")
3405
# (mingw32 must link winsock explicitly)
3406
AC_CHECK_HEADERS(winsock.h,[
3407
AGENTLIBS="${AGENTLIBS} -liphlpapi"
3410
LIBS="${LIBS} -lregex -lws2_32"
3411
AGENTLIBS="${AGENTLIBS} -lregex -lws2_32"
3417
AC_CHECK_HEADERS(io.h)
3419
AC_CHECK_HEADERS(sys/stream.h)
3421
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,,,
3423
#if HAVE_SYS_TYPES_H
3424
#include <sys/types.h>
3426
#if HAVE_SYS_QUEUE_H
3427
#include <sys/queue.h>
3429
#if HAVE_NETINET_IN_H
3430
#include <netinet/in.h>
3432
#if HAVE_NETINET_IP6_H
3433
#include <netinet/ip6.h>
3436
# DYNAMIC MODULE SUPPORT
3437
AC_CHECK_HEADERS(dlfcn.h)
3438
# table_array helper support
3439
AC_CHECK_HEADERS(search.h)
3441
# RPM subdirectory path (sigh)
3442
if test "x$with_rpm" != "xno" && \
3443
echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
3444
AC_CHECK_HEADERS(rpm/rpmdb.h)
3447
# OpenBSD 2.6 needs netinet/in.h before netinet/in_pcb.h
3448
AC_MSG_CHECKING([[for netinet/in_pcb.h]])
3449
AC_CACHE_VAL(cv_have_netinet_in_pcb_h,
3451
#include <netinet/in.h>
3452
#include <netinet/in_pcb.h>
3453
], cv_have_netinet_in_pcb_h=yes, cv_have_netinet_in_pcb_h=no)])
3454
AC_MSG_RESULT($cv_have_netinet_in_pcb_h)
3455
if test $cv_have_netinet_in_pcb_h = yes; then
3456
AC_DEFINE(HAVE_NETINET_IN_PCB_H)
3459
# NetBSD needs machine/types.h before sys/disklabel.h
3460
AC_MSG_CHECKING([[for sys/disklabel.h]])
3461
AC_CACHE_VAL(cv_have_sys_disklabel_h,
3463
#include <machine/types.h>
3464
#include <sys/disklabel.h>
3465
], cv_have_sys_disklabel_h=yes, cv_have_sys_disklabel_h=no)])
3466
AC_MSG_RESULT($cv_have_sys_disklabel_h)
3467
if test $cv_have_sys_disklabel_h = yes; then
3468
AC_DEFINE(HAVE_SYS_DISKLABEL_H)
3472
AC_CHECK_HEADERS(openssl/hmac.h openssl/evp.h openssl/aes.h openssl/des.h openssl/dh.h)
3473
AC_CHECK_HEADERS(security/cryptoki.h)
3476
AC_PATH_PROG([LPSTAT_PATH],lpstat)
3477
if test x$LPSTAT_PATH != x; then
3478
AC_DEFINE_UNQUOTED(LPSTAT_PATH,"$LPSTAT_PATH")
3479
AC_DEFINE(HAVE_LPSTAT)
3481
AC_CHECK_FUNCS(cgetnext)
3482
if test -r /etc/printcap; then
3483
AC_DEFINE(HAVE_PRINTCAP)
3486
AC_MSG_CHECKING([for authentication support])
3489
if test "x$ac_cv_lib_pkcs11_C_Initialize" != "xyes" -o "x$ac_cv_header_security_cryptoki_h" != "xyes"; then
3490
if test "x$askedpkcs" = "xyes"; then
3491
AC_MSG_ERROR(Asked to use PKCS11 but I couldn't find it.)
3494
if test "x$askedpkcs" = "xyes"; then
3499
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
3500
if test "x$askedopenssl" = "xyes"; then
3501
AC_MSG_ERROR(Asked to use OpenSSL but I couldn't find it.)
3504
if test "x$askedopenssl" = "xyes"; then
3506
elif test "x$tryopenssl" = "xyes"; then
3507
if test "x$usepkcs" != "xyes"; then
3513
if test "x$useopenssl" != "xno" ; then
3514
authmodes="MD5 SHA1"
3515
if test "x$enable_privacy" != "xno" ; then
3516
if test "x$ac_cv_header_openssl_aes_h" = "xyes" ; then
3522
encrmodes="[disabled]"
3524
AC_DEFINE(NETSNMP_USE_OPENSSL)
3525
LNETSNMPLIBS="$LNETSNMPLIBS $LIBCRYPTO"
3526
AC_MSG_RESULT(OpenSSL Support)
3527
elif test "x$usepkcs" != "xno" ; then
3528
authmodes="MD5 SHA1"
3529
if test "x$enable_privacy" != "xno" ; then
3532
encrmodes="[disabled]"
3534
AC_DEFINE(NETSNMP_USE_PKCS11)
3535
LNETSNMPLIBS="$LNETSNMPLIBS $LIBPKCS11"
3536
AC_MSG_RESULT(PKCS11 Support)
3537
elif test "x$enable_md5" != "xno"; then
3540
AC_DEFINE(NETSNMP_USE_INTERNAL_MD5)
3541
AC_MSG_RESULT(Internal MD5 Support)
3543
if test "x$enable_md5" = "xno"; then
3544
authmodes=`echo $authmodes | sed 's/MD5 *//;'`
3546
AC_SUBST(LNETSNMPLIBS)
3547
AC_SUBST(LAGENTLIBS)
3549
AC_MSG_CACHE_ADD(Authentication support: $authmodes)
3550
AC_MSG_CACHE_ADD(Encryption support: $encrmodes)
3552
if test "x$all_warnings" != "x"; then
3553
AC_MSG_CACHE_ADD(WARNING: $all_warnings)
3556
# Checks for typedefs, structures, and compiler characteristics.
3561
# this should use AC_CHECK_TYPE, but it's broken at least in 2.13-14
3562
# so we do it by hand.
3563
AC_MSG_CHECKING([for socklen_t])
3564
AC_CACHE_VAL(ac_cv_type_$1,
3565
[AC_EGREP_CPP([socklen_t@<:@^a-zA-Z_0-9@:>@],
3566
[#include <sys/types.h>
3571
#ifdef HAVE_SYS_SOCKET_H
3572
#include <sys/socket.h>
3573
#endif], [ac_cv_type_socklen_t=yes], [ac_cv_type_socklen_t=no])])
3575
AC_MSG_RESULT([$ac_cv_type_socklen_t])
3576
if test $ac_cv_type_socklen_t = yes; then
3577
AC_DEFINE(HAVE_SOCKLEN_T)
3580
# AIX keeps in_addr_t in /usr/include/netinet/in.h
3581
AC_MSG_CHECKING([for in_addr_t])
3582
AC_CACHE_VAL(ac_cv_type_$1,
3583
[AC_EGREP_CPP([in_addr_t@<:@^a-zA-Z_0-9@:>@],
3584
[#include <sys/types.h>
3589
#ifdef HAVE_NETINET_IN_H
3590
#include <netinet/in.h>
3591
#endif], [ac_cv_type_in_addr_t=yes], [ac_cv_type_in_addr_t=no])])
3593
AC_MSG_RESULT([$ac_cv_type_in_addr_t])
3594
if test $ac_cv_type_in_addr_t = yes; then
3595
AC_DEFINE(HAVE_IN_ADDR_T)
3598
# Older versions of MinGW do not define ssize_t in sys/types
3599
AC_MSG_CHECKING([for ssize_t])
3600
AC_CACHE_VAL(ac_cv_type_$1,
3601
[AC_EGREP_CPP([ssize_t@<:@^a-zA-Z_0-9@:>@],
3602
[#include <sys/types.h>
3606
#endif], [ac_cv_type_ssize_t=yes], [ac_cv_type_ssize_t=no])])
3608
AC_MSG_RESULT([$ac_cv_type_ssize_t])
3609
if test $ac_cv_type_ssize_t = yes; then
3610
AC_DEFINE(HAVE_SSIZE_T, 1, [Define if type ssize_t is available])
3614
AC_CACHE_CHECK([for correct flags to ps], ac_cv_ps_flags,
3615
[if test "`($PSPROG -e 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3617
elif test "`($PSPROG -el 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3618
ac_cv_ps_flags="-el"
3619
elif test "`($PSPROG acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3620
ac_cv_ps_flags="acx"
3621
elif test "`($PSPROG -acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3622
ac_cv_ps_flags="-acx"
3623
elif test "`($PSPROG -o pid,tt,state,time,ucomm 2>&1) | $EGREP ' ps *$' | awk '{print $NF}'`" = "ps" ; then
3624
ac_cv_ps_flags="-o pid,tt,state,time,ucomm"
3625
elif test "`($PSPROG ax 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = "ps" ; then
3627
elif test "x$PARTIALTARGETOS" = "xcygwin"; then
3629
elif test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"; then
3632
AC_MSG_WARN([Unable to determine valid ps flags... defaulting...])
3633
ac_cv_ps_flags="-acx"
3637
PSCMD="$PSPROG $ac_cv_ps_flags"
3639
AC_DEFINE_UNQUOTED(PSCMD, "$PSPROG $ac_cv_ps_flags")
3641
# Checks for byte order
3642
if test $cross_compiling = yes; then
3643
if test x$with_endianness = xbig; then
3644
AC_DEFINE(WORDS_BIGENDIAN)
3645
elif test -z $with_endianness; then
3646
AC_MSG_ERROR([You are cross-compiling, but you have not specified the target's endianness])
3649
if test $with_endianness; then
3650
AC_MSG_ERROR([Endianness has been specified, but you are not cross-compiling.])
3655
# Checks for library functions.
3657
AC_PROG_GCC_TRADITIONAL
3661
AC_CHECK_FUNCS(setmntent hasmntopt gethostname uname gettimeofday select socket strtol strtoul strlcpy)
3662
AC_CHECK_FUNCS(strchr strtok_r strdup memcpy memmove index bcopy strcasestr regcomp)
3663
AC_CHECK_FUNCS(signal setsid sigset sigblock sighold strerror setenv vsnprintf snprintf)
3664
AC_CHECK_FUNCS(sigaction)
3665
AC_CHECK_FUNCS(random lrand48 rand)
3666
AC_CHECK_FUNCS(execv system fork getpid strncasecmp sigalrm)
3667
AC_CHECK_FUNCS(lseek64 pread64)
3668
if test "x$with_rpm" != "xno" && \
3669
echo " $module_list " | grep " host/hr_swinst " > /dev/null; then
3672
AC_CHECK_FUNCS(rpmGetPath)
3676
AC_CHECK_FUNCS(getloadavg)
3677
AC_CHECK_FUNCS(getaddrinfo getipnodebyname gai_strerror)
3678
# BSDi2 functions differ
3679
AC_CHECK_FUNCS(statvfs statfs)
3680
AC_CHECK_FUNCS(getdtablesize)
3682
AC_CHECK_FUNCS(getfsstat)
3683
AC_CHECK_FUNCS(usleep)
3684
AC_CHECK_FUNCS(setlocale)
3685
AC_CHECK_FUNCS(tcgetattr)
3686
AC_CHECK_FUNCS(if_nameindex if_freenameindex)
3688
AC_CHECK_FUNCS(getpagesize)
3689
AC_CHECK_FUNCS(mkstemp)
3690
AC_CHECK_FUNCS(getpwnam getgrnam setgid setuid setgroups)
3691
# High resolution alarm support
3692
AC_CHECK_FUNCS(setitimer)
3693
# functions to support the clock.
3694
AC_CHECK_FUNCS(mktime stime times sysconf)
3695
# missing from hp-ux
3696
AC_CHECK_FUNCS(if_nametoindex)
3697
# missing from MinGW
3698
AC_CHECK_FUNCS(chown localtime_r)
3700
AC_MSG_CHECKING([[for SIOCGIFADDR in sys/ioctl.h]])
3701
AC_CACHE_VAL(cv_sys_ioctl_h_has_SIOCGIFADDR,
3702
[ AC_EGREP_CPP(xxxyesxxx,
3704
#ifdef HAVE_SYS_IOCTL_H
3705
#include <sys/ioctl.h>
3710
], cv_sys_ioctl_h_has_SIOCGIFADDR=yes, cv_sys_ioctl_h_has_SIOCGIFADDR=no)])
3711
AC_MSG_RESULT($cv_sys_ioctl_h_has_SIOCGIFADDR)
3712
if test $cv_sys_ioctl_h_has_SIOCGIFADDR = yes; then
3713
AC_DEFINE(SYS_IOCTL_H_HAS_SIOCGIFADDR)
3717
AC_MSG_CHECKING([[for two-argument statfs with struct fs_data (Ultrix)]])
3718
AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
3720
#ifdef HAVE_SYS_PARAM_H
3721
#include <sys/param.h>
3723
#include <sys/types.h>
3724
#ifdef HAVE_SYS_MOUNT_H
3725
#include <sys/mount.h>
3727
#ifdef HAVE_SYS_FS_TYPES_H
3728
#include <sys/fs_types.h>
3733
/* Ultrix's statfs returns 1 for success,
3734
0 for not mounted, -1 for failure. */
3735
exit (statfs (".", &fsd) != 1);
3737
fu_cv_sys_stat_fs_data=yes,
3738
fu_cv_sys_stat_fs_data=no,
3739
fu_cv_sys_stat_fs_data=no)])
3740
AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
3741
if test $fu_cv_sys_stat_fs_data = yes; then
3742
AC_DEFINE(STAT_STATFS_FS_DATA)
3745
# check if compiler pre-processor defines __FUNCTION__
3746
AC_CACHE_CHECK(if __FUNCTION__ is defined,ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED,
3749
char *cp = __FUNCTION__;
3750
], ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED=yes, ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED=no)])
3752
if test "x$ac_cv_HAVE_CPP_UNDERBAR_FUNCTION_DEFINED" = "xyes"; then
3753
AC_DEFINE(HAVE_CPP_UNDERBAR_FUNCTION_DEFINED)
3756
#--------------------------------------------------------------
3757
# on SCO Unixware 7.1.4 (SCO compiler), "static inline" functions
3758
# are not supported, so this disables the whole inline thing if it
3759
# doesn't work properly. Should have no effect on other platforms.
3760
AC_CACHE_CHECK([[whether static inline functions are broken (Unixware)]],
3761
[netsnmp_cv_c_broken_inline],
3762
AC_COMPILE_IFELSE([[
3763
static inline int nested_inline_function(void) {
3766
inline int main_inline_function( void ) {
3767
return nested_inline_function();
3769
]], netsnmp_cv_broken_inline=no, netsnmp_cv_broken_inline=yes))
3771
# But, sadly, the usage of inline in NET_SNMP disagrees seriously with at least
3772
# solaris2, so disable it for now.
3773
case "$target_os" in
3775
netsnmp_cv_broken_inline=yes
3781
if test "$netsnmp_cv_broken_inline" = yes ; then
3782
AC_DEFINE(NETSNMP_BROKEN_INLINE, 1,
3783
[Define if static inline functions are unsupported])
3786
# openbsd seems to have dropped m_clusters and m_clfree from mbstat
3787
AC_CHECK_STRUCT_FOR([
3789
#include <sys/mbuf.h>
3791
], mbstat, m_clusters, no)
3793
# openbsd seems to have dropped m_mbufs from mbstat too
3794
AC_CHECK_STRUCT_FOR([
3796
#include <sys/mbuf.h>
3798
], mbstat, m_mbufs, no)
3801
AC_CHECK_STRUCT_FOR([
3802
#ifdef HAVE_SYS_PARAM_H
3803
#include <sys/param.h>
3805
#include <sys/types.h>
3806
#include <sys/signal.h>
3807
], sigaction, sa_sigaction, no)
3809
AC_CHECK_STRUCT_FOR([
3810
#include <sys/types.h>
3811
#if TIME_WITH_SYS_TIME
3812
# include <sys/time.h>
3815
# if HAVE_SYS_TIME_H
3816
# include <sys/time.h>
3821
], tm, tm_gmtoff, no)
3823
AC_CHECK_STRUCT_FOR([
3824
#ifdef HAVE_SYS_PARAM_H
3825
#include <sys/param.h>
3827
#include <sys/types.h>
3828
#include <sys/socket.h>
3830
#ifdef HAVE_NET_IF_VAR_H
3831
#include <net/if_var.h>
3835
if test "x$ac_cv_struct_ifnet_has_if_mtu" = "xno"; then
3836
AC_CACHE_CHECK(if _KERNEL needs to be defined for if_mtu, ac_cv_IFNET_NEEDS_KERNEL,
3838
if test "x$ac_cv_struct_ifnet_has_if_mtu" = "xyes"; then
3839
ac_cv_IFNET_NEEDS_KERNEL=no
3843
#ifdef HAVE_SYS_PARAM_H
3844
#include <sys/param.h>
3846
#include <sys/types.h>
3847
#include <sys/socket.h>
3848
#ifdef HAVE_SYS_TIME_H
3849
#include <sys/time.h>
3852
#ifdef HAVE_NET_IF_VAR_H
3853
#include <net/if_var.h>
3856
struct ifnet testit;
3858
], ac_cv_IFNET_NEEDS_KERNEL=yes, ac_cv_IFNET_NEEDS_KERNEL=no)
3862
if test "x$ac_cv_IFNET_NEEDS_KERNEL" = "xyes"; then
3863
AC_DEFINE(IFNET_NEEDS_KERNEL)
3867
AC_CHECK_STRUCT_FOR([
3868
#ifdef HAVE_SYS_PARAM_H
3869
#include <sys/param.h>
3871
#include <sys/types.h>
3872
#ifdef IFNET_NEEDS_KERNEL
3876
#include <sys/socket.h>
3877
], sockaddr, sa_len, no)
3879
AC_CHECK_STRUCT_FOR([
3880
#ifdef HAVE_SYS_PARAM_H
3881
#include <sys/param.h>
3883
#include <sys/types.h>
3884
#ifdef IFNET_NEEDS_KERNEL
3888
#include <sys/socket.h>
3889
], sockaddr, sa_union.sa_generic.sa_family2, no)
3891
AC_CHECK_STRUCT_FOR([
3892
#if HAVE_SYS_PARAM_H
3893
#include <sys/param.h>
3895
#if HAVE_SYS_TYPES_H
3896
#include <sys/types.h>
3898
#if HAVE_SYS_SOCKET_H
3899
#include <sys/socket.h>
3901
], sockaddr_storage, ss_family, no)
3903
AC_CHECK_STRUCT_FOR([
3904
#if HAVE_SYS_PARAM_H
3905
#include <sys/param.h>
3907
#if HAVE_SYS_TYPES_H
3908
#include <sys/types.h>
3910
#if HAVE_SYS_SOCKET_H
3911
#include <sys/socket.h>
3913
], sockaddr_storage, __ss_family, no)
3915
AC_CHECK_STRUCT_FOR([
3916
#ifdef HAVE_SYS_PARAM_H
3917
#include <sys/param.h>
3919
#include <sys/types.h>
3920
#ifdef IFNET_NEEDS_KERNEL
3924
#include <sys/socket.h>
3927
#include <net/route.h>
3928
], rtentry, rt_dst, no)
3930
# checking for 4.3 vs 4.4 rtentry.
3931
AC_CACHE_CHECK(type of rtentry structure,ac_cv_RTENTRY_TYPE,
3936
#ifdef HAVE_SYS_PARAM_H
3937
#include <sys/param.h>
3939
#include <sys/types.h>
3940
#ifdef IFNET_NEEDS_KERNEL
3944
#include <sys/socket.h>
3947
#include <net/route.h>
3950
#ifndef STRUCT_RTENTRY_HAS_RT_DST
3951
#define rt_dst rt_nodes->rn_key
3955
rt.rt_nodes[0].rn_flags = 1;
3957
], ac_cv_RTENTRY_TYPE="BSD-4.4")
3960
if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
3962
#ifdef HAVE_SYS_PARAM_H
3963
#include <sys/param.h>
3965
#include <sys/types.h>
3966
#ifdef IFNET_NEEDS_KERNEL
3970
#include <sys/socket.h>
3973
#include <net/route.h>
3977
], ac_cv_RTENTRY_TYPE="BSD-4.3")
3981
if test "x$ac_cv_RTENTRY_TYPE" = "x"; then
3982
AC_MSG_RESULT(Unknown)
3983
ac_cv_RTENTRY_TYPE="unknown"
3988
if test "x$ac_cv_RTENTRY_TYPE" = "xBSD-4.4"; then
3989
AC_DEFINE(RTENTRY_4_4)
3992
# checking for alpha's ortentry vs rtentry
3993
if test "x$ac_cv_RTENTRY_TYPE" = "xunknown"; then
3994
AC_CACHE_CHECK(for struct rtentry, ac_cv_struct_rtentry,
3995
[AC_EGREP_CPP(ortentry, [#define KERNEL
3996
#include <net/route.h>
3997
], ac_cv_struct_rtentry=ortentry, ac_cv_struct_rtentry=rtentry )
3998
if test "x$ac_cv_struct_rtentry" = "xrtentry" ; then
3999
ac_cv_struct_rtentry="rtentry"
4001
ac_cv_struct_rtentry="ortentry"
4005
RTENTRY_TYPE="rtentry"
4006
ac_cv_struct_rtentry="rtentry"
4009
if test "x$ac_cv_struct_rtentry" != "x"; then
4010
AC_DEFINE_UNQUOTED(RTENTRY,struct ${ac_cv_struct_rtentry})
4012
AC_DEFINE(RTENTRY,struct rtentry)
4015
# check for 4.3's rtentry->rt_next
4016
if test "x$ac_cv_RTENTRY_TYPE" = "xBSD-4.3"; then
4017
AC_CACHE_CHECK(for struct rtentry has a rt_next node,
4018
ac_cv_struct_rtentry_rt_next,
4021
#ifdef HAVE_SYS_PARAM_H
4022
#include <sys/param.h>
4024
#include <sys/types.h>
4025
#ifdef IFNET_NEEDS_KERNEL
4029
#include <sys/socket.h>
4032
#include <net/route.h>
4036
], ac_cv_struct_rtentry_rt_next=yes, ac_cv_struct_rtentry_rt_next=no )
4039
if test "x$ac_cv_struct_rtentry_rt_next" = "xyes"; then
4040
AC_DEFINE(RTENTRY_RT_NEXT)
4045
# Check sin6_scope_id member specified in RFC2553 additionally
4046
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,[
4047
AC_INCLUDES_DEFAULT()
4048
[#ifdef HAVE_SYS_PARAM_H
4049
#include <sys/param.h>
4051
#ifdef HAVE_SYS_SOCKET_H
4052
#include <sys/socket.h>
4054
#ifdef HAVE_NETINET_IN_H
4055
#include <netinet/in.h>
4059
# Check struct rtentry for various things.
4060
AC_CHECK_STRUCT_FOR([
4061
#ifdef HAVE_SYS_PARAM_H
4062
#include <sys/param.h>
4064
#include <sys/types.h>
4065
#ifdef IFNET_NEEDS_KERNEL
4069
#include <sys/socket.h>
4072
#include <net/route.h>
4073
], rtentry, rt_unit)
4075
AC_CHECK_STRUCT_FOR([
4076
#ifdef HAVE_SYS_PARAM_H
4077
#include <sys/param.h>
4079
#include <sys/types.h>
4080
#ifdef IFNET_NEEDS_KERNEL
4084
#include <sys/socket.h>
4087
#include <net/route.h>
4088
], rtentry, rt_refcnt)
4090
AC_CHECK_STRUCT_FOR([
4091
#ifdef HAVE_SYS_PARAM_H
4092
#include <sys/param.h>
4094
#include <sys/types.h>
4095
#ifdef IFNET_NEEDS_KERNEL
4099
#include <sys/socket.h>
4102
#include <net/route.h>
4103
], rtentry, rt_hash)
4105
AC_CHECK_STRUCT_FOR([
4106
#ifdef HAVE_SYS_PARAM_H
4107
#include <sys/param.h>
4109
#include <sys/types.h>
4110
#ifdef IFNET_NEEDS_KERNEL
4114
#include <sys/socket.h>
4117
#include <net/route.h>
4120
# Check tcpstat for tcpstat.tcp_rcvmemdrop
4121
AC_CHECK_STRUCT_FOR([
4122
#ifdef HAVE_SYS_PARAM_H
4123
#include <sys/param.h>
4125
#include <sys/types.h>
4126
#ifdef HAVE_SYS_TIMEOUT_H
4127
#include <sys/timeout.h>
4129
#include <netinet/tcp.h>
4130
#ifdef HAVE_NETINET_TCP_TIMER_H
4131
#include <netinet/tcp_timer.h>
4134
#ifdef HAVE_NETINET_TCP_VAR_H
4135
#include <netinet/tcp_var.h>
4137
], tcpstat, tcp_rcvmemdrop)
4140
AC_CHECK_STRUCT_FOR([
4141
#ifdef IFNET_NEEDS_KERNEL
4144
#ifdef HAVE_SYS_PARAM_H
4145
#include <sys/param.h>
4147
#include <sys/types.h>
4148
#include <sys/socket.h>
4149
#ifdef HAVE_SYS_TIME_H
4150
#include <sys/time.h>
4153
#ifdef HAVE_NET_IF_VAR_H
4154
#include <net/if_var.h>
4156
], ifaddr, ifa_next)
4158
# Check ifnet entries using macro defined in aclocal.m4.
4160
# XXX Broken on FreeBSD where these are #define'd in <net/if.h>
4162
AC_CHECK_IFNET_FOR(if_baudrate)
4163
AC_CHECK_IFNET_FOR(if_baudrate.ifs_value)
4164
AC_CHECK_IFNET_FOR(if_speed)
4165
AC_CHECK_IFNET_FOR(if_type)
4166
AC_CHECK_IFNET_FOR(if_imcasts)
4167
AC_CHECK_IFNET_FOR(if_iqdrops)
4168
AC_CHECK_IFNET_FOR(if_noproto)
4169
AC_CHECK_IFNET_FOR(if_omcasts)
4170
AC_CHECK_IFNET_FOR(if_xname,no)
4171
AC_CHECK_IFNET_FOR(if_lastchange.tv_sec)
4172
AC_CHECK_IFNET_FOR(if_obytes)
4173
AC_CHECK_IFNET_FOR(if_ibytes)
4174
AC_CHECK_IFNET_FOR(if_addrlist)
4175
AC_CHECK_IFNET_FOR(if_addrhead.tqh_first)
4177
AC_CHECK_STRUCT_FOR([
4178
#include <sys/types.h>
4179
#if HAVE_NETINET_IN_H
4180
#include <netinet/in.h>
4182
#if HAVE_NETINET_IP_VAR_H
4183
#include <netinet/ip_var.h>
4185
#if HAVE_NETINET_UDP_H
4186
#include <netinet/udp.h>
4188
#if HAVE_NETINET_UDP_VAR_H
4189
#include <netinet/udp_var.h>
4191
],udpstat,udps_discard)
4193
AC_CHECK_STRUCT_FOR([
4194
#include <sys/types.h>
4195
#if HAVE_NETINET_IN_H
4196
#include <netinet/in.h>
4198
#if HAVE_NETINET_IP_VAR_H
4199
#include <netinet/ip_var.h>
4201
#if HAVE_NETINET_UDP_H
4202
#include <netinet/udp.h>
4204
#if HAVE_NETINET_UDP_VAR_H
4205
#include <netinet/udp_var.h>
4207
],udpstat,udps_noport)
4209
AC_CHECK_STRUCT_FOR([
4210
#include <sys/types.h>
4211
#if HAVE_NETINET_IN_H
4212
#include <netinet/in.h>
4214
#if HAVE_NETINET_IP_VAR_H
4215
#include <netinet/ip_var.h>
4217
#if HAVE_NETINET_UDP_H
4218
#include <netinet/udp.h>
4220
#if HAVE_NETINET_UDP_VAR_H
4221
#include <netinet/udp_var.h>
4223
],udpstat,udps_noportbcast)
4225
AC_CHECK_STRUCT_FOR([
4226
#include <sys/types.h>
4227
#if HAVE_NETINET_IN_H
4228
#include <netinet/in.h>
4230
#if HAVE_NETINET_IP_VAR_H
4231
#include <netinet/ip_var.h>
4233
#if HAVE_NETINET_UDP_H
4234
#include <netinet/udp.h>
4236
#if HAVE_NETINET_UDP_VAR_H
4237
#include <netinet/udp_var.h>
4239
],udpstat,udps_fullsock)
4241
AC_CHECK_STRUCT_FOR([
4242
#ifdef HAVE_SYS_PARAM_H
4243
#include <sys/param.h>
4245
#include <sys/types.h>
4246
#include <sys/socket.h>
4247
#ifdef HAVE_SYS_TIME_H
4248
#include <sys/time.h>
4251
#if HAVE_NETINET_IN_H
4252
#include <netinet/in.h>
4254
#if HAVE_NETINET_IF_ETHER_H
4255
#include <netinet/if_ether.h>
4259
AC_CHECK_STRUCT_FOR([
4260
#if HAVE_SYS_TYPES_H
4261
#include <sys/types.h>
4263
#ifdef HAVE_SYS_PARAM_H
4264
#include <sys/param.h>
4267
#include <sys/conf.h>
4269
],swdevt,sw_nblksenabled)
4271
AC_CHECK_STRUCT_FOR([
4272
#ifdef HAVE_SYS_STAT_H
4273
#include <sys/stat.h>
4275
#if HAVE_SYS_STATFS_H
4276
#include <sys/statfs.h>
4278
#if HAVE_SYS_STATVFS_H
4279
#include <sys/statvfs.h>
4283
AC_CHECK_STRUCT_FOR([
4284
#ifdef HAVE_SYS_STAT_H
4285
#include <sys/stat.h>
4287
#if HAVE_SYS_STATFS_H
4288
#include <sys/statfs.h>
4290
#if HAVE_SYS_STATVFS_H
4291
#include <sys/statvfs.h>
4295
AC_CHECK_STRUCT_FOR([
4296
#ifdef HAVE_SYS_STAT_H
4297
#include <sys/stat.h>
4299
#if HAVE_SYS_STATFS_H
4300
#include <sys/statfs.h>
4302
#if HAVE_SYS_STATVFS_H
4303
#include <sys/statvfs.h>
4307
AC_CHECK_STRUCT_FOR([
4308
#ifdef HAVE_SYS_STAT_H
4309
#include <sys/stat.h>
4311
#if HAVE_SYS_STATFS_H
4312
#include <sys/statfs.h>
4314
#if HAVE_SYS_STATVFS_H
4315
#include <sys/statvfs.h>
4319
AC_CHECK_STRUCT_FOR([
4320
#ifdef HAVE_SYS_STAT_H
4321
#include <sys/stat.h>
4323
#if HAVE_SYS_STATFS_H
4324
#include <sys/statfs.h>
4326
#ifdef HAVE_SYS_PARAM_H
4327
#include <sys/param.h>
4328
#include <sys/types.h>
4330
#ifdef HAVE_SYS_MOUNT_H
4331
#include <sys/mount.h>
4335
AC_CHECK_STRUCT_FOR([
4336
#ifdef HAVE_SYS_STAT_H
4337
#include <sys/stat.h>
4339
#if HAVE_SYS_STATFS_H
4340
#include <sys/statfs.h>
4342
#ifdef HAVE_SYS_PARAM_H
4343
#include <sys/param.h>
4344
#include <sys/types.h>
4346
#ifdef HAVE_SYS_MOUNT_H
4347
#include <sys/mount.h>
4351
AC_CHECK_STRUCT_FOR([
4352
#ifdef HAVE_SYS_STAT_H
4353
#include <sys/stat.h>
4355
#if HAVE_SYS_STATFS_H
4356
#include <sys/statfs.h>
4358
#ifdef HAVE_SYS_PARAM_H
4359
#include <sys/param.h>
4360
#include <sys/types.h>
4362
#ifdef HAVE_SYS_MOUNT_H
4363
#include <sys/mount.h>
4367
AC_CHECK_STRUCT_FOR([
4373
# struct nlist64 (IRIX)
4374
AC_CHECK_STRUCT_FOR([
4375
#if HAVE_SYS_TYPES_H
4376
#include <sys/types.h>
4383
# check struct ipstat for various things
4384
AC_CHECK_STRUCT_FOR([
4385
#include <sys/types.h>
4386
#if HAVE_NETINET_IN_H
4387
#include <netinet/in.h>
4389
#if HAVE_NETINET_IP_VAR_H
4390
#include <netinet/ip_var.h>
4392
], ipstat, ips_cantforward)
4394
AC_CHECK_STRUCT_FOR([
4395
#include <sys/types.h>
4396
#if HAVE_NETINET_IN_H
4397
#include <netinet/in.h>
4399
#if HAVE_NETINET_IP_VAR_H
4400
#include <netinet/ip_var.h>
4402
], ipstat, ips_cantfrag)
4404
AC_CHECK_STRUCT_FOR([
4405
#include <sys/types.h>
4406
#if HAVE_NETINET_IN_H
4407
#include <netinet/in.h>
4409
#if HAVE_NETINET_IP_VAR_H
4410
#include <netinet/ip_var.h>
4412
], ipstat, ips_delivered)
4414
AC_CHECK_STRUCT_FOR([
4415
#include <sys/types.h>
4416
#if HAVE_NETINET_IN_H
4417
#include <netinet/in.h>
4419
#if HAVE_NETINET_IP_VAR_H
4420
#include <netinet/ip_var.h>
4422
], ipstat, ips_fragdropped)
4424
AC_CHECK_STRUCT_FOR([
4425
#include <sys/types.h>
4426
#if HAVE_NETINET_IN_H
4427
#include <netinet/in.h>
4429
#if HAVE_NETINET_IP_VAR_H
4430
#include <netinet/ip_var.h>
4432
], ipstat, ips_fragtimeout)
4434
AC_CHECK_STRUCT_FOR([
4435
#include <sys/types.h>
4436
#if HAVE_NETINET_IN_H
4437
#include <netinet/in.h>
4439
#if HAVE_NETINET_IP_VAR_H
4440
#include <netinet/ip_var.h>
4442
], ipstat, ips_fragmented)
4444
AC_CHECK_STRUCT_FOR([
4445
#include <sys/types.h>
4446
#if HAVE_NETINET_IN_H
4447
#include <netinet/in.h>
4449
#if HAVE_NETINET_IP_VAR_H
4450
#include <netinet/ip_var.h>
4452
], ipstat, ips_localout)
4454
AC_CHECK_STRUCT_FOR([
4455
#include <sys/types.h>
4456
#if HAVE_NETINET_IN_H
4457
#include <netinet/in.h>
4459
#if HAVE_NETINET_IP_VAR_H
4460
#include <netinet/ip_var.h>
4462
], ipstat, ips_noproto)
4464
AC_CHECK_STRUCT_FOR([
4465
#include <sys/types.h>
4466
#if HAVE_NETINET_IN_H
4467
#include <netinet/in.h>
4469
#if HAVE_NETINET_IP_VAR_H
4470
#include <netinet/ip_var.h>
4472
], ipstat, ips_noroute)
4474
AC_CHECK_STRUCT_FOR([
4475
#include <sys/types.h>
4476
#if HAVE_NETINET_IN_H
4477
#include <netinet/in.h>
4479
#if HAVE_NETINET_IP_VAR_H
4480
#include <netinet/ip_var.h>
4482
], ipstat, ips_odropped)
4484
AC_CHECK_STRUCT_FOR([
4485
#include <sys/types.h>
4486
#if HAVE_NETINET_IN_H
4487
#include <netinet/in.h>
4489
#if HAVE_NETINET_IP_VAR_H
4490
#include <netinet/ip_var.h>
4492
], ipstat, ips_ofragments)
4494
AC_CHECK_STRUCT_FOR([
4495
#include <sys/types.h>
4496
#if HAVE_NETINET_IN_H
4497
#include <netinet/in.h>
4499
#if HAVE_NETINET_IP_VAR_H
4500
#include <netinet/ip_var.h>
4502
], ipstat, ips_reassembled)
4504
# check for the des_ks_struct.weak_key attribute, which indicates the
4505
# older openssl version is being used.
4506
if test "x$ac_cv_header_openssl_des_h" = "xyes" ; then
4507
AC_CHECK_STRUCT_FOR([
4508
#include <openssl/des.h>
4509
], des_ks_struct, weak_key)
4512
# attempt to figure out if sysctl is usable
4514
if test $cross_compiling = yes; then
4515
AC_MSG_WARN([Can't check sysctl, manually define NETSNMP_CAN_USE_SYSCTL if platform support available])
4517
AC_CACHE_CHECK(if sysctl can read kernel information,ac_cv_NETSNMP_CAN_USE_SYSCTL,
4519
#if TIME_WITH_SYS_TIME
4520
# include <sys/time.h>
4523
# if HAVE_SYS_TIME_H
4524
# include <sys/time.h>
4529
#if HAVE_SYS_PARAM_H
4530
# include <sys/param.h>
4532
#include <sys/types.h>
4533
#if HAVE_SYS_SYSCTL_H
4534
# include <sys/sysctl.h>
4540
struct timeval boottime;
4543
mib[1] = KERN_BOOTTIME;
4545
len = sizeof(boottime);
4546
sysctl(mib, 2, &boottime, &len, NULL, NULL);
4547
if (boottime.tv_sec != 0)
4552
], ac_cv_NETSNMP_CAN_USE_SYSCTL=yes, ac_cv_NETSNMP_CAN_USE_SYSCTL=no, ac_cv_NETSNMP_CAN_USE_SYSCTL=no)])
4555
if test "x$ac_cv_NETSNMP_CAN_USE_SYSCTL" = "xyes"; then
4556
AC_DEFINE(NETSNMP_CAN_USE_SYSCTL)
4560
# In FreeBSD 4.x, the TCP timer constants aren't. They are defined
4561
# in terms of 'hz', the kernel clock tick. In this case,
4562
# we need to have a local variable 'hz' in scope and set to a useful
4563
# value whenever we use one of these constants.
4565
AC_CACHE_CHECK(whether TCP timers depend on 'hz',ac_cv_TCPTV_NEEDS_HZ,
4567
[#include <netinet/tcp_timer.h>
4569
], ac_cv_TCPTV_NEEDS_HZ=yes, ac_cv_TCPTV_NEEDS_HZ=no)])
4571
if test "x$ac_cv_TCPTV_NEEDS_HZ" = "xyes"; then
4572
AC_DEFINE(TCPTV_NEEDS_HZ)
4576
# define the agent libraries variables
4580
AC_SUBST(OTHERAGENTLIBOBJS)
4581
AC_SUBST(OTHERAGENTLIBLOBJS)
4584
# Prompt for various bits of user information
4587
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
4588
AC_CACHE_CHECK(whether to prompt for values, ac_cv_have_warned,
4590
if test "x$defaults" = "xno"; then
4593
************** Configuration Section **************
4595
You are about to be prompted with a series of questions. Answer
4596
them carefully, as they determine how the SNMP agent and related
4597
applications are to function.
4599
After the configure script finishes, you can browse the newly
4600
created net-snmp-config.h file for further - less important - parameters to
4601
modify. Be careful if you re-run configure though, since net-snmp-config.h
4602
will be overwritten.
4604
-Press return to continue-
4608
ac_cv_have_warned="yes"
4610
ac_cv_have_warned="no"
4614
ac_cv_have_warned="yes"
4618
if test -f /etc/resolv.conf; then
4619
LOC=`cat /etc/resolv.conf | grep '^domain' | tail -1 | awk '{print $NF}'`
4624
AC_PROMPT_USER(NETSNMP_DEFAULT_SNMP_VERSION,[
4626
*** Default SNMP Version:
4628
Starting with Net-SNMP 5.0, you can choose the default version of
4629
the SNMP protocol to use when no version is given explicitly on the
4630
command line, or via an 'snmp.conf' file. In the past this was set to
4631
SNMPv1, but you can use this to switch to SNMPv3 if desired. SNMPv3
4632
will provide a more secure management environment (and thus you're
4633
encouraged to switch to SNMPv3), but may break existing scripts that
4634
rely on the old behaviour. (Though such scripts will probably need to
4635
be changed to use the '-c' community flag anyway, as the SNMPv1
4636
command line usage has changed as well.).
4637
At this prompt you can select \"1\", \"2\" (for SNMPv2c), or \"3\" as
4638
the default version for the command tools (snmpget, ...) to use. This
4639
can always be overridden at runtime using the -v flag to the tools, or
4640
by using the \"defVersion\" token in your snmp.conf file.
4641
Providing the --with-default-snmp-version=\"x\" parameter to ./configure
4642
will avoid this prompt.
4644
Default version of SNMP to use],3,unquoted)
4646
# we tested this above before the prompt, but the prompt may give a new value.
4647
if test "$ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION" = "2c"; then
4648
ac_cv_user_prompt_NETSNMP_DEFAULT_SNMP_VERSION="2"
4650
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
4651
AC_MSG_ERROR([Illegal version number. Only 1, 2 (for SNMPv2c) and 3 are supported.])
4654
AC_PROMPT_USER(NETSNMP_SYS_CONTACT,[
4656
*** System Contact Information:
4658
Describes who should be contacted about the host the agent is
4659
running on. This information is available in the MIB-II tree. This
4660
can also be over-ridden using the \"syscontact\" syntax in the agent's
4661
configuration files.
4662
Providing the --with-sys-contact=\"contact\" parameter to ./configure
4663
will avoid this prompt.
4665
System Contact Information],$ME@$LOC,quoted)
4667
AC_PROMPT_USER(NETSNMP_SYS_LOC,[
4669
*** System Location:
4671
Describes the location of the system. This information is
4672
available in the MIB-II tree. this can also be over-ridden using the
4673
\"syslocation\" syntax in the agent's configuration files.
4674
Providing the --with-sys-location=\"location\" parameter to ./configure
4675
will avoid this prompt.
4677
System Location],Unknown,quoted)
4679
if test -d /var/log; then
4680
defaultlog="/var/log/snmpd.log"
4682
defaultlog="/usr/adm/snmpd.log"
4685
AC_PROMPT_USER(NETSNMP_LOGFILE,[
4687
*** Logfile location:
4689
Enter the default location for the snmpd agent to dump
4690
information & errors to. If not defined (enter the keyword \"none\"
4691
at the prompt below) the agent will use stdout and stderr instead.
4692
(Note: This value can be over-ridden using command line options.)
4693
Providing the --with-logfile=\"path\" parameter to ./configure
4694
will avoid this prompt.
4696
Location to write logfile],$defaultlog,quoted)
4698
if test -d /var; then
4699
defaultstore="/var/net-snmp"
4700
ucddefaultstore="/var/ucd-snmp"
4702
defaultstore="/etc/net-snmp"
4703
ucddefaultstore="/etc/ucd-snmp"
4706
AC_PROMPT_USER(NETSNMP_PERSISTENT_DIRECTORY,[
4708
*** snmpd persistent storage location:
4710
Enter a directory for the SNMP library to store persistent
4711
data in the form of a configuration file. This default location is
4712
different than the old default location (which was for ucd-snmp). If
4713
you stay with the new path, I'll ask you in a second if you wish to
4714
copy your files over to the new location (once only). If you pick
4715
some other path than the default, you'll have to copy them yourself.
4716
There is nothing wrong with picking the old path ($ucddefaultstore) if
4718
Providing the --with-persistent-directory=\"path\" parameter to
4719
./configure will avoid this prompt.
4721
Location to write persistent information],$defaultstore,quoted)
4723
PERSISTENT_DIRECTORY=$ac_cv_user_prompt_NETSNMP_PERSISTENT_DIRECTORY
4724
AC_SUBST(PERSISTENT_DIRECTORY)
4725
UCDPERSISTENT_DIRECTORY=$ucddefaultstore
4726
AC_SUBST(UCDPERSISTENT_DIRECTORY)
4728
if test $PERSISTENT_DIRECTORY = "$defaultstore" -a -d "$ucddefaultstore" -a ! -d "$defaultstore" ; then
4729
AC_CACHE_CHECK(If we should copy the old persistent directory, ac_cv_user_prompt_COPY_PERSISTENT_FILES,
4731
AC_PROMPT_USER_NO_DEFINE(ac_cv_user_prompt_COPY_PERSISTENT_FILES,[
4733
*** Copying old ucd-snmp persistent files to net-snmp persistent directory:
4735
Would you like to copy the older ucd-snmp persistent files
4736
into your new net-snmp persistent file path? This will functionally
4737
save all your ucd-snmp data and let it be used within the net-snmp
4738
tools. This will only be done once when you run make install. If you
4739
wish to do this, enter "yes" at the prompt.
4740
Providing the --with-copy-persistent-files=\"no\" (or \"yes\")
4741
parameters to ./configure will avoid this prompt.
4743
Copy ucd-snmp data into the net-snmp data directory],"yes")
4746
ac_cv_user_prompt_COPY_PERSISTENT_FILES="no"
4748
COPY_PERSISTENT_FILES="$ac_cv_user_prompt_COPY_PERSISTENT_FILES"
4749
AC_SUBST(COPY_PERSISTENT_FILES)
4753
AC_CONFIG_FILES([Makefile:Makefile.top:Makefile.in:Makefile.rules])
4754
AC_CONFIG_FILES([snmplib/Makefile:Makefile.top:snmplib/Makefile.in:Makefile.rules:snmplib/Makefile.depend])
4755
AC_CONFIG_FILES([apps/Makefile:Makefile.top:apps/Makefile.in:Makefile.rules:apps/Makefile.depend])
4756
AC_CONFIG_FILES([apps/snmpnetstat/Makefile:Makefile.top:apps/snmpnetstat/Makefile.in:Makefile.rules:apps/snmpnetstat/Makefile.depend])
4757
AC_CONFIG_FILES([agent/Makefile:Makefile.top:agent/Makefile.in:Makefile.rules:agent/Makefile.depend])
4758
AC_CONFIG_FILES([agent/helpers/Makefile:Makefile.top:agent/helpers/Makefile.in:Makefile.rules:agent/helpers/Makefile.depend])
4759
AC_CONFIG_FILES([agent/mibgroup/Makefile:Makefile.top:agent/mibgroup/Makefile.in:Makefile.rules:agent/mibgroup/Makefile.depend])
4760
AC_CONFIG_FILES([local/Makefile:Makefile.top:local/Makefile.in:Makefile.rules])
4761
AC_CONFIG_FILES([testing/Makefile:Makefile.top:testing/Makefile.in])
4762
AC_CONFIG_FILES([man/Makefile:Makefile.top:man/Makefile.in:Makefile.rules])
4763
AC_CONFIG_FILES([mibs/Makefile:Makefile.top:mibs/Makefile.in:Makefile.rules])
4764
AC_CONFIG_FILES([net-snmp-config:net-snmp-config.in],
4765
[chmod +x net-snmp-config])
4767
AC_CONFIG_COMMANDS([default], echo timestamp > stamp-h)
4770
# protect PACKAGE_* variables
4772
AH_VERBATIM([PACKAGE_BUGREPORT],[/* Define to the address where bug reports for this package should be sent. */
4773
#ifndef PACKAGE_BUGREPORT
4774
#undef PACKAGE_BUGREPORT
4776
AH_VERBATIM([PACKAGE_NAME],[/* Define to the full name of this package. */
4777
#ifndef PACKAGE_NAME
4780
AH_VERBATIM([PACKAGE_STRING],[/* Define to the full name and version of this package. */
4781
#ifndef PACKAGE_STRING
4782
#undef PACKAGE_STRING
4784
AH_VERBATIM([PACKAGE_TARNAME],[/* Define to the one symbol short name of this package. */
4785
#ifndef PACKAGE_TARNAME
4786
#undef PACKAGE_TARNAME
4788
AH_VERBATIM([PACKAGE_VERSION],[/* Define to the version of this package. */
4789
#ifndef PACKAGE_VERSION
4790
#undef PACKAGE_VERSION
4795
AC_MSG_CACHE_DISPLAY()
4798
# comment-start: "#"