File: config_os_headers

package info (click to toggle)
net-snmp 5.9+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 36,760 kB
  • sloc: ansic: 283,039; perl: 17,712; sh: 11,887; makefile: 2,705; xml: 663; python: 623; pascal: 62; sql: 47
file content (505 lines) | stat: -rw-r--r-- 13,647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
#########################################
##
# Checks for header files.
##
#########################################

##
#   Standard checks:
##
#  Core:
AC_HEADER_STDC          #  <stdlib.h>, <stdarg.h>,   <string.h>  & <float.h>
AC_HEADER_DIRENT        #  <dirent.h>, <sys/ndir.h>, <sys/dir.h> & <ndir.h>
#  Apps:
# Don't use <sys/wait.h> when using Windows sockets
case x$with_socklib in
  xwinsock2)
    ;;
  *)
    AC_HEADER_SYS_WAIT  #  <sys/wait.h>
esac

# allow for quick module/library/etc processing checks
if test "x$NETSNMP_QUICK_CHECK" = "x" ; then

##
#   Stand-alone headers:
##
#  Core:
AC_CHECK_HEADERS([getopt.h   pthread.h  regex.h      ] dnl
                 [string.h   syslog.h   unistd.h     ] dnl
                 [stdint.h   inttypes.h              ] dnl
                 [process.h          ] dnl
                 [sys/param.h        ] dnl
                 [sys/select.h       ] dnl
                 [sys/syslog.h       ] dnl
                 [sys/time.h         ] dnl
                 [sys/timeb.h        ])

#  Library and Agent:
AC_CHECK_HEADERS([nlist.h],,,[
AC_INCLUDES_DEFAULT
[
#ifndef LIBBSD_DISABLE_DEPRECATED
#define LIBBSD_DISABLE_DEPRECATED 1
#endif
]])

#  Library:
AC_CHECK_HEADERS([crt_externs.h                        ] dnl
                 [fcntl.h    io.h       kstat.h        ] dnl
                 [limits.h   locale.h                  ] dnl
                 [mach-o/dyld.h                        ] dnl
                 [sys/file.h       sys/ioctl.h         ] dnl
                 [sys/sockio.h     sys/stat.h          ] dnl
                 [sys/systemcfg.h  sys/systeminfo.h    ] dnl
                 [sys/times.h      sys/uio.h           ] dnl
                 [sys/utsname.h      ] dnl
                 [netipx/ipx.h       ])

#  Agent:
AC_CHECK_HEADERS([dlfcn.h    err.h      fcntl.h    fstab.h      ] dnl
                 [           grp.h      io.h                    ] dnl
                 [ioctls.h   kstat.h    kvm.h      limits.h     ] dnl
                 [           mntent.h   mtab.h                  ] dnl
                 [           pkglocs.h             pwd.h        ] dnl
                 [           com_err.h             et/com_err.h ] dnl
                 [           utmpx.h    utsname.h               ])

AC_CHECK_HEADERS([sys/diskio.h  sys/dkio.h                                 ] dnl
                 [sys/file.h    sys/filio.h   sys/fixpoint.h               ] dnl
                 [sys/fs.h      sys/ioctl.h   sys/loadavg.h   sys/mntent.h ] dnl
                 [sys/mnttab.h  sys/pool.h    sys/protosw.h   sys/pstat.h  ] dnl
                 [sys/sockio.h  sys/stat.h    sys/statfs.h    sys/statvfs.h] dnl
                 [sys/stream.h  sys/sysget.h  sys/sysmacros.h sys/sysmp.h  ] dnl
                 [sys/tcpipstats.h            sys/utsname.h  sys/vfs.h     ] dnl
                 [sys/vm.h      sys/vmmac.h   sys/vmmeter.h  sys/vmparam.h ] dnl
                 [sys/vmsystm.h                                            ])

AC_CHECK_HEADERS([asm/page.h asm/types.h               ] dnl
                 [inet/mib2.h                          ] dnl
                 [linux/hdreg.h linux/tasks.h          ] dnl
                 [machine/param.h                      ] dnl
                 [ufs/fs.h                             ] dnl
                 [uvm/uvm_extern.h uvm/uvm_param.h     ] dnl
                 [vm/vm.h vm/vm_extern.h vm/vm_param.h ])

#  Apps:
AC_CHECK_HEADERS([fcntl.h    grp.h      pwd.h      ] dnl
                 [sys/cdefs.h   sys/ioctl.h        ] dnl
                 [sys/time.h                       ])

#  Not-Used:
AC_CHECK_HEADERS([search.h   sgtty.h    xti.h      ] dnl
                 [sys/dmap.h sys/poll.h            ] dnl
                 [sys/timeout.h                    ] dnl
                 [machine/pte.h                    ] dnl
                 [pci/pci.h                        ])


# Valgrind
AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h])
# OpenSSL
AC_CHECK_HEADERS([openssl/aes.h ])     #  (Core)
AC_CHECK_HEADERS([openssl/dh.h  ])     #  (Apps)
#  Not-Used:
AC_CHECK_HEADERS([openssl/des.h  openssl/hmac.h ] dnl
                 [openssl/evp.h  security/cryptoki.h])

# RPM subdirectory path                   (Agent)
if test "x$with_rpm" != "xno"; then
  AC_CHECK_HEADERS([rpm/rpmts.h   rpm/rpmfileutil.h], [], [],
		   [[#include <rpm/rpmlib.h>]])
fi


##
#   Pre-requisite on other headers:
##

#       requiring <sys/param.h>  (MAXPATHLEN)           (OpenBSD 3.4)
#  Agent:
#
AC_CHECK_HEADERS(sys/swap.h,,,
    AC_INCLUDES_DEFAULT([])
    [
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
    ])

#       requiring <sys/param.h>                         (FreeBSD)
#
AC_CHECK_HEADERS([malloc.h        osreldate.h                   ] dnl
                 [machine/types.h ] dnl
                 [sys/dkstat.h    sys/conf.h    sys/mbuf.h      ] dnl
                 [sys/mount.h     sys/proc.h    sys/queue.h     ] dnl
                 [sys/user.h                                    ],,,
    [[
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
    ]])

case "$target_os" in
    linux*)
	# <sys/sysctl.h> is considered deprecated on Linux and including that
	# header file triggers a compiler warning. See also
	# https://savannah.gnu.org/forum/forum.php?forum_id=9515.
        ;;
    *)
	AC_CHECK_HEADERS([sys/sysctl.h])
        ;;
esac

#       requiring <sys/sema.h>                          (IRIX 6.5)
#  Agent:
#
AC_CHECK_HEADERS([sys/sema.h])
AC_CHECK_HEADERS(sys/hashing.h,,,
    AC_INCLUDES_DEFAULT([])
    [
#if HAVE_SYS_SEMA_H
#include <sys/sema.h>
#endif
    ])

#       requiring _KMEMUSER and <sys/types.h>           (BSDi3/IRIX)
#  Agent:
#
AC_CHECK_HEADERS(sys/vnode.h,,,
    [
#define _KMEMUSER 1
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
    ])

#       requiring <machine/types.h>                     (NetBSD)
#  Agent:
#
AC_CHECK_HEADERS(sys/disklabel.h,,,
    [[
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_MACHINE_TYPES_H
#include <machine/types.h>
#endif
    ]])

#	QNX
AC_CHECK_HEADERS([nbutil.h])

#       UFS headers
#  Agent:
#
AC_CHECK_HEADERS([ufs/ufs/dinode.h ufs/ufs/quota.h ufs/ufs/inode.h ufs/ffs/fs.h],,,
    [[
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_UFS_UFS_DINODE_H
#include <ufs/ufs/dinode.h>
#endif
#if HAVE_UFS_UFS_QUOTA_H
#include <ufs/ufs/quota.h>
#endif
    ]])

#       requiring <vm/vm.h>                             (BSDi2)
#  Agent:
#
AC_CHECK_HEADERS(vm/swap_pager.h,,,
    [[
#if HAVE_VM_VM_H
#include <vm/vm.h>
#endif
    ]])

#       netlink/rtnetlink                               (Linux)
#  Agent:
#
AC_CHECK_HEADERS([linux/netlink.h  linux/rtnetlink.h],,,
    [[
#if HAVE_ASM_TYPES_H
#include <asm/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_LINUX_NETLINK_H
#include <linux/netlink.h>
#endif
    ]])

#
# Avoid that on MinGW any networking headers get included that are
# incompatible with <winsock2.h> by only testing for certain headers if not
# building for one of these two platforms.
#

case x$with_socklib in
  xwinsock2)
    ;;
  *)

AC_CHECK_HEADERS([sys/socket.h]dnl
                 [sys/un.h]dnl
                 [netinet/tcp_fsm.h]dnl
                 [sys/sockio.h]dnl
                 [sys/socketvar.h]dnl
                 [net/if_dl.h]dnl
                 [net/if_types.h]dnl
                 [arpa/inet.h]dnl
                 [net/if.h]dnl
                 [netinet/in.h]dnl
                 [netdb.h]dnl
                 [net/if_arp.h]dnl
                 [net/if_mib.h]dnl
                 [net/if_var.h]dnl
                 [netinet/if_ether.h]dnl
                 [netinet/in_systm.h]dnl
                 [netinet/in_var.h]dnl
                 [netinet/ip.h]dnl
                 [netinet/ip_icmp.h]dnl
                 [netinet/icmp_var.h]dnl
                 [netinet/ip_var.h]dnl
                 [netinet/tcp.h]dnl
                 [netinet/tcp_timer.h]dnl
                 [netinet/tcp_var.h]dnl
                 [netinet/tcpip.h]dnl
                 [netinet/udp.h]dnl
                 [netinet/udp_var.h]dnl
                 [net/route.h]dnl
                 [netinet/icmp6.h]dnl
                 [netinet/in_pcb.h]dnl
                 [netinet/ip6.h]dnl
                 [netinet6/in6_var.h]dnl
                 [netinet6/in6_pcb.h]dnl
                 [netinet6/ip6_var.h]dnl
                 [netinet6/nd6.h]dnl
                 [netinet6/tcp6.h]dnl
                 [netinet6/tcp6_fsm.h]dnl
                 [netinet6/tcp6_timer.h]dnl
                 [netinet6/tcp6_var.h]dnl
                 ,,,
    [[
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_TIMEOUT_H
#include <sys/timeout.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_SYS_SOCKETVAR_H
#include <sys/socketvar.h>
#endif
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#if HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#if HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
#if HAVE_NETINET_IP_H
#include <netinet/ip_icmp.h>
#endif
#if HAVE_NET_IF_H
#include <net/if.h>
#endif
#if HAVE_NET_IF_VAR_H
#include <net/if_var.h>
#endif
#if HAVE_NETINET_IP_VAR_H
#include <netinet/ip_var.h>
#endif
#if HAVE_NETINET_IP_ICMP_H
#include <netinet/ip_icmp.h>
#endif
#if HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
#if HAVE_NETINET_UDP_H
#include <netinet/udp.h>
#endif
#if HAVE_NETINET_TCP_TIMER_H
#include <netinet/tcp_timer.h>
#endif
#if HAVE_NETINET_IP6_H
#include <netinet/ip6.h>
#endif
#if HAVE_NETINET_ICMP6_H
#include <netinet/icmp6.h>
#endif
    ]])

esac

##
#   Pre-requisite on specific types
##

#       Special hack to get around various problems on older Linux kernels
#       (major ugh!)
#  Agent:
#
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <linux/ethtool.h>],[])],
		  AC_CHECK_HEADERS([linux/ethtool.h]),
AC_CHECK_HEADERS([linux/ethtool.h],,,
[[
#include <linux/types.h>
typedef __u64 u64;         /* hack, so we may include kernel's ethtool.h */
typedef __u32 u32;         /* ditto */
typedef __u16 u16;         /* ditto */
typedef __u8 u8;           /* ditto */
]])
AC_DEFINE([HAVE_LINUX_ETHTOOL_NEEDS_U64], 1,
          [Define if __u8 .. __u64 must be declared explicitly before including <linux/ethtool.h>]))

##
#   Headers requiring particular libraries
##

#       for HostRes                                     (Solaris 2.x)
#  Agent:
#
AC_CHECK_HEADERS(pkginfo.h,
    NETSNMP_SEARCH_LIBS(pkginfo, adm,
        AC_DEFINE(HAVE_PKGINFO, 1, [define if you have pkginfo]),,,LMIBLIBS))

AC_CHECK_HEADERS(pkg.h,
    NETSNMP_SEARCH_LIBS(pkg_init, pkg,
        AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng])))

if test $ac_cv_header_pkg_h = no
then
    unset ac_cv_header_pkg_h
    netsnmp_save_CPPFLAGS="$CPPFLAGS"
    netsnmp_save_LDFLAGS="$LDFLAGS"
    CPPFLAGS="$CPPFLAGS -I/usr/local/include"
    LDFLAGS="$LDFLAGS -L/usr/local/lib"
    AC_CHECK_HEADERS(pkg.h,
        NETSNMP_SEARCH_LIBS(pkg_init, pkg,
	    AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng])))
    if test $ac_cv_header_pkg_h = no
    then
        CPPFLAGS="$netsnmp_save_CPPFLAGS"
        LDFLAGS="$netsnmp_save_LDFLAGS"
    fi
fi

case $target_os in
    aix*)
        #       for CPU/memory statistics               (AIX)
        #  Agent:
        #
        AC_CHECK_HEADERS(libperfstat.h,
            NETSNMP_SEARCH_LIBS(perfstat_cpu_total, perfstat,
                AC_DEFINE(HAVE_PERFSTAT, 1, [on aix, if you have perfstat]),
                AC_MSG_ERROR([

*** To monitor CPU/memory values in AIX you need to install
*** libperfstat which can be found in bos.perf
]),,
                LMIBLIBS),,
    [[
#if HAVE_SYS_PROTOSW_H
#include <sys/protosw.h>
#endif
    ]])
        ;;
    hpux*)
        #       HP-UX agent needs open_mib       (XXX - not a header check!)
        #
        NETSNMP_SEARCH_LIBS(open_mib, nm,
            AC_DEFINE(HAVE_LIBNM, 1, [define if you have libnm]),,,LMIBLIBS)
        ;;
    *)
        ;;
esac

#       for MIB-2 info                                  (Cygwin and MinGW)
#  Core:
#
AC_CHECK_HEADERS([windows.h iphlpapi.h], [], [], [
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
])

AC_CHECK_HEADERS([lm.h], [LAGENTLIBS="$LAGENTLIBS -lnetapi32"], [], [
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
])

#       for MIB-2 info                                  (MinGW)
#  Core:
#
if test x$with_socklib = xwinsock2; then
  AC_CHECK_HEADERS([winsock.h winsock2.h ws2tcpip.h],,,[#include <windows.h>])
fi

#
# for ucd-snmp/lmsensorsMib
#
AC_CHECK_HEADERS([sensors/sensors.h picl.h])

##  This is here to avoid loads of redefinition warnings during
##  module configuration

##
#   rtentry structure checks:
##

# Check struct rtentry for common fields
#   Agent:
#
AC_CHECK_MEMBERS([struct rtentry.rt_dst,
                  struct rtentry.rt_hash,
                  struct rtentry.rt_next,
                  struct rtentry.rt_refcnt,
                  struct rtentry.rt_unit,
                  struct rtentry.rt_use],,,
    [
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include <sys/types.h>
#ifdef NETSNMP_IFNET_NEEDS_KERNEL_STRUCTURES
#define _KERNEL_STRUCTURES 1
#endif
#ifdef HAVE_SYS_SOCKET_H
#ifdef NETSNMP_IFNET_NEEDS_KERNEL
#define KERNEL
#if !defined(__DragonFly__)
#define _KERNEL 1
#endif
#endif
#include <sys/socket.h>
#undef KERNEL
#undef _KERNEL
#endif
#ifdef HAVE_NET_ROUTE_H
#include <net/route.h>
#endif
    ])

fi # NETSNMP_QUICK_CHECK